fix(@projects/@magic-civilization): 🐛 update golden test values after rng fix

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-05-13 11:23:56 -07:00
parent cb0f18361e
commit 8e0ad24aca

View file

@ -74,36 +74,33 @@ fn twenty_turn_golden_state() {
let p0 = &state.players[0];
let p1 = &state.players[1];
// Gold: wealth=3, 1 city base → 3*1*4=12/turn. Some turns gain cities so
// gold accumulates faster toward the end. After 20 turns with 1 city: ≥12*20=240.
assert!(
p0.gold >= 240,
"player 0 gold after 20 turns should be ≥240, got {}",
p0.gold
);
assert_eq!(p0.gold, p1.gold, "symmetric players should have equal gold");
// Golden snapshot (regenerated 2026-05-13 after p2-67 Bug 2 insolvency
// cascade fix landed). Players start with symmetric axes but diverge
// because per-player RNG seeds (turn, pi) feed independent unit-spawn,
// ambient-encounter, and lair-encounter streams. Previously the test
// asserted p0.gold == p1.gold; that invariant has not held since
// per-player RNG seeding landed and was masked only because earlier
// economy code produced coincidentally-equal totals. The cascade fix
// shifted the totals so the coincidence broke. Pin both values
// explicitly going forward — any deliberate change to TurnProcessor
// sequencing must update these intentionally.
assert_eq!(p0.gold, 306, "p0 gold golden");
assert_eq!(p1.gold, 320, "p1 gold golden");
assert_eq!(p0.units.len(), 13, "p0 unit count golden");
assert_eq!(p1.units.len(), 9, "p1 unit count golden");
assert_eq!(p0.cities.len(), 3, "p0 city count golden");
assert_eq!(p1.cities.len(), 3, "p1 city count golden");
// Population: starter city pop=1, food_yield=4, food consumed=2/pop → net=2/turn.
// Threshold for pop 2 = 15. Should hit pop 2 within first 8 turns.
assert!(
p0.cities[0].population >= 2,
"city population should grow to ≥2 after 20 turns (got {})",
p0.cities[0].population
);
// Threshold for pop 2 = 15. Reaches pop 2 within first 8 turns and stays.
assert_eq!(p0.cities[0].population, 2, "p0 capital pop golden");
assert_eq!(p1.cities[0].population, 2, "p1 capital pop golden");
// Culture: 3*1*25=75/turn → 1500 after 20 turns (without city growth bonus).
assert!(
p0.culture_total >= 1500,
"culture_total should be ≥1500 after 20 turns (got {})",
p0.culture_total
);
// Units: production_stored should have crossed unit_spawn_cost at some point.
// prod_axis=3, prod_yield=4 → 4*3/3=4 prod/turn. unit_spawn_cost=8 → unit spawns by T3.
assert!(
!p0.units.is_empty(),
"player 0 should have spawned at least 1 unit after 20 turns"
);
// Culture: 3*1*25=75/turn base; city growth + extra cities push to 2700.
assert_eq!(p0.culture_total, 2700, "p0 culture golden");
assert_eq!(p1.culture_total, 2700, "p1 culture golden");
}
#[test]