Status: done (2026-11-09)
Priority: 2
Size: M
Arch: talk
Phase: implement
Design ref: Customs and culture (How attitudes move: contacts weighted by time together, plus kin). Relationships review, 31 Oct 2026 (docs/review-relationships.md, findings F1, F4 and proposal B); Kim kept the tie model unchanged in VB-061 and left this for later.
Goal: The tie counts the hours two pawns spend within 30 map units or in one house, sleeping hours included. Housemates tend to about 70 while the kin floor is 0.4, so a pawn’s household is about 95% of its social influence; and counting a crowd is quadratic in its size (150 pawns on a green make 11,000 pairs an hour), now the largest single cost of a game day.
Acceptance criteria (Kim, 2 Nov 2026: the proposals accepted; QUESTION_ARCHIVE.md, VB-127):
noteContacts and st.contacts go.Culture.dailyStep divides by the sum of a pawn’s weights, so the shared scale cancels there.design.md (Pace) is rerun in the simulation over 100 founders and 20 populous years, before and after; the PR proposes retuning if a custom moves more than a generation faster or slower.tests/perf.js before and after; target a game day of populous medium under 60 ms. (Measured instead against the shares of 9 November, tools/bench.js SYSTEM_BUDGETS, at medium-ref and small-y40: below.)ready at priority 2. Its cost criterion uses tests/perf.js, which VB-088 adds, so VB-088 goes first.docs/roadmap.md): VB-088 waits, since slice 0 rewrites it, so measure cost with tests/perf.js as it stands and with one year from a late save (node tools/sim.js --scenario populous --seed 7 --map small --years 40 --save FILE, then --load FILE --years 1 --report perf). On 3 November talk and contacts took 62 ms of a 227 ms game day in year 41 of populous small, and dailyLife’s daily pass over every tie 37 ms; the shared decay scale removes that pass. The roadmap places this task in slice 7 and allows it to move earlier if the budget binds.docs/roadmap.md, section 3.7; the slices Decided by Kim): moved to slice 7, arch talk (from social). It stays ready and runs ahead of its slice: the budget already binds (roadmap, section 5.1), and it is the largest saving.small-y40 with them. The midnight step (VB-201) waits for this task’s shared decay scale: at year 40 the daily decay of every tie took about 18 ms a game day and Culture.dailyStep 17 ms. When done: sets VB-201 ready if VB-195 is done too.medium-y5 and 176 at medium-y60, 27% of the day (node tools/bench.js on 6eaa6bc, with the stale fixtures of 4df5766). Measure before and after on small-y40, and on medium-ref once VB-202 has made it. VB-201 now also waits for VB-203, so finishing this task leaves VB-201 blocked until VB-203 is done.sim/relations owns familiarity whole. A tie grows by SOCIAL.ties.talk (0.5) a talk, by home (1) per 24 waking hours two housemates spend in their house, and by work (0.5) for each pair that finishes one job together (workedTogether, called by sim/agents complete before the hands are freed). Waking hours are the talk hours (6 to 22): talkHour counts pawn.homeHours for each pawn inside, and dailyTies at midnight adds the lesser of two housemates’ hours, once per pair of each live household, and starts the hours again. noteContacts, st.contacts, pairKey and pairOf are gone; the outdoor cells that talk draws partners from stay in sim/society as outdoors, built in the talk hours only. The gift’s tie (HELP.tieGain), the starting ties (household 1, near kin at least 0.5), a newborn’s (1 with its household) and the wedding’s (2) go through addTie and raiseTie; the wedding now raises the spouses’ tie to at least 2 instead of setting it to 2, so it never lowers a tie talk has built.pawn.tieT; the tie now is the stored weight halved for every year since then (tieOf), so no step decays them (rule 3). Every 4 years (renorm), on a day spread by id ((day + id * 73) % 192, 73 being 192/φ², so any run of days takes an even share of the pawns), a pawn’s ties are put back on today’s scale, and those under 0.02, not to kin, or to the dead go. Culture.dailyStep is unchanged: it divides by the sum of the pawn’s stored weights, so the scale cancels. The readers that need the value go through tieOf or the pawn’s scale: talk’s and company’s weights, the meeting’s support for a claim (sim/claims), and relationsOf (the page).medium-ref, a midnight step VB-201 is trying to shorten; per pawn it is spread over 192 days. Culture.dailyStep sums one pawn’s ties at a time, so it cancels all the same.put keeps at most cap (150) ties a pawn; a new tie at the cap takes the place of the weakest that is not to kin, unless it is weaker still and not to kin. Kin are always kept.small-y40, kinNear allocating), so each pawn raises them once a season, on its own day, to 0.4 and a season’s fading (0.476): they stay at 0.4 or above until its next turn. A newborn’s kin are raised at the birth, both ways; an older save’s at the load.dropTies, as before); with the cap and forgetting one side of a tie can go alone, so a pawn may hold a tie to the dead until it next renormalises. Nothing reads it: talk and company draw the living, Culture.dailyStep skips the dead.pawn.tieT and pawn.homeHours, owned by sim/relations (src/owners.json, @state lines), with invariants in checkState (checkTies: ties to other pawns, living or dead since the pawn’s tieT, finite and above 0, at most the cap; tieT no later than now; homeHours whole and within the talk hours). Older saves: st.contacts is left out of the decoded state, and migrateTies gives each pawn a scale from the load, trims any over the cap and raises kin to the floor.contactPairs goes; walkTies now counts the ties walked by renormalising and by making room under the cap; tiePairs (new) the pairs given a day at home or a job together. tests/counters.json re-recorded: walkTies 12.82 to 0.054 a living pawn-day, walkDaily 6.0 to 5.0, contactPairs 61.8 gone, tiePairs 2.88; the rest move with the run (routeRefresh 1.02 to 1.44, the others within 10%).tests/relations.js: the scale (a tie read a year later is half; a talk adds 0.5 as of now; renormalising keeps every tie and drops those under 0.02), the kin floor a season after it is raised, a day at home, a job together, and the cap.Cost, a whole game year from each fixture, tools/bench.js’s measure in paired, alternating runs, three of each (the fixtures are those of 9f130e6, loaded through the migration). Medians, with the range:
| ms a game day | medium-ref before |
after | small-y40 before |
after |
|---|---|---|---|---|
| talk and contacts (share 55) | 73.3 (72.3–74.2) | 46.3 (45.9–51.3) | 44.4 (34.7–45.1) | 28.1 (22.5–30.1) |
| daily life and births (share 35) | 43.6 (41.3–45.8) | 28.4 (28.1–28.5) | 24.1 (19.3–25.5) | 15.8 (12.0–16.8) |
| whole day | 241.9 (230.6–242.3) | 200.4 (195.2–221.3) | 153.8 (115.7–157.9) | 122.2 (94.1–125.6) |
| longest 6-minute step (ms) | 154.7 (102–236) | 134.9 (112–188) | 99.6 (81–187) | 96.9 (46–137) |
Work a living pawn-day at medium-ref: contactPairs 117.2 and walkTies 63.0 became tiePairs 2.9 and walkTies 0.85; walkDaily 6 to 5; talkWeighed 9.98 to 9.99. At small-y40: contactPairs 74.1 and walkTies 47.9 became tiePairs 2.2 and walkTies 0.25. Both shares are now met at medium-ref. Inside daily life at small-y40 (12 days, inclusive): dailyTies 16.4 to about 3 ms a day, Culture.dailyStep 26.8 to 18.0 (fewer ties per pawn); talk’s own hour 41.9 to 33.0 and the cells 19.7 (noteContacts) to 1.4 (outdoors). Save, main thread, 890 to 782 ms at medium-ref; load 597 to 713 ms, the migration of an older save (every pawn’s kin raised once) included, which a remade fixture will not pay.
tests/history.js: history.routeExpand reads 1.257 against the line’s 1.25 and is recorded as a known excess in tests/cost-baseline.json. Year 40’s expansions over the window are as before (110,984 against 110,764), year 5’s 4% fewer (50,198 against 52,247): familiarity steers where idle pawns walk. The new counters pass (walkTies 1.05, tiePairs 0.82); tests/scaling.js passes (walkTies 0.81, tiePairs 0.97).npm run calibrate runs on its own ties and is unchanged by this task.tools/sim.js, populous small, 15 years: living at year 15 465 before and 474 after at seed 7 (483 and 494 at seed 3, 457 and 472 at seed 42); marriages 88 and 92 (85 and 92, 76 and 82); hungry household-days over the 15 years 245 and 322 at seed 7, 846 and 745 at seed 3, 824 and 765 at seed 42: in both directions, so households are neither better nor worse off beyond the noise of one shared stream. Founders 7 small, 10 years: the same living, births and deaths each year; mean grain within 5%.contacts gone and pawns (ties, tieT, homeHours) and cenv from the seed on, and from year 1 the run with them. The worlds are unchanged.npm test and npm run verify pass.QUESTION_ARCHIVE.md, “VB-127: the build’s three departures”): a decay scale per pawn, renormalised on a day spread by id, is accepted in place of one shared scale; the history.routeExpand excess (1.257 against 1.25) is accepted in tests/cost-baseline.json, to be rechecked once the nightly run remakes the fixtures with this code and dropped if the ratio falls back under 1.25; the starting ties keep their old values on the new scale. Merged.