docs/solutions/performance-issues/2026-04-20-source-scoped-overlay-invalidation-proof-must-separate-recompute-selectivity-from-subscriber-fan-out.md
The perf lane kept treating source-scoped invalidation like an abstract future promise.
That was too fuzzy. We already had a live React locality benchmark, but it did not explicitly prove whether source dirtiness stayed selective, and it did not distinguish that from the separate question of whether touched store subscribers still fan out too broadly.
source-scoped overlay invalidation stayed marked as “no command-backed live
proof yet” in the control docs.Activity, and annotation-backed widget
churn, but not the exact dirtiness-class split.decorationSourceToggleBreadth as if it answered the whole
source-invalidation question. It only proved one external refresh path.Extend the live
rerender-breadth.tsx
owner with one explicit sourceScopedInvalidation row instead of inventing a
second benchmark family.
The new row creates three projection stores on the same editor:
selection-dirty storetext-dirty storeexternal-dirty storeThen it drives three operations and records recompute deltas separately:
const selectionStore = createSlateProjectionStore(editor, deriveSelectionRanges, {
dirtiness: 'selection',
sourceId: 'selection-source',
})
const textStore = createSlateProjectionStore(editor, deriveTextTailRanges, {
dirtiness: 'text',
sourceId: 'text-source',
})
const externalStore = createSlateProjectionStore(
editor,
() => deriveExternalRanges(externalActiveRef.current),
{
dirtiness: 'external',
sourceId: 'external-source',
}
)
Fresh kept result from bun run bench:react:rerender-breadth:local:
100010001That proves the dirtiness classes are selective.
The same row also exposes the still-open part:
1, right 11, right 11, right 1So the current store layer does decide which store needs recompute, but once a store snapshot changes, both runtime-id subscribers on that store still rerender together.
It splits one muddy perf argument into two crisp questions:
Before this row, those questions were getting mashed together.
Now the answer is explicit:
That is a much better checkpoint than either fake green or fake missing.