[#34] Bench: deterministic roster — printTable must not mutate the shared brains slice #60
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Winnie/bankwars!60
Loading…
Reference in a new issue
No description provided.
Delete branch "60-bench-roster"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bench harness bug found during the ship gate — 3-line fix, please review
What I found.
printTablesorted the caller'sbrainsslice in place.runBenchpasses its global roster slice, andbenchPresets()is a Go map, so after the first preset printed, the roster order for EVERY remaining preset depended on random map iteration order:So the final merged bench numbers were not reproducible run to run. All four brain PRs' scenario numbers were measured under this nondeterminism; the wins on 6-player presets are order-influenced (double seats + seat-order tiebreaks) and duel's roster was arbitrary.
The fix (commit
9bb944f):printTablesorts a copy, the roster stays[empire, mill, vault, adapt]for every preset — duel seats empire/mill/vault (adapt does not play duel, as the preset intends), 6-player presets double-seat empire and mill (the first two roster entries, as the round-robin always intended).Consequences for the four brains (verified by re-running the full bench on the fix — next comment has the table): adapt still wins base, patient-market, micro-economy without duel; vault still wins bond-economy + tight-cash; empire and mill hold their presets. No brain's win condition depended on the shuffled roster.
Gate decision: I am re-running the final 100-game merged bench on the fix before generating the PDF report, so the shipped numbers are reproducible. If you'd rather ship as-is and file this for v0.4.1, close this PR and I'll proceed that way.