--- a/src/engine/state-source.ts
+++ b/src/engine/state-source.ts
@@ -41,19 +41,7 @@
4141 * all the news it was told: 4.3 MB for abso's 109 agents) otherwise push every small page out of the cache. 4343 readonly #maxEntryBytes: number; 44− /**
45− * Collections read straight through, never kept (abso Capacity): a file's packed line pages are read only to lay the
46− * file out, and the view keeps the layout, so keeping the pages too held them twice and pushed out the small rows
47− * read on every call (an agent's tree re-read 3,500 of them each time).
48− */
49− readonly #passThrough: (collection: string) => boolean;
50− constructor(
51− source: GraphStateStorage,
52− maxBytes = 1_048_576,
53− maxEntries = 4096,
54− maxEntryBytes = maxBytes,
55− passThrough: (collection: string) => boolean = () => false,
56− ) {
44+ constructor(source: GraphStateStorage, maxBytes = 1_048_576, maxEntries = 4096, maxEntryBytes = maxBytes) { 5846 !Number.isSafeInteger(maxBytes) || @@ -67,7 +55,6 @@
6755 this.#maxBytes = maxBytes; 6856 this.#maxEntries = maxEntries; 6957 this.#maxEntryBytes = Math.min(maxEntryBytes, maxBytes); 70− this.#passThrough = passThrough;
7259 get retainedBytes(): number { @@ -87,7 +74,6 @@
8976 read(collection: string, key: string): unknown { 90− if (this.#passThrough(collection)) return this.#source.read(collection, key);
9177 const cacheKey = JSON.stringify([collection, key]); 9278 const hit = this.#cache.get(cacheKey); --- a/src/engine/test/state-cache.test.ts
+++ b/src/engine/test/state-cache.test.ts
@@ -163,24 +163,3 @@
163163 source.db.close(); 166−
167−test("a collection read straight through is never kept, and pushes nothing out (abso Capacity)", () => {
168− const source = new SqlState();
169− try {
170− const cache = new CachedStateStorage(source, 8192, 2, 8192, (collection) => collection === "pages");
171− source.write("rows", "a", "A");
172− source.write("rows", "b", "B");
173− for (let i = 0; i < 10; i++) source.write("pages", String(i), [i]);
174− cache.read("rows", "a");
175− cache.read("rows", "b");
176− const reads = source.reads;
177− for (let i = 0; i < 10; i++) assert.deepEqual(cache.read("pages", String(i)), [i]);
178− assert.equal(source.reads, reads + 10);
179− assert.equal(cache.read("rows", "a"), "A");
180− assert.equal(cache.read("rows", "b"), "B");
181− assert.equal(source.reads, reads + 10, "the two kept rows were not pushed out by the pages");
182− assert.equal(cache.retainedEntries, 2);
183− } finally {
184− source.db.close();
185− }
186−});
--- a/worker/project/project.ts
+++ b/worker/project/project.ts
@@ -255,8 +255,6 @@
255255const WRITER_CACHE_ROWS = 16_384; 256256/** The biggest row the writer cache keeps (abso Capacity): an agent and all the news it was told can be 100 KB. */ 257257const WRITER_CACHE_ROW_BYTES = 16_384; 258−/** A file's packed line pages: read only to lay it out, and the view keeps the layout (abso Capacity). */
259−const LAYOUT_PAGES: ReadonlySet<string> = new Set(["file-lines:pages", "file-texts:pages", "file-deletes:pages"]);
260258export interface WriterSource { 261259 readonly generation: number; 262260 readonly logLength: number; @@ -407,13 +405,7 @@
407405 throw Error("accepted atom indexing requires writer storage"); 408406 this.#store = store; 409407 this.#writerStorage = options.writerStorage 410− ? new CachedStateStorage(
411− options.writerStorage,
412− WRITER_CACHE_BYTES,
413− WRITER_CACHE_ROWS,
414− WRITER_CACHE_ROW_BYTES,
415− (collection) => LAYOUT_PAGES.has(collection),
416− )
408+ ? new CachedStateStorage(options.writerStorage, WRITER_CACHE_BYTES, WRITER_CACHE_ROWS, WRITER_CACHE_ROW_BYTES) 418410 if (this.#writerStorage) { 419411 const storage = this.#writerStorage;