Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed
MCP
show on this site's /mcp
CLI
abso show 260 --json
JSON
/christopher/abso-core/versions/260?format=json

The writer cache stops reading layout pages straight through (abso Capacity, issue 664).

of shared·capacity··Not checked

258 read file-lines, file-texts and file-deletes pages straight through the writer cache. A kept reader didn't gain from it (an agent's tree's time was elsewhere: counting authors line by line, fixed in the same version), and adoption, which lays the same files out in a fresh view for each version, lost the cache it relied on: a fresh abso adoption took 17.4 min with it against 11.6 min without (my machine). The option, its wiring and its test are gone; 258's told buckets and author counting stay.

Tests: all of src/engine/test and worker/project/test pass.

Version 259 · Files at version 260

3 files, 2 lines added, 45 removed.

--- 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.
4242 */
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) {
5745 if (
5846 !Number.isSafeInteger(maxBytes) ||
5947 maxBytes < 0 ||
@@ -67,7 +55,6 @@
6755 this.#maxBytes = maxBytes;
6856 this.#maxEntries = maxEntries;
6957 this.#maxEntryBytes = Math.min(maxEntryBytes, maxBytes);
70− this.#passThrough = passThrough;
7158 }
7259 get retainedBytes(): number {
7360 return this.#bytes;
@@ -87,7 +74,6 @@
8774 }
8875 }
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);
9379 if (hit) {
--- a/src/engine/test/state-cache.test.ts
+++ b/src/engine/test/state-cache.test.ts
@@ -163,24 +163,3 @@
163163 source.db.close();
164164 }
165165});
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)
417409 : undefined;
418410 if (this.#writerStorage) {
419411 const storage = this.#writerStorage;