Status: Accepted (2026-11-27). Amended 2026-11-27 (WP-E0, coordinator decision): the perf gate is an interleaved before/after comparison, not a comparison with a stored baseline; see “Amendment” below.
node:test (built in), TS run natively: shared, doc, sync-client, realtime, api, docworker, mcp. npm test runs all workspaces.ScanBatch + StructIndex (no document), seeded random ops (create/set/delete/reparent incl. cycles and edits to deleted nodes), random latency, reordering, disconnects. After quiescence every replica’s encodeSnapshot() must be byte-identical to a compactor-style replay of the journal, and the sequencer’s verdicts must equal DocCore local validation on the canonical state (index/doc rule equivalence). Fixed seeds in CI, random seeds nightly.CodecError.DATABASE_URL): auth and role matrix, tenant isolation (every route with a foreign project id -> 404/403), journal COPY + ack-after-commit, crash/restart recovery, compaction equivalence, revocation closing sockets.tools/loadtest, WP-H): 100k+ WebSocket clients from several source IPs/loopback aliases (ephemeral-port limit ~64k per source IP) with the ADR 0020 room distribution and rates. Reports p50/p99 op and presence latency, server RSS per tier, CPU per thread, validation ns/op, DB rows/s and commit latency, reconnect-storm recovery time.tools/bench/run.ts --gate drives Chrome through the existing in-app benchmarks (pan/zoom, drag-all, page tour) for 4,000 pages and 5M shapes, running the “before” build (default HEAD) and the “after” build (working tree) interleaved in one session. Must run on the reference machine (M4 Pro) for any change under packages/engine, packages/editor or packages/doc hot paths; CI runs a smaller smoke scene for regressions > 10%.measureUserAgentSpecificMemory + engine GPU bytes + heap snapshot attribution, against docs/perf/memory-baseline.json: <= 1.10x at E1, <= 1.00x at E2, JS object count independent of node count, per-part bytes/node from memoryReport() within 5% of the ADR 0024 tables.Context. P0 Bootstrap measured identical code in separate sessions on the reference machine while other agents built and tested in parallel: fps moved by up to ~6% between sessions, and the headless worst-zoom GPU time by 6.1-7.8 ms (the GPU clock follows load). A fixed 3% band against a stored baseline.json therefore fails good changes and can pass bad ones; only an interleaved A/B in one time window separated real effects from noise (docs/perf/baseline.md).
Decision.
tools/bench/run.ts without --headless) at each milestone (end of E0, E1, E2, P3), and the result is recorded in docs/perf/.docs/perf/baseline.json stays as the P0 record; --compare <file> still prints an absolute comparison for information, never as the gate.Alternatives. Tighter absolute bands with more runs per session (still exposed to session-to-session drift); means instead of medians (one throttled run moves them); a quiet-machine requirement (not available while waves run in parallel).
Consequences. One gate run takes ~15 minutes for both scenes at 5 runs per tree. A regression is detected relative to the code being replaced, so slow regressions spread over many commits are caught by the headed milestone runs and by comparing milestones (--before <milestone commit>), not by each gate. Command: node tools/bench/run.ts --gate [--before <ref>] [--runs N] [--scenes website,shapes] [--out <file>].
No test framework dependency; Playwright is the only test-time install.