Status: done (2026-11-10)
Priority: 2
Size: M
Design ref: AGENTS.md, Rules for cost, 7 (only the page interpolates). Kim, 10 Nov 2026 (code review).
Goal: src/page/speed.js passes dt * speed / HOUR_SECONDS hours to Sim.advance, so a simulation step is as long as a frame and the same seed gives a different run by the frame rate: a seed reported from the page cannot be replayed headless. Kim decided on 10 November that the page runs whole six-minute steps and draws each pawn between its last two places.
Acceptance criteria:
advanceSimulation (src/page/speed.js) keeps the part of a step the frames have not yet used, in the page, and asks Sim.advance for whole steps only (VB-235’s ticks); at “Uncapped” it asks for one step at a time as today. Sim.advance refuses, or rounds and says so in its --helpd contract, a number of hours that is not whole steps.src/page/animate.js); a pawn that went indoors, came out or was placed (a move of more than a step’s walk) is not drawn between. Nothing of the interpolation is written to st (the lint’s page rule). The clock shown advances smoothly.tests/browser.js): the same seed run in the page at two frame rates for a game day ends in the same state as Sim.advance headless (the canonical hash); and a pawn’s drawn place never lies outside the segment between its two last places.tools/shot.js screenshots or a short capture at 1× and 3× in the PR, with a sentence on how the walk reads against today’s.advance and stepAgents take whole steps only, and the remainder field goes from st if VB-235 put one there. tests/golden.json unchanged (headless runs already use whole steps).node tests/browser-speed.js no slower than before beyond its spread. npm run verify’s hard checks pass, its targets reported with their residuals.
Notes:fb35e75: populous, seed 7, 96 by 64, 3 years in chunks of 0.0731 hours (a frame’s worth) ends with 171 living against 167 in whole steps. At 1× a step lasts 0.2 s (HOUR_SECONDS = 2), so without drawing between, a walk would show five places a second.Sim.advance given hours that are not whole steps
(or negative) throws, as the module’s other contract errors do, rather than rounding; the interpolation’s state lives in the page’s closure
only, the page copying positions before it asks for a step; tests/golden.json unchanged.st”. st.tickPart stays, always 0 (checkState asserts
it): dropping the key re-records tests/golden.json’s tickPart entry (the hash of 0) in every entry, which the run forbade. A load of a
save that carries a part drops it (src/sim/saves.js). Follow-up for Kim: drop st.tickPart and re-record that one golden key. Done in VB-285 (field and readers removed; golden’s tickPart key re-recorded by the orchestrator).
Impact note (for the PR):src/sim/clock.js (ticking takes whole steps, stepsIn refuses others; step always ends its step), src/sim/agents.js
(stepAgents(st, c), a step’s dt fixed), src/sim/commands.js (skip refuses parts of a step), src/sim/saves.js (a part in a save is
dropped). The page: src/page/speed.js keeps stepShare (the part of the next step asked for), the run it belongs to, and each agent’s
place, stride and indoors flag before the frame’s last step (typed arrays in the closure); src/page/animate.js placePawns() computes the
drawn place of every agent once a frame, read by the rigs, the oxen at the plough and the milked cow, the selection ring, talk bubbles, the
lens and the played pawn’s mark (talk.js, play.js); pose takes the drawn stride. The page now reads VB['sim/rules'] (SPEED,
TICKS, ROUTE.minStep) for a step’s longest walk. No new state in st; no new coupling between systems.advanceSimulation adds dt * speed / HOUR_SECONDS / 0.1 to stepShare, runs its whole part a step at a time
(Sim.advance(st, 0.1)), noting the places before the last; uncapped and skip run a step at a time as before. drawingBetween() is true
only while st is the run stepped there and its clock is still the page’s last step (a load or a debug skip draws where pawns are).stepShare; a pawn indoors before or now, new since the copy, or
moved more than a step’s longest walk (SPEED * HW / TICKS / ROUTE.minStep, a lane, plus 1%) is drawn where it is.tick - 1 + stepShare steps while drawing between, else tick), floored to 5 minutes:
smooth, and at most a step and 5 minutes behind st.t (tests/smoke.js, tests/browser-speed.js allow that lag now).tests/clock.js (frame-sized chunks gone; parts refused and leave the state unchanged), tests/spread.js
(uneven whole steps; saves at 12.0, 12.1, 12.2 and 12.1, 0.5), tests/interrupts.js (0.55 to 0.6), tests/player.js (end of work - 0.2),
tests/saves.js (3000.75 to 3000.7), tests/lib/clock.js (setClock refuses a time between steps), tests/speed.js (whole steps only).
No tool asked for a part of a step.
Validation (at the base, 0f52de4, and after):tests/golden.json unchanged (node tests/golden.js: golden state matches).tests/browser.js, Chromium, populous seed 7 tiny, from the new game’s state): the page’s own pacing at 60 fps 30x (96 frames,
240 steps) and at 24 fps 10x (116 frames, 241 steps) ends in the state Sim.advance gives headless for as many steps (the save’s hash
8a7796a4cc5e6b63 and a4685dbdaabd046d); every frame draws every living pawn on the segment between its two last places, or where it is
(2,635 and 6,353 pawn-frames drawn strictly between). Found on the way, not this task’s: the same run headless in node differs from
Chromium’s in agents[].stride alone (last bits of a float of a Math function; two V8s), so a page seed replays in node but for strides.tests/browser-speed.js, wall time, three runs each, alternated with the base build (shared machine): base median 18.06 s (15.85 to
19.38), after median 15.87 s (15.68 to 19.36): no slower beyond the spread. It also checks each visible rig is at its drawn place, on its
segment.docs/img/vb244-walk-1x.jpg and docs/img/vb244-walk-3x.jpg, six frames 60 ms apart around a walking pawn, the base on top
and this build below. The walk reads as before: smooth, not five places a second at 1x (the base moved the agents by parts of a step; this
build runs whole steps and draws between them, a step behind the simulation).npm run verify (fixtures fresh at 0f52de4): hard checks pass after the two fixes above (tests/smoke.js clock lag, tests/saves.js
mid-step save, each rerun alone and passing). Targets out, as at the base and not moved by this change (headless runs are unchanged):
scaling.routeRefresh +0.1147, scaling.roundPairs +0.85; history.routeExpand +0.4405, history.routeRefresh +0.5579,
history.roundPairs +2.128, history.recordFold +1.511; bands 0 out.