{"draft":null,"from":258,"to":318,"files":[{"path":"src/engine/state-source.ts","added":12,"removed":16,"diff":"--- a/src/engine/state-source.ts\n+++ b/src/engine/state-source.ts\n@@ -41,19 +41,7 @@\n \t * all the news it was told: 4.3 MB for abso's 109 agents) otherwise push every small page out of the cache.\n \t */\n \treadonly #maxEntryBytes: number;\n-\t/**\n-\t * Collections read straight through, never kept (abso Capacity): a file's packed line pages are read only to lay the\n-\t * file out, and the view keeps the layout, so keeping the pages too held them twice and pushed out the small rows\n-\t * read on every call (an agent's tree re-read 3,500 of them each time).\n-\t */\n-\treadonly #passThrough: (collection: string) => boolean;\n-\tconstructor(\n-\t\tsource: GraphStateStorage,\n-\t\tmaxBytes = 1_048_576,\n-\t\tmaxEntries = 4096,\n-\t\tmaxEntryBytes = maxBytes,\n-\t\tpassThrough: (collection: string) => boolean = () => false,\n-\t) {\n+\tconstructor(source: GraphStateStorage, maxBytes = 1_048_576, maxEntries = 4096, maxEntryBytes = maxBytes) {\n \t\tif (\n \t\t\t!Number.isSafeInteger(maxBytes) ||\n \t\t\tmaxBytes < 0 ||\n@@ -67,7 +55,6 @@\n \t\tthis.#maxBytes = maxBytes;\n \t\tthis.#maxEntries = maxEntries;\n \t\tthis.#maxEntryBytes = Math.min(maxEntryBytes, maxBytes);\n-\t\tthis.#passThrough = passThrough;\n \t}\n \tget retainedBytes(): number {\n \t\treturn this.#bytes;\n@@ -87,7 +74,6 @@\n \t\t}\n \t}\n \tread(collection: string, key: string): unknown {\n-\t\tif (this.#passThrough(collection)) return this.#source.read(collection, key);\n \t\tconst cacheKey = JSON.stringify([collection, key]);\n \t\tconst hit = this.#cache.get(cacheKey);\n \t\tif (hit) {\n@@ -362,7 +348,9 @@\n \treturn new Proxy([] as T[], {\n \t\tget(target, key, receiver) {\n \t\t\tif (key === \"length\") return length();\n-\t\t\tif (indexKey(key)) return Number(key) < length() ? read(key) : undefined;\n+\t\t\t// No length read first (abso Capacity): set writes the row and the length together and nothing shrinks, so no\n+\t\t\t// row lies past the length. Half of a cold layout's reads were this length.\n+\t\t\tif (indexKey(key)) return read(key);\n \t\t\treturn Reflect.get(target, key, receiver);\n \t\t},\n \t\tset(_target, key, value) {\n@@ -433,6 +421,14 @@\n \t\t\t}\n \t\t\tfor (const [key] of storage.entries(`${name}:lengths`)) yield key;\n \t\t},\n+\t\t/** Values [index * PAGE, (index + 1) * PAGE) of `key`'s list: one page, not the whole list (abso Capacity). */\n+\t\tpageAt(key: string, index: number): readonly V[] {\n+\t\t\tconst count = length(key);\n+\t\t\tconst values = page(key, index);\n+\t\t\tif (values.length !== Math.min(pageSize, count - index * pageSize))\n+\t\t\t\tthrow new Error(`incomplete writer list page in ${name}`);\n+\t\t\treturn values;\n+\t\t},\n \t\t*values(key: string): IterableIterator<V> {\n \t\t\tconst count = length(key);\n \t\t\tfor (let start = 0; start < count; start += pageSize) {"}],"unmatched":[]}