committedGens was a number[] with one element per committed generation. Every single-op write reserves a distinct generation, so an insert-built 1B corpus held a ~1B-element array resident regardless of provider — the MVCC sibling of the storage-cache gate. Replace it with a sorted disjoint interval set (committedRanges). With no compaction gaps the whole ledger collapses to a single [start,end] pair, so resident size is O(number-of-gaps) not O(writes). reservedGens becomes a generator; point-resolution binary-searches the ranges; compaction trims the oldest prefix with a defensive prefix-invariant guard. Behaviour is identical across asOf/diff/since/history/transactionLog — unit 1718 + integration 607 + the focused MVCC suite green. |
||
|---|---|---|
| .. | ||
| db.ts | ||
| errors.ts | ||
| generationStore.ts | ||
| portableGraph.ts | ||
| stableEqual.ts | ||
| types.ts | ||
| whereMatcher.ts | ||