Skip to content

Commit a920206

Browse files
committed
minor adjustments
1 parent 3bb097e commit a920206

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

codeclash/tournaments/ladder.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@ def __init__(
195195
self.config = config
196196
self.ladder = config["ladder"]
197197
self.player = config["player"]
198+
# CC:Ladder semantics REQUIRE push: True. Cross-rung carry-over (each rung continues from the
199+
# previous rung's codebase) is delivered by checking out the pushed branch; with push: False
200+
# every rung silently restarts from the starter template (no carry-over) and --resume is
201+
# impossible. Reject it loudly rather than produce a degenerate run.
202+
if not self.player.get("push"):
203+
raise ValueError(
204+
"CC:Ladder requires the player's `push: True`. With `push: False`, per-rung carry-over "
205+
"silently degrades to restarting every rung from the starter template (no hill-climb), "
206+
"and --resume cannot work. Set `push: True` in the player config."
207+
)
198208
self.rounds = config["tournament"]["rounds"]
199209
self.sims = config["game"]["sims_per_round"]
200210
self.min_round_wins, self.win_last_k = resolve_ladder_rules(config.get("ladder_rules", {}), self.rounds)

configs/ladder/ladder_rules.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
min_round_wins: 2
22
win_last_k: 0
3-
# Optional: stop a rung as soon as the climber has won `min_round_wins` rounds instead of playing
4-
# them all. Requires win_last_k == 0. Off by default. Uncomment to enable:
5-
# early_clinch: true
3+
# Stop a rung as soon as the climber has won `min_round_wins` rounds instead of playing them all.
4+
# Requires win_last_k == 0. Saves redundant post-clinch rounds; same "highest rung reached" metric.
5+
early_clinch: true
66
# Optional: skip playing a rung whose carried-over bot already dominates round 0 (faster eval,
77
# same "highest rung reached" metric). Off by default. Uncomment to enable:
88
# fast_forward:

0 commit comments

Comments
 (0)