village-builder

VB-853: Verify’s small cases: saves and the –extended variants of clock, spread, paths, indexes

Status: done (2026-11-16) Priority: 1 Size: L Design ref: docs/testing.md (What runs only at night); tests/suites.js Goal: Verify takes about half a minute and holds a small constructed case of each rule the nightly-only scripts assert (Kim, 13 November) Acceptance criteria: Scripts: tests/saves.js (43 s), and the --extended variants of clock, spread, paths, indexes (the second group of EXTENDED in tests/suites.js). Split from VB-409, which did the page (tests/page.js, harness tests/lib/dompage.js).

Noted by VB-409, 16 November 2026.

Implementation notes (VB-853)

Tests only; nothing under src/ changed. tests/lib/probe.js gains island(seed, size) and scenario(name, seed): small generated islands, 36 by 26 (as tests/page.js), 48 by 34 for heirs (on 36 by 26 and 30 by 22 it throws “Not enough room for the debug villages”). Each is a tenth of a second to generate and seed.

Decision: the scenario cases use these small generated islands rather than tinyWorld maps. Sim.seed runs all three scenarios on a tinyWorld island too, but a populous year there costs about twice as much (the hand-drawn all-meadow land fills up), and saves asserted that a save loads into a world generated again from its seed and size, which a tinyWorld cannot show. tests/page.js already uses a generated 36 by 26 island in verify.

Where each assertion went:

Validation: each script passes in each mode; paths --extended passes on the default island (unchanged numbers: worn in 377/211/52, after a year 832/418/150, 352 segments). Times on this machine at load 12 to 25 on 4 cores are descriptions: user CPU saves 4.7 s, clock --integration 2.3 s, paths --integration 1.7 s, indexes --integration 3.0 s (wall 5 to 17 s under that load). The night loses saves, spread --extended, clock --extended and indexes --extended (about 110 s measured in the 245-second verify).