Part 11 of 12 in BrainNet. Previous: Nearly Two Million Neurons in Three and a Half Gigabytes · Next: Twelve Ideas That Did Not Help
Every commit to our notes rebuilt the whole network. On 2026-11-06, one rebuild took 49 seconds and 8.4 GB of memory. Four callers at once ran four full rebuilds in a row, 268 seconds in total. This part shows how each change moved those numbers, and which bugs the changes shipped with.
Four changes, each with its own check
| change | before | after | check |
|---|---|---|---|
| At most one waiting caller; later callers exit | 4 callers, 268 s (4 x 67 s) | 2 runs, 83 s | synthetic lock test: coalesced, coalesced, ran |
| Input stamp: skip when inputs are unchanged | 51.8 s, 8.4 GB | 1.5 s, 203 MB | second refresh printed "skipped rebuild" |
| One merged rebuild per 30 minutes, one trailing run | a changed input ran a full bridge each time | 5 commits in 2 minutes: 0 bridge runs, 1 trailing run | process poll every 0.5 s |
| Per-store bridge cache: rescore changed notes only | 49.4 s, 8.40 GB; bridge scoring about 35 s | 15.8 s, 6.07 GB; bridge scoring 0.02 s | cold, warm and changed-note runs equal the no-cache output byte for byte |
The last step was a memory change. Reading the vectors from a mapped file cut the load from 8.8 seconds to 6.3 seconds and peak memory from 6.07 GB to 5.78 GB. On 2026-11-06 the warm refresh took about 16 seconds. On 2026-11-19 it took 15.6 seconds and peaked at 7.40 GB (see below). The rebuild runs at most once every 30 minutes, with one trailing run for the changes that arrive in between.
Build times, separate from refresh
A refresh is a rebuild of the merged network from the stored vectors. A full build also embeds new text, and the costs there are larger:
- 4,183 neurons, the vault only: 0.95 seconds and 175 MB peak, on 2026-10-21.
- The 10 percent Wikipedia store: 157 seconds, from the build script's own timing in our skill file.
- The 40 percent store: parse 177 seconds, embedding 265 seconds, 8.6 GB on disk, on 2026-10-22.
- The full dump, 7,219,311 articles: parse 468 seconds, embedding at 8,230 rows a second, 521 seconds in total, on 2026-10-30.
Four bugs the changes shipped with
The stamp missed an input. The skip check first covered only the vault. A link-only edit changed the network file under an unchanged stamp, so the rebuild was skipped when it should have run. The stamp now covers both vaults. A review then found the PaperBrain metadata file missing from it too, and that was added with a verifier.
A child kept the lock. The rate limiter's detached sleeper inherited the lock's file descriptors and held the refresh lock for 30 minutes. That blocked even the cheap vector update. The fix closes descriptors 8 and 9 before the child starts, and a check confirms the sleeper holds none.
The sleeper held its own lock. The trailing run kept its lock while it ran the refresh it was meant to schedule. A forced rebuild during the sleep then lost the next trailing run. A review by a separate model found it. The verifier passed on the fix and failed on the old code, which made two bridges where three were due.
The mapping was freed too early. The first version of the mapped read released the mapping before a copy that still read from it, and the build segfaulted. It was installed live for about two minutes before the tests ran. We restored the previous binary from git, fixed the lifetime and reran the tests. The live rank output matched afterwards.
What is still open
The remaining warm cost is in the parse of the metadata file and the mean (2.1 seconds), and the load (6.3 seconds). Those are small, and our notes call further gains small. The 2026-11-06 figure was measured on a busy machine, on an earlier store. The refresh was measured again on 2026-11-19 on the store of 1,855,596 neurons. Its time passed the 30 second line, and its memory peak failed the 6.5 GB line.
Measured again on 2026-11-19
Refresh on a copy of the merged store, 10 runs each (.work/amarbaro/bench/RESULTS.md item 11, made by .work/amarbaro/bench/11-refresh.sh; log in .work/amarbaro/bench/11-refresh.log):
| run | elapsed s, median (range) | max RSS MB, median (range) |
|---|---|---|
| cold, bridge cache removed | 44.8 (44.0 to 50.2) | 6916.1 (6840.1 to 6916.8) |
| warm, cache kept | 15.6 (15.4 to 15.6) | 7398.1 (7396.7 to 7398.5) |
The time line holds: warm 15.6 s is under 30 s. The memory line fails: warm peak 7.40 GB is above 6.5 GB, and 28 percent above the 5.78 GB of 2026-11-06. Neuron count grew 13 percent over the same span. That growth does not by itself explain a 28 percent rise, and we have not found the cause.

Comentários
Sem comentários ainda.