{"draft":null,"from":128,"to":129,"files":[{"path":"src/engine/graph.ts","added":17,"removed":4,"diff":"--- a/src/engine/graph.ts\n+++ b/src/engine/graph.ts\n@@ -322,7 +322,7 @@\n \t\t\tthis.#holdersPages = storedLists<AtomId>(storage, \"holders\", (key) => key);\n \t\t\tthis.#dependentsPages = storedLists<AtomId>(storage, \"dependents\");\n \t\t\tthis.#resolversPages = storedLists<AtomId>(storage, \"resolvers\");\n-\t\t\tthis.#together = storedMap(storage, \"together\");\n+\t\t\tthis.#togetherPages = storedLists<TogetherLink>(storage, \"together\");\n \t\t\tthis.#fileAtomPages = storedLists<AtomId>(storage, \"file-atoms\");\n \t\t\tthis.#runStarts = storedMap(storage, \"run-starts\");\n \t\t\tthis.#relocationPages = storedLists<RelocationInfo>(storage, \"relocations\");\n@@ -436,6 +436,7 @@\n \t#resolvers: StateMap<AtomId, AtomId | AtomId[]> = new Map();\n \t#resolversPages: ReturnType<typeof storedLists<AtomId>> | undefined;\n \t#together: StateMap<AtomId, TogetherLink[]> = new Map();\n+\t#togetherPages: ReturnType<typeof storedLists<TogetherLink>> | undefined;\n \t#fileAtoms: StateMap<string, AtomId[]> = new Map();\n \t#fileAtomPages: ReturnType<typeof storedLists<AtomId>> | undefined;\n \t/** First lines of runs (their n), by the node they were written after: a line's n, or -1 - a path's index. */\n@@ -833,8 +834,12 @@\n \n \t/** `together` reasons touching this atom, in either direction. */\n \ttogetherLinks(id: AtomId): readonly TogetherLink[] {\n-\t\treturn this.#together.get(id) ?? EMPTY;\n+\t\treturn [...this.eachTogetherLink(id)];\n \t}\n+\t*eachTogetherLink(id: AtomId): IterableIterator<TogetherLink> {\n+\t\tif (this.#togetherPages) yield* this.#togetherPages.values(id);\n+\t\telse yield* this.#together.get(id) ?? EMPTY;\n+\t}\n \n \t/**\n \t * The atom plus everything it depends on, transitively. Computed on demand\n@@ -1068,8 +1073,16 @@\n \t\t}\n \t\tfor (const r of frozen.reasons) {\n \t\t\tif (r.kind !== \"together\" || r.to === frozen.id) continue;\n-\t\t\tpushIndex(this.#together, frozen.id, { other: r.to, text: r.text, from: frozen.id });\n-\t\t\tpushIndex(this.#together, r.to, { other: frozen.id, text: r.text, from: frozen.id });\n+\n+\t\t\tconst forward = { other: r.to, text: r.text, from: frozen.id };\n+\t\t\tconst reverse = { other: frozen.id, text: r.text, from: frozen.id };\n+\t\t\tif (this.#togetherPages) {\n+\t\t\t\tthis.#togetherPages.append(frozen.id, forward);\n+\t\t\t\tthis.#togetherPages.append(r.to, reverse);\n+\t\t\t} else {\n+\t\t\t\tpushIndex(this.#together, frozen.id, forward);\n+\t\t\t\tpushIndex(this.#together, r.to, reverse);\n+\t\t\t}\n \t\t}\n \t}\n "}],"unmatched":[]}