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 238 --json
JSON
/christopher/abso-core/versions/238?format=json

Collisions: deleted lines found by number, and the move index skips graphs that gained nothing (disk-first 2; abso Capacity).

of shared·capacity··Not checked

Collisions on website took 20.7 s cold with one opened writer (replay 0.4 s), and 46 s on typescript-rs (replay 5 s).

  • touchedFiles finds each deleted line's file by its number where the view can (fileOfNumber). A draft deleting a big file has thousands; making each one's id only to look its number up again was most of the time.
  • Graph.accepted counts the atoms a graph object has taken in, in memory. The move index (MoveSkeleton) is brought up to date on every lookup of a line's file. It now reads the movers list only when that count has changed: checking the stored list's length and last mover each time cost 3.3 s of collisions on website. A rolled-back add still counts, which only makes it look again.

On website adopted fresh, cold: collisions 20.7 s to 9.6 s. On typescript-rs: 46 s to 11.7 s. Both match replay, and all 27 typescript-rs answers match. Still slow: reading every draft atom's write keys, a row per key once there are more than 256 (75,000 rows on website).

Named tests: every engine test (288 of 288), every worker/project test (341 of 341); tsc and biome clean.

Version 237 · Files at version 238

3 files, 25 lines added, 2 removed.

--- a/src/engine/graph.ts
+++ b/src/engine/graph.ts
@@ -820,6 +820,16 @@
820820 return this.#atoms.length;
821821 }
822822
823+ /**
824+ * How many atoms this graph object has accepted since it was made (abso Capacity): in memory, so a cache over the
825+ * graph can tell nothing was added without reading storage. A rolled-back add still counts, which only makes such a
826+ * cache look again.
827+ */
828+ get accepted(): number {
829+ return this.#accepted;
830+ }
831+ #accepted = 0;
823833 /** The id the next accepted atom must have. */
824834 nextId(): AtomId {
825835 return atomId(this.#atoms.length);
@@ -1530,6 +1540,7 @@
15301540 this.#lists ? this.#listReader(seq) : undefined,
15311541 );
15321542 this.#atoms.push(this.#storage ? atom : frozen);
1543+ this.#accepted++;
15331544 let lam = 0;
15341545 for (const d of deps) lam = Math.max(lam, this.lamport(d) + 1);
15351546 if (this.#lamportPages) this.#lamportPages.push(lam);
--- a/src/engine/view.ts
+++ b/src/engine/view.ts
@@ -138,9 +138,14 @@
138138 this.#graph = graph;
139139 }
140140
141+ /** The graph's accepted count when movers were last taken in: nothing to read while it's the same. */
142+ #stamp = -1;
141144 /** Take in movers the graph gained since. */
142145 update(): this {
143146 const graph = this.#graph;
147+ if (this.#stamp === graph.accepted) return this;
148+ this.#stamp = graph.accepted;
144149 const all = graph.movers();
145150 if (this.#seen === all.length) return this;
146151 for (; this.#seen < all.length; this.#seen++) {
--- a/worker/project/collisions.ts
+++ b/worker/project/collisions.ts
@@ -282,13 +282,20 @@
282282 for (const file of g.filesOf(id)) out.add(file);
283283 if (moved.length === 0) continue;
284284 const atom = g.atom(id);
285− const lines: string[] = [...g.deletedLines(id)];
285+ const lines: string[] = [];
286286 for (const run of atom.inserts) if (!run.parent.startsWith("^")) lines.push(run.parent);
287287 for (const m of atom.moves ?? []) {
288288 lines.push(m.line);
289289 if (!m.parent.startsWith("^")) lines.push(m.parent);
290290 }
291− for (const v of moved) for (const line of lines) out.add(v.fileOf(line));
291+ for (const v of moved) {
292+ for (const line of lines) out.add(v.fileOf(line));
293+ // Deleted lines by number where the view can (abso Capacity): a draft deleting a big file has thousands, and
294+ // making each one's id only to look its number up again was most of collisions on website.
295+ const byNumber = (v as { fileOfNumber?: (n: number) => string }).fileOfNumber;
296+ if (byNumber) for (const n of g.deletedNumbers(id)) out.add(byNumber.call(v, n));
297+ else for (const line of g.deletedLines(id)) out.add(v.fileOf(line));
298+ }
292299 }
293300 return out;
294301}