docs/slate-v2/slate-react-perf-loop-context.md
Use this as the reusable source of truth for the slate-react huge-document
perf loop. The loop prompt should link here instead of repeating this whole
context.
/Users/zbeyens/git/plate-2/Users/zbeyens/git/slate-v2/Users/zbeyens/git/slate/Users/zbeyens/git/slate-v2-draftdocs/slate-v2-draft/**Planning/docs writes are allowed in:
docs/slate-v2/**docs/slate-v2-draft/**docs/plans/**Code reads are allowed across:
/Users/zbeyens/git/slate-v2/packages/slate/**/Users/zbeyens/git/slate-v2/packages/slate-dom/**/Users/zbeyens/git/slate-v2/packages/slate-react/**/Users/zbeyens/git/slate-v2/packages/slate-browser/**/Users/zbeyens/git/slate-v2/site/examples/ts/**/Users/zbeyens/git/slate-v2/playwright/integration/examples/**/Users/zbeyens/git/slate-v2/scripts/benchmarks/**/Users/zbeyens/git/slate-v2/package.json/Users/zbeyens/git/slate/**Code edits are allowed when measurement proves ownership:
/Users/zbeyens/git/slate-v2/scripts/benchmarks/**/Users/zbeyens/git/slate-v2/package.json/Users/zbeyens/git/slate-v2/packages/slate-react/**/Users/zbeyens/git/slate-v2/packages/slate/** only when measured evidence
proves core ownershipDo not work on:
/Users/zbeyens/git/slate-v2/packages/slate-history/Users/zbeyens/git/slate-v2/packages/slate-hyperscriptRead these before deciding or claiming closure:
docs/plans/2026-04-21-slate-v2-react-huge-doc-perf-plan.mddocs/slate-v2/master-roadmap.mddocs/slate-v2/release-readiness-decision.mddocs/slate-v2/true-slate-rc-proof-ledger.mddocs/slate-v2/replacement-gates-scoreboard.mddocs/slate-v2/decoration-roadmap.mddocs/slate-v2/references/architecture-contract.mddocs/slate-v2/references/chunking-review.mddocs/slate-v2/ledgers/example-parity-matrix.mddocs/slate-v2-draft/decoration-roadmap.mddocs/slate-v2-draft/true-slate-rc-proof-ledger.mddocs/solutions/performance-issues/**docs/solutions/logic-errors/**bench:react:rerender-breadth:local exists and proves useful locality facts.bench:react:huge-document-overlays:local exists and proves corridor/overlay
locality facts.bench:react:huge-document:legacy-compare:local exists, but the fresh
5000/10000-block runs reopen the stronger perf-superiority claim. Current v2
shell islands win startup and full-document operations, then lose steady
typing/select lanes hard against legacy chunking-on.1000 blocks is smoke/debug only. It is not a closure or superiority proof
gate for this lane.Editor.getSnapshot() as an urgent hot read path if it blocks
chunking-on superiority.slate-react should be faster than legacy chunking/no-chunk on important
huge-doc user lanes.decorate story.Run from /Users/zbeyens/git/slate-v2:
REACT_HUGE_COMPARE_BLOCKS=5000 REACT_HUGE_COMPARE_ITERATIONS=5 REACT_HUGE_COMPARE_TYPE_OPS=10 bun run bench:react:huge-document:legacy-compare:local
bun run bench:react:rerender-breadth:local
bun run bench:react:huge-document-overlays:local
If packages/slate/** changes, also run:
bun test ./packages/slate/test/snapshot-contract.ts --bail 1
bun run bench:slate:6038:local
bun run bench:core:normalization:compare:local
bun run bench:core:observation:compare:local
bun run bench:core:huge-document:compare:local
If packages/slate-react/** changes, also run:
bun test ./packages/slate-react/test/large-doc-and-scroll.tsx --bail 1
bun test ./packages/slate-react/test/provider-hooks-contract.tsx --bail 1
bun test ./packages/slate-react/test/projections-and-selection-contract.tsx --bail 1
bun run bench:react:rerender-breadth:local
bun run bench:react:huge-document-overlays:local
REACT_HUGE_COMPARE_BLOCKS=5000 REACT_HUGE_COMPARE_ITERATIONS=5 REACT_HUGE_COMPARE_TYPE_OPS=10 bun run bench:react:huge-document:legacy-compare:local
Editor.getSnapshot()/Users/zbeyens/git/slate-v2/packages/slate-react/** for node/text read
model changes/Users/zbeyens/git/slate-v2/packages/slate/** only if a focused probe
proves the blocker is core read/index ownershipslate-dom/dist/index.d.ts aliasing is fixed; slate-dom and
slate-react build/typecheck are greenTreat docs/plans/2026-04-21-slate-v2-react-huge-doc-perf-plan.md as the
mutable memory ledger for this lane.
After every slice, append a checkpoint with:
Record failed probes too. A failed optimization that was cut is valuable evidence, not noise.
If stable lane truth changes, update this file in the same turn.
Do not rely on chat history for memory. If it matters, write it to the plan.
The perf lane is complete only when:
SYNC_TIMER: 30m is allowed only when:
Do not output SYNC_TIMER when the checkpoint names a next move.