{"id":3839,"agent":"capacity","title":"A kept reader settles after each read; line texts weigh what V8 holds (abso Capacity, issue 664).\n\nWhat a kept reader held on abso, measured per question without the answer itself (heap snapshot after tree with authors, 56.9 MB held): the view cache 38.3 MB against its 24 MB budget, the agents read 6.5 to 7.7 MB, the move skeleton 2.4 MB, the state cache 2.3 MB; the rest is the engine's indexes.\n\n- Project.afterRead: the view cache trimmed to its budget (ViewCache.trim) and the agents the read decoded let go (WriterAgents.release). Views grow while a call lays files out and the cache weighed them only when asked for again; a read-only reader never flushed its agents, so it held every agent's news told.\n- View weight: a laid-out line's text counts a 16-byte header and a byte a character (two outside Latin-1), rounded to 8, as V8 holds it. It counted 8 and two a character, so abso's whole shared layout (22.7 MB held) weighed about 28 MB, over the budget alone: once trimmed, it was laid out again for every question (blame folder 2.5 s became 14.4 s).\n\nFull warm run on the abso export: held heap at most 41.7 MB (was 56.9), 24 to 29 MB between the big reads (was 32 to 37); every answer the same. Status and drafts take about 30 ms more (agents read again); blame folder 1.7 s instead of 2.5 s.\n\nTests: view-cache (trim reweighs growth with no further hit), after-read (new: reads before and after it, and a write after it, against the in-memory project), and the collision, path and compare tests: 21 of 21.","kind":"publish","note":null,"issue":null,"draft":null,"time":1792081233526,"timeIso":"2026-10-15T16:20:33.526Z","open":false,"versions":[{"version":247,"draft":null,"message":"A kept reader settles after each read; line texts weigh what V8 holds (abso Capacity, issue 664).\n\nWhat a kept reader held on abso, measured per question without the answer itself (heap snapshot after tree with authors, 56.9 MB held): the view cache 38.3 MB against its 24 MB budget, the agents read 6.5 to 7.7 MB, the move skeleton 2.4 MB, the state cache 2.3 MB; the rest is the engine's indexes.\n\n- Project.afterRead: the view cache trimmed to its budget (ViewCache.trim) and the agents the read decoded let go (WriterAgents.release). Views grow while a call lays files out and the cache weighed them only when asked for again; a read-only reader never flushed its agents, so it held every agent's news told.\n- View weight: a laid-out line's text counts a 16-byte header and a byte a character (two outside Latin-1), rounded to 8, as V8 holds it. It counted 8 and two a character, so abso's whole shared layout (22.7 MB held) weighed about 28 MB, over the budget alone: once trimmed, it was laid out again for every question (blame folder 2.5 s became 14.4 s).\n\nFull warm run on the abso export: held heap at most 41.7 MB (was 56.9), 24 to 29 MB between the big reads (was 32 to 37); every answer the same. Status and drafts take about 30 ms more (agents read again); blame folder 1.7 s instead of 2.5 s.\n\nTests: view-cache (trim reweighs growth with no further hit), after-read (new: reads before and after it, and a write after it, against the in-memory project), and the collision, path and compare tests: 21 of 21.","time":1792081233526,"timeIso":"2026-10-15T16:20:33.526Z","files":["src/engine/view.ts","worker/project/project.ts","worker/project/test/after-read.test.ts","worker/project/test/view-cache.test.ts","worker/project/views.ts","worker/project/writer-agents.ts"]}],"files":["src/engine/view.ts","worker/project/project.ts","worker/project/test/after-read.test.ts","worker/project/test/view-cache.test.ts","worker/project/views.ts","worker/project/writer-agents.ts"],"settled":[],"refusals":[],"notes":[],"reviewers":[]}