village-builder

VB-206: The meetings spread, so no step goes over 60 ms

Status: done (2026-11-10) Priority: 2 Size: S Arch: yardstick Phase: implement Design ref: Customs and culture (the meeting). docs/roadmap.md, section 5.3 (rule 5, stagger and spread). Goal: Once a year, at noon on autumn day 10, one 6-minute step runs every village’s meeting and then the land meeting (holdMeetings and landMeeting, src/sim/clock.js:29). holdMeetings (src/sim/lifecycle.js) works in four stages:

  1. it refreshes roles, prestige, interests and ties over the whole population;
  2. it picks the year’s entrepreneurs;
  3. it holds each settlement’s meeting;
  4. it runs each culture’s year. On 9 November (VB-203, medium-ref, a whole game year, three runs) the meetings’ call took 38 to 50 ms and its noon step 60 ms in one run, at the limit; at medium-y5 33 ms. VB-201 covers the moving round (the next day) and midnight, but not this step. Measure it again here and, if the step is over 60 ms, spread it; it grows with the living, so a step at the limit at 1,000 is over it as the population grows. Acceptance criteria:
    • Measure first, on medium-ref and small-y40: the step’s time and each part’s (the four refreshes, the entrepreneurs, the settlements’ meetings, the cultures’ years, the land meeting).
    • If the step is over 60 ms, its parts are spread over the day’s steps, a village per step (rule 5). Progress is kept as plain data in st, so a save between steps resumes it. The meeting log and the order of each village’s draws are kept. If the whole-population refreshes are the cost, say whether they can run per village or lazily.
    • If the order of the culture’s draws changes, behaviour changes. Then re-record the golden file, list the changed entries, and report the drift of customs over 20 populous years before and after (npm run calibrate), each within the calibration’s bands.
    • No step of the meeting day over 60 ms on medium-ref and small-y40; npm run verify passes. Notes:
    • 7 Nov 2026 (review of the work since 3 November): written. It waits for VB-203, which may change the fixtures the step limit is asserted on.
    • 9 Nov 2026 (VB-203, Kim’s answers in the session): confirmed with the numbers at medium-ref (no medium-y60, Kim, 8 November); its step was 60 ms in one of three runs.
    • 10 Nov 2026 (VB-242’s plan): Kim decided on 10 November that each village holds its own meeting in its own step; VB-278 makes stages 0 to 2 a village’s, and the cultures’ years and the land meeting follow at 18:00 and 18:06.

Implementation (10 Nov 2026): measured (cold, one call each): small-y40 43 to 56 ms, medium-ref 61 to 62 ms for the stages: roles and prestige 0.3, interests 20 to 30, ties 14 to 20, entrepreneurs 1, the settlements’ meetings 1.5 to 3 (0.5 the largest), the cultures’ years 0.5 to 1.3, the land meeting 6 to 14. The noon step itself: 56 ms (small-y40) and 65 ms (medium-ref) before. The cost is the two whole-population refreshes, not the meetings (settlements and cultures together are under 5 ms, so a village per step is not needed). meetingStage(st, n) in src/sim/lifecycle.js splits the year’s meeting into four stages, run by advance on the 6-minute steps from noon of autumn day 10: 0 roles, prestige, interests; 1 ties; 2 the entrepreneurs, every settlement’s meeting, every culture’s year and the meeting log; 3 the land meeting. No progress is stored: the step of the day says what is due, so a save between stages resumes (tests/spread.js, saves at 12.05, 12.15, 12.25). holdMeetings stays as the first three at once. Draws keep their order (same stream, same sequence), so no custom changes: the golden file moved only in timestamps (stakes’ since/renewed, lastMeeting, advocates’ until, event times: 0.1 to 0.3 h later), so no calibrate run. Could the refreshes run per village or lazily? Interests and ties are whole-population by construction (ties of pairs inside households and venues); not tried, they now fit a step each. Validation: after, the meeting day’s steps at 11.5 to 12.7 h: small-y40 max 21, 27, 28 ms; medium-ref max 29, 50, 33 ms (the 50 is the first, cold call). Before: 56 and 65 ms. npm test and node tests/golden.js pass (golden re-recorded); counters unchanged.