{"version":208,"agent":"capacity","message":"Compare on a stored writer takes its candidates from the kept version files of the versions between (abso Capacity): every file that differs between two shared versions changed in one between them. Before, it walked every atom either version's set holds. version-files.test.ts compares both ways, across a drop, against the in-memory project. On game's export, compare from 762 to 1525: 20 s to 5.4 s, same answer.","time":1792033800215,"timeIso":"2026-10-15T03:10:00.215Z","changes":2,"change":3498,"files":["worker/project/test/version-files.test.ts","worker/project/version-log.ts"],"draft":null,"diff":[{"path":"worker/project/test/version-files.test.ts","added":11,"removed":2,"diff":"--- a/worker/project/test/version-files.test.ts\n+++ b/worker/project/test/version-files.test.ts\n@@ -1,6 +1,6 @@\n // Each version's changed files kept as it lands (abso Capacity, version-files.ts): a writer-backed project's log,\n-// path histories and shows match the in-memory project's through edits, new and removed files, a line taken out and\n-// put back with the same text, moves and a drop.\n+// path histories, shows and compares match the in-memory project's through edits, new and removed files, a line\n+// taken out and put back with the same text, moves and a drop.\n \n import assert from \"node:assert/strict\";\n import { test } from \"node:test\";\n@@ -52,4 +52,13 @@\n \tfor (const path of [\"a.txt\", \"b.txt\", \"c.txt\", \"d.txt\", \"e.txt\", \"gone.txt\"])\n \t\tassert.deepEqual(project.log({ limit: 100, path }), oracle.log({ limit: 100, path }), path);\n \tfor (let v = 0; v <= oracle.version; v++) assert.deepEqual(project.show(v), oracle.show(v), `version ${v}`);\n+\t// A compare reads the kept lists for the versions between (version-log.ts): both ways, and across the drop.\n+\tfor (const [from, to] of [\n+\t\t[0, oracle.version],\n+\t\t[oracle.version, 0],\n+\t\t[2, 7],\n+\t\t[5, 9],\n+\t\t[3, 3],\n+\t] as const)\n+\t\tassert.deepEqual(project.compare(from, to), oracle.compare(from, to), `compare ${from} to ${to}`);\n });"},{"path":"worker/project/version-log.ts","added":10,"removed":2,"diff":"--- a/worker/project/version-log.ts\n+++ b/worker/project/version-log.ts\n@@ -249,11 +249,19 @@\n \tconst space = host.spaceFor(options);\n \thost.checkVersion(space, from);\n \thost.checkVersion(space, to);\n-\tconst a = host.at(space, from);\n-\tconst b = host.at(space, to);\n \tconst before = host.viewAt(space, from);\n \tconst after = host.viewAt(space, to);\n \tconst files = new Set<string>();\n+\t// A stored writer keeps each shared version's changed files (version-files.ts, abso Capacity): every file that\n+\t// differs between two versions changed in one between them, so those lists are the candidates, not every atom\n+\t// either set holds.\n+\tif (space.name === SHARED && host.graph.packedFiles) {\n+\t\tfor (let v = Math.min(from, to) + 1; v <= Math.max(from, to); v++)\n+\t\t\tfor (const file of host.paths.versionFiles(space, v)) files.add(file);\n+\t\treturn { from, to, files: changesBetween(before, after, files) };\n+\t}\n+\tconst a = host.at(space, from);\n+\tconst b = host.at(space, to);\n \tfor (const [x, y] of [\n \t\t[a, b],\n \t\t[b, a],"}],"ci":null}