30 Commits
Author SHA1 Message Date
SirStone 7379d450d5 results: M4 UX gate on the fixed tree (#89) 2026-11-21 23:44:26 +01:00
SirStone a79d809394 feat(m4): cap map images at Full HD and shrink on import (#85)
The owner fixed the map cap at 1920 px on the long side and 1080 px on the
short side (either orientation). fff-vtt import now shrinks a larger source
with ImageMagick Lanczos before tiling (alpha kept, proportions preserved,
no upscaling), prints `scaled WxH -> WxH`, and records the shrunk w/h; a
source at or below the cap is untouched, so the pixel-identity tests still
hold. A scene row already above the cap is not rewritten: the server logs
`map_above_cap` at startup and serve prints the re-import advice.

Docs: ADR-0023, DESIGN 3.3/5.3/8/11.1/13/14, TESTING 5.3/13, README,
HANDOFF-M4, client README. The M4 phone gate and the fogbench measurement
now use the Full HD maximum; the 16384 px / 262144-cell bench and test rows
stay as labelled server stress references. import-scale now proves a 16384²
input is shrunk to 1080x1080 (289 tiles at 64 px) quickly and bounded.

Part of #63, #85. #77 is blocked by this issue.
2026-11-21 22:37:34 +01:00
SirStone c8b5289a3d fix: stream map import so 16384 px at 64 px is memory- and fd-bounded (#83)
The one-shot `magick -crop 64x64 +adjoin` built an image list of all 65,536 tiles; ImageMagick's
memory/map limits are per image, so the attempt held 4.3 GB of source cache plus every tile cache and
died after minutes with "Too many open files" at 1023 fds, having published nothing.

Slice by streaming instead: one disk-cache-backed decode of the source to raw samples, the CLI reads
it one tile row at a time, and a pool of 8 magick children cuts one row band each. Live caches and
fds are bounded by the worker count, never by the tile count. Progress goes to stderr ("rows 37/256,
tiles 9472/65536") and failures quote the image, row band and magick's own message. Atomicity is
unchanged: temp dir then rename, scene row only on success, same lock and exit codes.

Measured on the owner's 16384x16384 map at 64 px: 19 s, 391 MB peak RSS, 10 fds, 65,536 tiles (was
~5 min then failure). The tile pixels are identical to the old crop (proven tile by tile in
tools/import.test.mjs); PNG bytes can differ because the encoder now sees raw samples.

New gate: devbox run import-scale (16384/64 under ulimit -n 256) writes results/import-scale.log;
devbox run test keeps the fast fixtures and skips it.
2026-11-21 20:48:45 +01:00
SirStone fcd90529b6 test(m4): finish audit, measurement and archive (#76)
- client/e2e/audit.test.mjs: independent player-browser traffic audit (own
  frame catalogue and banned-key list, never leakcheck.nim), with a
  -d:leakfault/otherVision negative control.
- client/e2e/fogbench.test.mjs + tools/fogbench.nim: 50 tokens on a
  16384 px map (server move path and headless SwiftShader cadence);
  results/m4-fog-bench.md records both honestly (SW is not the phone gate).
- Archive prototype-* under docs/archive/prototypes (Q24); DESIGN 13 M4
  done, TESTING 13 M4 accept result, HANDOFF-M4 close-out.
- mutation.sh c1/c2 patch the post-#65 tile-gate line again (they had
  silently become sed no-ops).
2026-11-21 15:43:08 +01:00
SirStone 97f618c5ad results: rerun the gates with the sector-limited fan (#64)
Rebased on origin/main (1dff520). devbox run test green (Nim suite + 149
node tests + group evidence); devbox run mutation green including a2 (a ray
tests the next sector's chord) failing 5 bit-identical tests. bench.log is
the rebased run: prototype polygon 0.009 ms, 5k sparse 0.035 ms, 5k dense
0.737 ms.

Refs #64.
2026-11-20 23:40:06 +01:00
SirStone d192381d13 perf: test only the in-sector 64-gon chord per vision ray (#64)
Each fan ray now tests the one circle-segment chord of its angular sector
instead of all 64. A sector-boundary ray tests both meeting chords, so the
rayHit set and the picked minimum are unchanged: the polygon is bit-identical
to the all-segments fan. tests/tgeometry.nim keeps the old fan as an oracle
and asserts exact float equality over the prototype corpus, the seed scene
(all switch shapes), the 5k sparse/dense scenegen layouts, the #26
collinear/radial cases and random walls. tools/mutation.sh gains a2 (a ray
tests the next sector's chord), which fails 5 of those tests.

Bench on this host, before -> after (3-run median):
  1 poly, prototype 0.028 -> 0.008 ms (3.5x)
  1 poly, 5k sparse 0.062 -> 0.033 ms (1.9x)
  1 poly, 5k dense  1.085 -> 0.708 ms (1.5x)

Refs #64.
2026-11-20 23:28:04 +01:00
SirStone 0448002cc5 test: load-insensitive tviews perf gate; env note 2026-11-20 22:44:55 +01:00
SirStone a11782f00d results: rerun the gates on the rebased tree (#36)
devbox run test: Nim suites and 149 node tests pass (the 16 registered group
evidence tests included). devbox run mutation: control and all 78 mutations pass,
including s1-s7 and the new e4/e5/f1-f3 from #32/#33/#35.

Refs #36.
2026-11-20 22:13:04 +01:00
SirStone 1f11779658 test: tie group evidence to passing tests and baseline restart on the as-built server (#36)
- tools/groups.mjs evidence entries now name the exact test, a minimum assertion
  count and the calls its body must keep; groups.test.mjs checks all three.
- tools/evidence.mjs parses the spec reporter log and fails the gate unless every
  registered evidence test ran and passed; test.sh runs it after the Node suite.
- restart.test.mjs snapshots the live as-built world on the first server, then
  compares it to the post-SIGTERM/SIGKILL state (players connect before the GM, so
  the GM's derived encountered grey is computed on both sides).
- Negative controls: a hollowed auth test fails the new evidence check; a planted
  first-load drop of a token's gm prop bucket fails the new restart baseline while
  the old restart-to-restart test passed.
- Refresh the gate evidence (control + 73 mutations incl. s1-s7, 142 node tests).
2026-11-20 21:55:50 +01:00
SirStone e13fa905a4 results: rerun the gates on the fixed tree (#27-#31)
devbox run test: nimble suites and 107 node tests pass (was 103: +1 characters,
+2 tiles, +1 restart). devbox run mutation: control and every mutation pass,
including the new e1-e3 and the repointed b2.
2026-11-15 14:26:23 +01:00
SirStone 76ec6f4b3d results: rerun the M3 gates on the final tree (#25) 2026-11-15 13:03:54 +01:00
SirStone df2b186267 results: rerun the slice 9 gates on the final tree (#24) 2026-11-15 12:30:53 +01:00
SirStone 5ff15c4b36 results: rerun the slice 8 gates on the final tree (#23) 2026-11-15 12:11:42 +01:00
SirStone 74272c1e70 results: rerun the slice 8 gates on the final tree (#23) 2026-11-15 12:01:40 +01:00
SirStone 34a33b5ead results: rerun the slice 7 gates on the final tree (#22)
devbox run test green: 317 Nim [OK] blocks and 77/77 Node harness tests
(migration step 6, the details group, the twelve fault classes).
devbox run mutation green: control plus a..au, no survivors, no no-ops.
2026-11-15 11:09:15 +01:00
SirStone d773a5e2de results: rerun the slice 6 gates on the final tree (#21)
devbox run test: 273 Nim checks and 68 Node tests pass. devbox run mutation: control passes,
41 of 41 mutations (a-al) fail their expected tests, including the six new explored ones.
Chunk write avg 0.015 ms / p99 0.037 ms; move ack with explored writes avg 0.79 ms / p99 2 ms.
2026-11-15 10:03:37 +01:00
SirStone 5d38e92c03 results: rerun the slice 5 gates on the final tree (#20) 2026-11-15 09:37:33 +01:00
SirStone ae6054ea94 results: slice 5 test and mutation logs (#20) 2026-11-15 09:35:37 +01:00
SirStone 8b595156f0 results: slice 4 test and mutation logs (#19) 2026-11-15 08:49:44 +01:00
SirStone 2a1e2dd71c results: slice 3 test and mutation logs (#18) 2026-11-15 08:33:16 +01:00
SirStone 8ff66530d8 results: slice 2 test and mutation logs (#17) 2026-11-14 22:13:09 +01:00
SirStone c89c8eab42 results: slice 1 test and mutation logs (#16) 2026-11-14 21:41:33 +01:00
SirStoneandClaude Sonnet 5.5 809f219f42 results: regenerate mutation log (parallel run)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 19:19:58 +01:00
SirStoneandClaude Sonnet 5.5 dcb8efa422 results: regenerate test, mutation (a-o), bench logs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 19:03:26 +01:00
SirStoneandClaude Sonnet 5.5 a29bb0bb46 moverules: door close pushes overlapped tokens aside (valid-side check, blocked only if no side valid); Push list; tests; mutations m-o
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 18:56:06 +01:00
SirStoneandClaude Sonnet 5.5 0e67331b6c results: regenerate test, mutation (a-l), bench logs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 18:53:12 +01:00
SirStoneandClaude Sonnet 5.5 0e0b1a6052 mutation: run all test files, add mutations e-j (scanline fill, escape crossing, GM bypass, capsule, step cap, blocked trigger); header limitations updated
Control passes; a-d still caught (1,2,2,1,1 expected tests), new e-j each caught. Logs regenerated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 18:33:12 +01:00
SirStoneandClaude Sonnet 5.5 e0705a8533 bench: harness with synthetic 5k-wall scenes (devbox run bench), scenegen + tests
Targets met without a spatial grid: polygon+cells 0.048 ms (<= 0.451) on the prototype scene, polygon 0.083 ms
(< 1 ms) on 5k sparse. 5k dense stress layout reported (1.28 ms). Logs: results/bench.log, nimble-test.log.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:15:31 +01:00
SirStoneandClaude Sonnet 5.5 8751b83ad8 tools/mutation.sh: temp-copy mutations a-d (d1/d2 = shared-vertex arms); logs results/mutation.log, nimble-test.log
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 10:09:20 +01:00
SirStoneandClaude Sonnet 5.5 547458c37e m1: devbox, nimble, layout; port geometry.nim and 33 tgeometry tests (98 checks)
Fixture tests/fixtures/scene.json copied from prototype data/; seed test no longer skips if missing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 10:06:58 +01:00