diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 92b4bdf..81c8b7d 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -713,8 +713,7 @@ These are the cases the algorithm handles. Proven by: TESTING §5.2 (port baseli ### 5.3 Performance -Targets and accepted decisions. The measured table, the bench scenes and the regression gate are in -TESTING §5.3. +Targets and accepted decisions. The measured table and the bench scenes are in TESTING §5.3. - Polygon cost is O(rays x walls in bbox) [MEASURED code reading, `server/geometry.nim` `visibilityPolygon`, ported unchanged from the prototype]. With radius-bbox culling the cost scales diff --git a/docs/TESTING.md b/docs/TESTING.md index 8729734..4689b4e 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -187,7 +187,7 @@ power-save CPU. - Timings are single machine loopback power-save CPU; no real network, no client render [MEASURED caveat]. A real-network run (laptop over the intended HTTPS path, phone on LAN) is an M7 item. - Load/perf regression gate: `bench` + concurrency numbers (this section and §4.3) compared with - committed baselines; fail on > 2x regression [PROPOSED]. + the committed baselines; the 2x threshold and its [PROPOSED] status are in DESIGN §5.3. ### 5.4 Known limitations @@ -313,6 +313,8 @@ power-save CPU. ## 10. Testing strategy +**Rule:** DESIGN §10 (the pointer section that keeps 10.1-10.4 as references to this section). + Every rule in DESIGN maps to a block above; this section is the test plan itself: what carries over from the prototype, what was missing, what the M3 build added, and the tools it uses. diff --git a/docs/research/design-split-check.md b/docs/research/design-split-check.md index 5c0692a..b2ff226 100644 --- a/docs/research/design-split-check.md +++ b/docs/research/design-split-check.md @@ -3,7 +3,8 @@ Verification for the split of `docs/DESIGN.md` v0.30 into the current spec (`docs/DESIGN.md`), `docs/adr/` and the non-normative `docs/DESIGN-history.md`. Performed 2026-11-17 against `HEAD` 7b804f4; old text read from `git show -HEAD:docs/DESIGN.md`, no decision changed. +HEAD:docs/DESIGN.md`, no decision changed. §6 covers the second split of the +same day: proof detail out of the spec into `docs/TESTING.md`. ## 1. Size @@ -122,3 +123,108 @@ Grep over tracked docs, code and tests for `DESIGN`, `§` and `#NN`: Machine check performed: for each `x.y` token in `docs/DESIGN.md`, a heading `### x.y ` exists; for each bare section citation `§x`, a `## x.` heading exists. + +--- + +## 6. Second split: proof detail into `docs/TESTING.md` + +Performed 2026-11-17 on top of the split above, on the same current spec. DESIGN now states **what is +true**; `docs/TESTING.md` states **how it is proven**. No rule, decision, threshold or gate criterion +changed; moved blocks keep their tags, tickets and evidence paths. + +### 6.1 Size + +| file | before | after | +|---|---|---| +| `docs/DESIGN.md` | 221 466 B (2 610 lines) | 198 332 B (2 374 lines) | +| `docs/TESTING.md` | — | 36 579 B (572 lines) | + +DESIGN is 23 134 B (10.4 %) smaller. TESTING is larger than the moved bytes because each block gains a +`Rule: DESIGN §x.y` back-link, its own `##`/`###` headings, and the tag legend; the former §10 alone was +18 964 B (215 lines) and moved whole. + +### 6.2 Moved-block ledger + +| old DESIGN | new TESTING | what moved | +|---|---|---| +| §3.1 notes | §3.1 | `GMONLY_TOKEN` fault-class pointer | +| §3.3 | §3.3 | `/_tiles/` 404 evidence, tile-allowed `[MEASURED]` leak (d) counts, `prototype-tile-leak` evidence, test-vhost note, slice-9 status-split pin (was in §6.6) | +| §3.4 | §3.4 | the `Test` column of T1-T17, as a proving-test table | +| §4.1 | §4.1 | `vision_ms move-monster` `[MEASURED]` | +| §4.2 | §4.2 | "order proven correct by 3 x 60 s runs" | +| §4.3 | §4.3 | concurrency run `[MEASURED]` (13748 mutations, latencies), the 0.70 ms scale note, the mummy-`WebSocket`-fields test proposal, SQLite-tail measurement, 583 ms outlier detail | +| §4.4 | §4.4 | commit-cost and SIGKILL `[MEASURED]`, chunk write cost and pinning tests, step-5 layout pin, migration-test assert | +| §5.1 | §5.1 | vertex-in-cell bug log and its test | +| §5.2 heading + body | §5.2 | test counts, angle-sort bug narrative and regression test, 64-gon `[MEASURED]` citation | +| §5.3 | §5.3 | measured perf table, bench scenes (`genScene` layouts), thickness measurements, timings caveat, 2x regression gate method | +| §5.4 | §5.4 | token-on-wall test name, leak-test self-consistency caveat | +| §5.5 | §5.5 | in-process-module/unit-test sentence, WS probing test is M3, 0.5 px oracle tolerance, the `[FIXED]` regression baseline | +| §5.7 | §5.7 | `BannedAlways` height → `WALLDATA` | +| §5.8 | §5.8 | door-equivalence oracle pointer, `BannedAlways` label scan | +| §5.9 | §5.9 | the oracle sub-bullet (clearLine height test, band maybe/sure, no-churn, assertions with build tickets), fault-class-copy parenthetical | +| §5.10 | §5.10 | quad-hoisting `[#43 measured]`, joints measurement, oracle body-rectangle rule | +| §6.3 | §6.3 | reducer reconnect-reset `[MEASURED]` test citation | +| §6.4 | §6.4 | leak test (c), `withN` live-bug story, byte-size `[MEASURED]` table | +| §6.5 | §6.5 | the close-assertion consequence | +| §6.6 | §3.3 | slice-9 tile status-split pin (merged with the §3.3 block) | +| §7.3 | §7.3 | browser-unverified note and the M4 pixel check as acceptance criterion | +| §10.1-§10.4 | §10.1-§10.4 | the whole section, reflowed with DESIGN-qualified refs | +| §11.1 | §11.1 | the test-nginx bullet (`tools/nginx.mjs`, fixture tiles) | +| §11.2 | §11.2 | restore-drill procedure | +| §11.3 | §11.3 | SLOW-line provenance `[MEASURED]`, prototype-instrumentation caveat | +| §13 | §13 | M3 measured accept result and `tools/groups` mapping, M4 gate harness mechanics and the prototype-run caveat | + +### 6.3 FIXED-rule coverage + +`[FIXED` occurrences: 189 in DESIGN before; 187 in DESIGN + 9 in TESTING after = 196. Nothing was +dropped: every removed block containing `[FIXED` has a survivor (each old context was matched in +DESIGN+TESTING by its surrounding text). The 7 extra occurrences are tags that now sit on both a DESIGN +pointer and its TESTING block (§5.3 thickness acceptance, §5.9 oracle rule, §10.4 heading, §11.1 test +nginx) and TESTING's own tag legend. + +Per section (old → new DESIGN + TESTING): + +| § | before | after DESIGN | after TESTING | +|---|---|---|---| +| 1 | 5 | 5 | 0 | +| 2 | 3 | 3 | 0 | +| 3 | 25 | 25 | 0 | +| 4 | 25 | 25 | 0 | +| 5 | 65 | 64 | 5 | +| 6 | 28 | 28 | 0 | +| 7 | 6 | 6 | 0 | +| 8 | 19 | 19 | 0 | +| 9 | 1 | 1 | 0 | +| 10 | 2 | 1 | 2 | +| 11 | 7 | 7 | 1 | +| 12 | 0 | 0 | 0 | +| 13 | 2 | 2 | 0 | +| 14 | 0 | 0 | 0 | + +### 6.4 Left in DESIGN on purpose (rule vs test) + +- **Budgets and limits that are requirements:** the 5k-wall < 1 ms polygon target and the p99 > 50 ms + revisit trigger (§5.3), the 2x load/perf regression threshold (§5.3), every M4/M5/M6 accept criterion + and the 64 px tile fallback (§13), the 0.5 px oracle tolerance statement (§5.5). +- **Measured numbers that back a design choice rather than a gate:** the client rendering verdicts and + per-frame overheads (§7.2), the borrow-not-copy 4.9 ms (§4.3), the mummy reading (§4.3), the + complexity reading (§5.3). Moving these would strip the rationale from the decision. +- **§5.2's case list** stays as behaviour ("these cases are handled"); only its counts and bug + regressions moved. +- **§5.5's regression baseline** moved although it is `[FIXED]`: it defines what "equal to the old + implementation" means for a test, so it is proof, not a product rule. It is the one `[FIXED]` item + whose only home is TESTING; DESIGN §5.5 links to it. +- **§10.4's tooling decision** stays visible in DESIGN as a pointer heading with its `[FIXED]` tag; the + detail (Node 26, built-ins only, `tools/groups.mjs`) is in TESTING §10.4. + +### 6.5 Cross-reference check + +- DESIGN still has headings 1-14, and §10 keeps `10.1`-`10.4` as one-line pointers, so every + `DESIGN 10.x` reference in code and test comments resolves. The mapping (10.x → TESTING §10.x) is + stated in TESTING's header; code comments were left as they are (the instruction was to prefer a + mapping table over editing ~30 comments). +- Every `§x.y` in DESIGN resolves to a DESIGN heading; every `TESTING §x.y` resolves to a TESTING + heading; every `DESIGN §x.y` in TESTING resolves to a DESIGN heading. +- ADR-0015's `## Spec` no longer cites §10.3 and names TESTING §5.8/§10.3; ADR-0012 names TESTING + §10.3; `docs/research/walls-sight-thick-low.md` cites TESTING for the moved §10.2/§10.3. +- §14's "load/perf regression gate at 2x" now points at TESTING §5.3.