← Blog
✎Blogbeitrag

Nearly Two Million Neurons in Three and a Half Gigabytes

A cinematic photograph of an open hard disk drive with its platter exposed and a brass spindle, on a steel bench, in teal and steel with a warm amber light, the AMARBARO mark and wordmark centred over it.

The merged network holds 1,855,596 neurons in 3.50 GB of core files, and its resident rank server uses 747 MB, with the files growing faster than the neuron count.

Part 10 of 12 in BrainNet. Previous: The Reranker Won Three Questions and Lost None · Next: A Commit Used to Cost Fifty Seconds

The merged network now holds 1,855,596 neurons. Its four core files take 3.50 GB on disk. The rank server that keeps them loaded sits at 747 MB resident after 88 questions, while our skill file from 2026-11-13 said about 0.5 GB. This part measures what the network costs to hold, and which copies cost the most.

What is on disk

Each file has one job. The synapse file is read in place as a compressed sparse list of links between neurons. The path file holds the text of each neuron's path, which is what lets a result be printed. The bit file is a sign-bit prefilter of 48 bytes a row, which the ask step scans first to discard most candidates cheaply. The activation file is written on each query, and a reader depends on it, so it stays. We read the file sizes on 2026-11-19 with stat -c '%s bytes':

file bytes what it holds
net.bin 78,225,316 synapse lists
net.paths 160,206,007 one path per neuron
net.vecs 3,165,852,672 one embedding per neuron
net.bits 98,932,896 a sign-bit prefilter, 48 bytes a row

The four files total 3,503,216,891 bytes, or 3.50 GB, which is about 1.9 KB per neuron. Most of it is vectors: the vector file alone comes to about 1.7 KB per neuron. Our notes do not give the vector dimension or the row count of that file, so we have not checked whether it holds exactly one row per neuron.

Two things are off. The neuron count in our index file, regenerated on 2026-11-18, is 1,855,596. On 2026-11-13 it was 1,640,443, so neurons grew 13 percent. Our skill file gave the 2026-11-13 file sizes as 52 MB, 122 MB and 2.4 GB, with no unit label. Against today's files, that is growth of a fifth to a half, depending on whether the old figures were decimal or binary units. Files grew faster than neurons. We have not found out why.

The files are one network, not one per store, so every store added to the merge adds to all of them. At the per-neuron rate above, another million neurons would add about 1.9 GB of files. That is an estimate from today's ratio, not a measurement, and the vector file's growth above suggests the ratio is not fixed.

What is in memory

The three servers that brain-ask starts were read with ps -o pid=,rss=,args= after the 88-question served loop on 2026-11-19 (.work/amarbaro/bench/RESULTS.md item 3, made by .work/amarbaro/bench/03-memory.sh). MB here is KiB times 1024, divided by 10^6:

process resident (ps KiB) resident (MB)
rank (brainnet serve) 729,860 747
embed 160,984 165
rerank 228,468 234

The three total about 1.15 GB. Resident size counts mapped file pages once a process has touched them, so it grows with the questions asked. Our notes gave the rank server about 0.5 GB on 2026-11-13. Today's figure is about half again as large, while the store grew 13 percent. We have not separated the store growth from the server's query history.

The copies that cost the most

Most of our memory history is one mistake repeated. A job copied a file into memory that it only needed to read.

  • Wikipedia questions, 2026-10-21. Each question copied the 540 MB link file and the 1.8 GB vector file. Peak memory was 6.9 GB. Mapping both files brought it to 1.9 GB.
  • Plasticity runs, 2026-11-03. The predict step read the whole shared 10.6 GB vector file, which holds 7.2 million rows for a 1.18 million neuron store. Mapping it cut memory from 21 GB to 4.5 GB.
  • Warm refresh, 2026-11-06. Every store's vectors went into one list before scoring. Peak memory was 8.40 GB. Reading from a mapped file brought it to 5.78 GB.
  • Wikipedia extraction, 2026-10-21. Extracting 3,000 articles held the whole byte prefix of the dump in memory: 19 GB.
  • Full dump parse, 2026-10-30. The parser's peak resident size was about 22 GB.

What we did not measure

The peaks the speed plan asked for are now measured, with /usr/bin/time, not heaptide (below). The file-to-neuron ratio above needs a brainnet stats run on the merged store before anyone builds on it.

Measured again on 2026-11-19

  • Peak memory, one cold question, servers off: the largest process peaked at a median 333.9 MB (range 333.7 to 334.8, n=10), elapsed 0.9 s (.work/amarbaro/bench/03-memory.sh).
  • Rank before and after the mapping change, same store snapshot, five runs each (.work/amarbaro/bench/04-rank.sh). Peak RSS in MB, median:
variant binary elapsed s (median) peak RSS MB (median, range) stdout md5
A brainnet.prev 1.3 775.8 (775.4 to 776.5) bef08ef64037
A brainnet 0.3 333.9 (333.7 to 334.2) bef08ef64037
B brainnet.prev 1.3 775.9 (775.5 to 776.1) 36d27d62a74f
B brainnet 0.3 333.8 (333.7 to 334.0) 36d27d62a74f

Stdout matched within each variant. The peak fell by about 57 percent. Caveat: RESULTS.md does not record a check that brainnet.prev is the pre-mapping build, so the comparison is not yet proven to be before and after.

How to prove this wrong

Run brainnet stats on the merged store and compare its neuron count with 1,855,596. Then ask 88 questions and read the rank server's resident size with ps. If the count differs, or the server is above 1 GB, our figures are wrong and we will replace them.

Provenance

  • .work/amarbaro/bench/RESULTS.md items 3 and 4 (2026-11-19), made by .work/amarbaro/bench/03-memory.sh and .work/amarbaro/bench/04-rank.sh

  • ~/.local/share/coios-brain/merged/net.bin, net.paths, net.vecs, net.bits: sizes from stat -c '%s bytes', 2026-11-19

  • ps -o pid=,rss=,args= -C embed,rerank,brainnet: resident sizes, 2026-11-19
  • ~/.claude/INDEX.md: merged layer counts, regenerated 2026-11-18 (1,855,596 total)
  • ~/Brain/Skills/own/brainnet/SKILL.md: 2026-11-13 file sizes (52 MB, 122 MB, 2.4 GB), 1,640,443 neurons, 0.5 GB server estimate
  • ~/Brain/newera/2026-10-21-brainnet-eps.md: 6.9 to 1.9 GB, 540 MB and 1.8 GB copies
  • ~/Brain/newera/2026-11-03-brainnet-plastic.md: 10.6 GB copy, 21 to 4.5 GB, 3.36 to 2.35 GB
  • ~/Brain/brainnet/2026-11-06-cpu-spikes.md: 8.40 GB, 6.07 GB, 5.78 GB
  • ~/Brain/newera/2026-10-21-brainnet.md: 19 GB extraction
  • ~/Brain/newera/2026-10-26-neuron-pipeline-speed.md: parser peak about 22 GB
  • ~/iTools/brain/brain-ask/PLAN-speed-ax.md: the planned heaptide check that was not recorded

Kommentare

Noch keine Kommentare.

Anmelden um zu kommentieren.