Status: done (2026-10-31, c8fae47)
Priority: 2
Size: S
Arch: tooling
Phase: implement
Design ref: Vision and scope (up to about 1,000 pawns); Systems overview (Across systems: cost; a budget per system). Review: docs/review-balance.md (31 October 2026), section 1.
Goal: The moving round still took about 1.3 s in one step on populous medium at seed 7 in year 1, and the meetings 60–120 ms. In the round’s marriage match the woman’s place (homeFor’s default argument placeIfMarried(st, f.id)) and kinPressure’s checks ranked every farm’s heirs for every pair of candidates, each ranking ranking all other farms again; wantsOut and the handover loop did the same per pawn and per household. In the meetings updateTies searched up to 160 steps from every village and scanned every pawn once per village. Behaviour must not change.
Acceptance criteria:
movingRound, placeIfMarried is cached per pawn with one ownFirstOf until the next marriage changes the families; the handover loop computes ownFirstOf once and again only after a handover; the demand count passes one ownFirstOf to firstHeirs and wantsOut (a new optional argument), as st.countDemand does.updateTies finds the steps between a village and its culture’s centre with stepsTo (src/sim/hex.js), the same breadth-first search stopping at the target, and groups the living pawns by settlement once.tests/golden.json is unchanged, and a 3-year populous medium run at seed 7 hashes the same before and after (pawns, households, unions, demand, log, herds).
Notes / questions:docs/review-balance.md appendix): mean 135.9 → 117.4 ms a game day; longest step 1,305 ms (the year-1 moving round) → 102 ms (a midnight, most likely a garbage-collector pause: that midnight’s parts sum to about 15 ms). tests/perf.js after 2 years: moving round 228 → 20 ms, meetings 63 → 16 ms (updateTies 57 → 7 ms).