diff --git a/tests/mutation_tests_fire_control_cut3.sh b/tests/mutation_tests_fire_control_cut3.sh index b32acb159..66a882167 100644 --- a/tests/mutation_tests_fire_control_cut3.sh +++ b/tests/mutation_tests_fire_control_cut3.sh @@ -7,7 +7,7 @@ # # OutOfArcConsumesNoDraw no longer exists. It asserted against ItemManager.Random (`e.Items.Random`), but # Cut 6b (6.1) moved every shot's roll onto its own freshly-seeded, immediately-discarded -# `new Random((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u)` local to Commit -- a deliberate, +# `new Random(MixSeed((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u))` local to Commit -- a deliberate, # good change (reproducibility independent of unrelated draws elsewhere) that also meant Commit stopped # reading or writing ItemManager.Random on any path, arc or no arc, which made the old test's own declared # mutation ("roll first and multiply by zero") pass for a reason that had nothing to do with arcs. Cut 7 @@ -197,7 +197,7 @@ check_mutation \ check_mutation \ "RollsAreSeeded: Commit's draw must be a pure function of (zone, shot id), not fresh entropy per call" \ "$FIRE_CONTROL_CS" \ - 'var random = new Random((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u);' \ + 'var random = new Random(MixSeed((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u));' \ 'var random = new Random((uint) System.Guid.NewGuid().GetHashCode() | 1u);' \ "FireAuthorityTests.RollsAreSeeded" \ "red" @@ -350,8 +350,8 @@ check_mutation \ check_mutation \ "CombatNeverDrawsFromTheSharedStream: Commit must never read ItemManager's shared stream, on any path" \ "$FIRE_CONTROL_CS" \ - 'var random = new Random((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u);' \ - 'var random = new Random((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u); shot.Source.ItemManager.Random.NextFloat();' \ + 'var random = new Random(MixSeed((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u));' \ + 'var random = new Random(MixSeed((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u)); shot.Source.ItemManager.Random.NextFloat();' \ "FireAuthorityTests.CombatNeverDrawsFromTheSharedStream" \ "red" diff --git a/tests/mutation_tests_fire_control_cut6.sh b/tests/mutation_tests_fire_control_cut6.sh index 175769cc4..1de667cc2 100644 --- a/tests/mutation_tests_fire_control_cut6.sh +++ b/tests/mutation_tests_fire_control_cut6.sh @@ -194,8 +194,8 @@ check_mutation() { check_mutation \ "control (no-op round trip)" \ "$FIRE_CONTROL_CS" \ - 'var random = new Random((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u);' \ - 'var random = new Random((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u);' \ + 'var random = new Random(MixSeed((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u));' \ + 'var random = new Random(MixSeed((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u));' \ "FireControlCut6Tests.SameFightRollsSameThroughUnrelatedDraws" \ "green" @@ -206,7 +206,7 @@ check_mutation \ echo "" echo "=== 6.1 Commit must not read or write the shared ItemManager.Random stream (expect red) ===" if replace_unique "$FIRE_CONTROL_CS" \ - 'var random = new Random((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u);' \ + 'var random = new Random(MixSeed((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u));' \ 'var random = shot.Source.ItemManager.Random;' \ && replace_unique "$FIRE_CONTROL_CS" \ 'return MakeOutcome(shot, hit, shielded, shieldBroken, cell, aimed, now);' \ @@ -224,8 +224,8 @@ fi check_mutation \ "6.1 ShotId must reach the seed" \ "$FIRE_CONTROL_CS" \ - 'var random = new Random((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u);' \ - 'var random = new Random((zone.CombatSeed * 2654435761u) | 1u);' \ + 'var random = new Random(MixSeed((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u));' \ + 'var random = new Random(MixSeed((zone.CombatSeed * 2654435761u) | 1u));' \ "FireControlCut6Tests.ShotIdDecidesTheDie" \ "red"