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

A draft-state or land on a stored graph no longer reads a row per line to describe its collisions, or a row per claimant to pair them (abso 738).

of shared·capacity··Not checked

  • View's line readers (lines, sequence and the uncached visible lines) name each line's writer with atomId, not graph.idOfSeq. The seq comes from the graph's own layout. idOfSeq's bounds check read the stored atom count once per line, and describing reads both sides' files in full. That was about 0.9 s of a warm draft-state on abso.
  • The claimant walk (orderedClaimants) and hasCommonResolver take each atom's seq from its id, as graph.atom itself does, instead of loading the stored atom to read it.

On abso's Oct 14 tables, both named drafts' states are identical by hash (codex-prose-authorship-610: 71db868585a419a4). codex-prose-authorship-610:

  • warm: 8,863 statements and 2.3 s become 7,820 and 0.92 s. Describing goes from 0.6 s to under 0.1 s, and pairing from 0.4 s to 0.1 s.
  • read cold after the other draft: 12,688 statements and 4.1 s become 11,645 and 2.25 s.

What's left of the warm read is mostly the draft's own lines' uses (0.3 s, in proportion to the draft), the clash check and membership values.

Checks: 1,450 tests pass, 0 fail, 2 skipped. tsc is clean and biome is clean.

Version 316 · Files at version 317

2 files, 18 lines added, 14 removed.

--- a/src/engine/view.ts
+++ b/src/engine/view.ts
@@ -10,7 +10,7 @@
1010// made when a caller asks for them, and the latest asked for is kept.
1111
1212import type { Graph, RelocationInfo } from "./graph.ts";
13−import { isStartNode, lineId, seqOf } from "./keys.ts";
13+import { atomId, isStartNode, lineId, seqOf } from "./keys.ts";
1414import { resolveScratchMoves, scratchLayoutNodes } from "./relocation-scratch.ts";
1515import { isClosedSet, StableSet } from "./state-source.ts";
1616import { joinLines } from "./text.ts";
@@ -1112,7 +1112,7 @@
11121112 yield {
11131113 id: graph.lineIdOf(n),
11141114 text: graph.textOf(n),
1115− atom: graph.idOfSeq(graph.writerSeqOf(n)),
1115+ atom: atomId(graph.writerSeqOf(n)),
11161116 };
11171117 }
11181118
@@ -1126,12 +1126,12 @@
11261126 const n = vis[i]!;
11271127 const packed = visText?.[i];
11281128 lines[i] = {
1129− id: visWriter && visK ? lineId(graph.idOfSeq(visWriter[i]!), visK[i]!) : graph.lineIdOf(n),
1129+ id: visWriter && visK ? lineId(atomId(visWriter[i]!), visK[i]!) : graph.lineIdOf(n),
11301130 textChunks: () => graph.textChunks(n),
11311131 get text() {
11321132 return packed ?? graph.textOf(n);
11331133 },
1134− atom: graph.idOfSeq(visWriter ? visWriter[i]! : graph.writerSeqOf(n)),
1134+ atom: atomId(visWriter ? visWriter[i]! : graph.writerSeqOf(n)),
11351135 };
11361136 }
11371137 return lines;
@@ -1143,12 +1143,14 @@
11431143 const graph = this.graph;
11441144 const { vis, visText, visWriter, visK } = this.#file(path);
11451145 const lines: VisibleLine[] = new Array(vis.length);
1146+ // Writer seqs come from the graph's own layout, so they're named with atomId, not checked by idOfSeq (abso 738):
1147+ // on a stored graph its check read the atom count once a line, about 0.9 s of a warm draft-state on abso.
11461148 for (let i = 0; i < vis.length; i++) {
11471149 const n = vis[i]!;
11481150 lines[i] = {
1149− id: visWriter && visK ? lineId(graph.idOfSeq(visWriter[i]!), visK[i]!) : graph.lineIdOf(n),
1151+ id: visWriter && visK ? lineId(atomId(visWriter[i]!), visK[i]!) : graph.lineIdOf(n),
11501152 text: visText?.[i] ?? graph.textOf(n),
1151− atom: graph.idOfSeq(visWriter ? visWriter[i]! : graph.writerSeqOf(n)),
1153+ atom: atomId(visWriter ? visWriter[i]! : graph.writerSeqOf(n)),
11521154 };
11531155 }
11541156 this.#linesCache = { path, lines };
@@ -1170,13 +1172,13 @@
11701172 const writer = seqWriter ? seqWriter[i]! : graph.writerSeqOf(n);
11711173 let text: string | undefined;
11721174 out[i] = {
1173− id: seqWriter && seqK ? lineId(graph.idOfSeq(writer), seqK[i]!) : graph.lineIdOf(n),
1175+ id: seqWriter && seqK ? lineId(atomId(writer), seqK[i]!) : graph.lineIdOf(n),
11741176 get text() {
11751177 text ??= graph.textOf(n);
11761178 return text;
11771179 },
1178− atom: graph.idOfSeq(writer),
1179− deletedBy: by ? by.map((s) => graph.idOfSeq(s)) : NONE,
1180+ atom: atomId(writer),
1181+ deletedBy: by ? by.map((s) => atomId(s)) : NONE,
11801182 visible: by === undefined,
11811183 };
11821184 }
--- a/worker/project/collisions.ts
+++ b/worker/project/collisions.ts
@@ -68,7 +68,7 @@
6868 }
6969 for (const key of claimsOf(atom)) streams.push(g.eachWriterOf(key));
7070 const theirs: AtomId[] = [];
71− for (const id of orderedClaimants(g, streams)) if (against.has(id)) theirs.push(id);
71+ for (const id of orderedClaimants(streams)) if (against.has(id)) theirs.push(id);
7272 out.set(yours, theirs);
7373 }
7474 return out;
@@ -136,7 +136,7 @@
136136
137137/** Claim indexes append in canonical seq order. Merge one cursor per current
138138 * atom key, retaining no candidate set proportional to historical claims. */
139−function* orderedClaimants(g: Graph, streams: IterableIterator<AtomId>[]): IterableIterator<AtomId> {
139+function* orderedClaimants(streams: IterableIterator<AtomId>[]): IterableIterator<AtomId> {
140140 try {
141141 type Head = { id: AtomId; seq: number; stream: number };
142142 const heap: Head[] = [];
@@ -152,9 +152,11 @@
152152 }
153153 heap[at] = head;
154154 };
155+ // Each claimant's seq from its id, as the graph reads it (abso 738): loading the stored atom for it read a row a
156+ // claimant, most of a warm draft-state's pairing on abso.
155157 const advance = (stream: number) => {
156158 const next = streams[stream]!.next();
157− if (!next.done) push({ id: next.value, seq: g.atom(next.value).seq, stream });
159+ if (!next.done) push({ id: next.value, seq: seqOf(next.value), stream });
158160 };
159161 for (let stream = 0; stream < streams.length; stream++) advance(stream);
160162 let previous = -1;
@@ -190,8 +192,8 @@
190192 let a = left.next();
191193 let b = right.next();
192194 while (!a.done && !b.done) {
193− const x = g.atom(a.value).seq;
194− const y = g.atom(b.value).seq;
195+ const x = seqOf(a.value);
196+ const y = seqOf(b.value);
195197 if (x === y && settled.has(a.value)) return true;
196198 if (x <= y) a = left.next();
197199 if (y <= x) b = right.next();