Add failed-Exam loss switch; keep -3 and accept the length (6.11, D50)

RulesConfig.exam_failure_loss (bots aware) with the sim axis --exam-loss.
Losing 1 or 0 stripes saves 3-5 minutes but weakens comebacks, so the
rules keep -3. Default games are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-27 17:51:13 +02:00
parent 542ac1b15f
commit 52d8af620b
11 changed files with 116 additions and 17 deletions
+13 -4
View File
@@ -11,13 +11,17 @@ LINEUP = ("balanced", "random")
def test_matrix_crosses_every_axis() -> None:
scenarios = matrix(["none", "acd"], [3, 4], [2, 1], [0], [LINEUP])
scenarios = matrix(["none", "acd"], [3, 4], [2, 1], [0], [LINEUP], [3, 0])
assert len(scenarios) == 8
assert scenarios[0].name == "exam:none p3 kiai+2 start0 balanced,random"
assert len(scenarios) == 16
assert scenarios[0].name == "exam:none p3 kiai+2 start0 fail-3 balanced,random"
assert scenarios[0].config == RulesConfig(exam_defender_black=False)
assert scenarios[-1].config == RulesConfig(
exam_ties_to_defender=True, exam_defender_black=True, exam_rounds=3, kiai_bonus=1
exam_ties_to_defender=True,
exam_defender_black=True,
exam_rounds=3,
exam_failure_loss=0,
kiai_bonus=1,
)
@@ -64,6 +68,11 @@ def test_invalid_scenarios_are_rejected(
Scenario(exam, players, 2, 0, lineup)
def test_invalid_exam_loss_is_rejected() -> None:
with pytest.raises(ValueError, match="exam_failure_loss"):
Scenario("c", 4, 2, 0, LINEUP, exam_loss=-1)
def test_runs_are_reproducible_and_independent_of_worker_count() -> None:
scenarios = matrix(["none", "acd"], [3], [2], [0], [LINEUP])