village-builder

VB-196: The moving round within the late-fixture step gates

Status: done Priority: 1 Size: M Arch: yardstick Phase: implement Design ref: Inheritance and expansion; People, households and family records (marriage). docs/roadmap.md, sections 5.2 (no step over 60 ms, Decided, Kim, 3 November; revised 6 November: small 60 ms, medium temporarily 400 ms until VB-201) and 5.3 (rule 5, stagger and spread). Goal: In populous small at seed 7, the moving round takes 37 ms in one call at year 5. At year 40 it takes 485 to 539 ms called right after loading the save, and 897 ms in its place in year 41: the game freezes once a game year (3 November, this container). A CPU profile of one round on the year-40 save puts 444 of its 511 ms in heirRanking. Most of that is ownFirstOf (423 ms), which the round recomputes after every marriage, and handsOnWell, which ranks heirs again for each pair the marriage loop weighs (both, 382 ms). kinPressure takes 119 ms. Bring the longest step under 60 ms on small-y40 and temporarily under 400 ms on medium-y60; VB-201 restores medium to 60 ms. Blocked until VB-193 (the fixtures) is done. Acceptance criteria:

Measurement note (VB-192 review, 4 November 2026): roundRank is a tools/tests measurement: snapshot VB.count.heirRank before Sim.movingRound(st) and subtract it afterwards. heirRank now counts every ranking at its source, including indirect calls; the simulation never reads it.