Commit Graph
7 Commits
Author SHA1 Message Date
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 b56d645b3a docs: M4 built, acceptance pending playtest #77 2026-11-21 18:22:36 +01:00
SirStone 9c7f9de910 feat(m4): playtest friction: perf overlay, fresh import, token seed (#82)
Opt-in ?perf=1 overlay (fps, frame p50/p95, JS p50/p95, tokens, zoom; no node or ticker work when off). fff-vtt import creates and migrates a fresh/empty state dir through the shared server startup path; devbox run serve gains --image. devbox run seed creates deterministic labelled NPC tokens over the real WS (idempotent rerun, --replace), and the GM token form defaults X/Y to the viewport centre.
2026-11-21 17:20:05 +01:00
SirStone 356705823b feat(m4): LAN playtest run script (devbox run serve) (#80)
One command builds the client dist and server binary, then starts the
loopback server behind the DESIGN 11.1 TLS/HTTP2 nginx on the detected
LAN address. State, GM key and certificate persist under run/lan so a
table and a phone's trust survive Ctrl-C/restart; the certificate is
regenerated when the address changes. Prints the URL, GM key and
Android/laptop trust steps. tools/nginx.mjs and tools/tlsdev.mjs gained
the bind/SAN knobs the LAN needs (test defaults unchanged).
tools/serve.test.mjs proves h2 + verified TLS on /healthz and /, POST
/join, a /ws upgrade on the LAN address, loopback-only server binding,
and identical key/cert after a restart.
2026-11-21 16:33:57 +01:00
SirStone ad610abd65 feat(server): map import CLI, pulled forward to M4 (#79)
Slice a PNG/WebP map into the gate's <x>_<y>.png tree under
<state>/tiles/<scene>/v<art_version>/ and update the one scene row
(w, h, tile_size, art_version); a re-import grows art_version so
clients never serve stale tiles. The state-dir lock keeps a running
server out (it loads the scene at startup), so stop/import/restart.

Decoding is ImageMagick from the root devbox with a disk-backed
pixel cache (-limit memory/map), keeping a 16384 px source
memory-sane; no Nim/npm image dependency and the FIXED stack is
unchanged. The black-box harness covers the tile geometry, scene
row, restart pickup through the gate, re-import bump and every
refused-import case.

Records the M6 -> M4 move in DESIGN 3.3/11.1/13 and DESIGN-history,
and documents the CLI plus the 16384 px/50-token recipe in README.
2026-11-21 15:59:54 +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 fd711de152 docs: human README with usage and developer sections 2026-11-21 15:03:53 +01:00