Skip to content

Commit 790ccd4

Browse files
committed
Add sim_concurrency arg, battlesnake ladder
1 parent 2232248 commit 790ccd4

12 files changed

Lines changed: 152 additions & 34 deletions

File tree

codeclash/arenas/battlecode23/battlecode23.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def execute_round(self, agents: list[Player]):
238238
# Filter to only compiled agents' classes
239239
valid_classes = {name: path for name, path in agent_classes.items() if path is not None}
240240

241-
with ThreadPoolExecutor(5) as executor:
241+
with ThreadPoolExecutor(self.game_config.get("sim_concurrency", 5)) as executor:
242242
futures = [executor.submit(self._run_simulation, sim, agents, valid_classes) for sim in simulations]
243243
for future in tqdm(as_completed(futures), total=len(futures), desc="Simulations"):
244244
try:

codeclash/arenas/battlecode24/battlecode24.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def execute_round(self, agents: list[Player]):
238238
# Filter to only compiled agents' classes
239239
valid_classes = {name: path for name, path in agent_classes.items() if path is not None}
240240

241-
with ThreadPoolExecutor(5) as executor:
241+
with ThreadPoolExecutor(self.game_config.get("sim_concurrency", 5)) as executor:
242242
futures = [executor.submit(self._run_simulation, sim, agents, valid_classes) for sim in simulations]
243243
for future in tqdm(as_completed(futures), total=len(futures), desc="Simulations"):
244244
try:

codeclash/arenas/battlecode25/battlecode25.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def execute_round(self, agents: list[Player]):
5454
cmd = f"{self.run_cmd_round} {' '.join(args)}"
5555
self.logger.info(f"Running game: {cmd}")
5656

57-
with ThreadPoolExecutor(5) as executor:
57+
with ThreadPoolExecutor(self.game_config.get("sim_concurrency", 5)) as executor:
5858
# Submit all simulations to the thread pool
5959
futures = [
6060
executor.submit(self._run_single_simulation, agents, idx, cmd)

codeclash/arenas/bridge/bridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def execute_round(self, agents: list[Player]):
9494
cmd = f"{self.run_cmd} {shlex.join(agent_paths)}"
9595

9696
# Run simulations in parallel
97-
with ThreadPoolExecutor(max_workers=8) as executor:
97+
with ThreadPoolExecutor(max_workers=self.game_config.get("sim_concurrency", 8)) as executor:
9898
futures = [
9999
executor.submit(self._run_single_simulation, agents, idx, f"{cmd} --seed {idx} --dealer {idx % 4}")
100100
for idx in range(sims)

codeclash/arenas/chess/chess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def execute_round(self, agents: list[Player]):
224224

225225
# Run matches in parallel
226226
self.logger.info(f"Running {len(pairings)} matches in parallel...")
227-
with ThreadPoolExecutor(max_workers=min(20, len(pairings))) as executor:
227+
with ThreadPoolExecutor(max_workers=min(self.game_config.get("sim_concurrency", 20), len(pairings))) as executor:
228228
futures = [
229229
executor.submit(
230230
self._run_single_match,

codeclash/arenas/corewar/corewar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _run_single_simulation(self, agents: list[Player], idx: int):
4040
assert response["returncode"] == 0, response
4141

4242
def execute_round(self, agents: list[Player]):
43-
with ThreadPoolExecutor(4) as executor:
43+
with ThreadPoolExecutor(self.game_config.get("sim_concurrency", 4)) as executor:
4444
futures = [executor.submit(self._run_single_simulation, agents, idx) for idx in range(len(agents))]
4545
for future in as_completed(futures):
4646
future.result()

codeclash/arenas/halite/halite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def execute_round(self, agents: list[Player]):
9090
entries.append(executable)
9191
cmd = f"{self.run_cmd_round} {shlex.join(entries)}"
9292
self.logger.info(f"Running game: {cmd}")
93-
with ThreadPoolExecutor(20) as executor:
93+
with ThreadPoolExecutor(self.game_config.get("sim_concurrency", 20)) as executor:
9494
futures = [
9595
executor.submit(self._run_single_simulation, agents, idx, cmd)
9696
for idx in range(self.game_config["sims_per_round"])

codeclash/arenas/robocode/robocode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def execute_round(self, agents: list[Player]):
113113
# Run battle with results output to file
114114
cmd = f"{self.run_cmd_round} -battle {battle_file}"
115115
self.logger.info(f"Running game: {cmd}")
116-
with ThreadPoolExecutor(5) as executor:
116+
with ThreadPoolExecutor(self.game_config.get("sim_concurrency", 5)) as executor:
117117
# Submit all simulations to the thread pool
118118
futures = [
119119
executor.submit(self._run_single_simulation, agents, idx, cmd)

codeclash/arenas/robotrumble/robotrumble.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def execute_round(self, agents: list[Player]):
6363
cmd = f"{self.run_cmd_round} {shlex.join(args)}"
6464
self.logger.info(f"Running game: {cmd}")
6565

66-
with ThreadPoolExecutor(8) as executor:
66+
with ThreadPoolExecutor(self.game_config.get("sim_concurrency", 8)) as executor:
6767
# Submit all simulations to the thread pool
6868
futures = [
6969
executor.submit(self._run_single_simulation, agents, idx, cmd)
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# CC:Ladder for BattleSnake — the ranked ladder of human bots (worst opponent first,
2+
# strongest last), derived from the round-robin in make_battlesnake.yaml
3+
# (Bradley-Terry/Elo over 1225 pairwise tournaments). An LM climber ascends rung by
4+
# rung until it loses. Run: uv run codeclash ladder run configs/ablations/ladder/battlesnake.yaml
5+
tournament:
6+
rounds: 5
7+
game:
8+
name: BattleSnake
9+
sims_per_round: 250
10+
args:
11+
width: 11
12+
height: 11
13+
browser: false
14+
player:
15+
agent: mini
16+
name: claude-sonnet-4-5-20250929
17+
branch_init: human/pambrose/pambrose-kotlin
18+
config:
19+
agent: !include mini/default.yaml
20+
model:
21+
model_name: anthropic/claude-sonnet-4-5-20250929
22+
model_kwargs:
23+
temperature: 0.2
24+
max_tokens: 4096
25+
push: True
26+
prompts:
27+
game_description: |-
28+
BattleSnake ladder
29+
ladder:
30+
- agent: dummy
31+
branch_init: human/pambrose/pambrose-kotlin
32+
- agent: dummy
33+
branch_init: human/Nettogrof/nessegrev-julia
34+
- agent: dummy
35+
branch_init: human/Nettogrof/nessegrev-java
36+
- agent: dummy
37+
branch_init: human/csauve/bookworm
38+
- agent: dummy
39+
branch_init: human/coreyja/improbable-irene
40+
- agent: dummy
41+
branch_init: human/graeme-hill/snakebot
42+
- agent: dummy
43+
branch_init: human/coreyja/devious-devin
44+
- agent: dummy
45+
branch_init: human/m-schier/kreuzotter
46+
- agent: dummy
47+
branch_init: human/nbw/nbw-crystal
48+
- agent: dummy
49+
branch_init: human/Xe/since
50+
- agent: dummy
51+
branch_init: human/ccSnake2018/ccsnake
52+
- agent: dummy
53+
branch_init: human/coreyja/bombastic-bob
54+
- agent: dummy
55+
branch_init: human/coreyja/coreyja-rs
56+
- agent: dummy
57+
branch_init: human/coreyja/jump-flooding
58+
- agent: dummy
59+
branch_init: human/zacpez/scape-goat
60+
- agent: dummy
61+
branch_init: human/tim-hub/awesome-snake
62+
- agent: dummy
63+
branch_init: human/rdbrck/btas
64+
- agent: dummy
65+
branch_init: human/Spenca/vulture-snake
66+
- agent: dummy
67+
branch_init: human/moxuz/pinky-snek
68+
- agent: dummy
69+
branch_init: human/coreyja/amphibious-arthur
70+
- agent: dummy
71+
branch_init: human/OliverMKing/astar-snake
72+
- agent: dummy
73+
branch_init: human/nbw/nbw-ruby
74+
- agent: dummy
75+
branch_init: human/coreyja/eremetic-eric
76+
- agent: dummy
77+
branch_init: human/coreyja/gigantic-george
78+
- agent: dummy
79+
branch_init: human/Flipez/flipez-crystal
80+
- agent: dummy
81+
branch_init: human/jackisherwood/battlesnake-elon
82+
- agent: dummy
83+
branch_init: human/MorganConrad/tantilla
84+
- agent: dummy
85+
branch_init: human/ChaelCodes/cornelius
86+
- agent: dummy
87+
branch_init: human/joshhartmann11/battlejake2019
88+
- agent: dummy
89+
branch_init: human/coreyja/famished-frank
90+
- agent: dummy
91+
branch_init: human/kentmacdonald2/beames
92+
- agent: dummy
93+
branch_init: human/TheApX/hungry
94+
- agent: dummy
95+
branch_init: human/xtagon/nagini
96+
- agent: dummy
97+
branch_init: human/joshhartmann11/battlejake
98+
- agent: dummy
99+
branch_init: human/tyrelh/tyrelh-python
100+
- agent: dummy
101+
branch_init: human/zakwht/zakwht-2018
102+
- agent: dummy
103+
branch_init: human/rdbrck/bountysnake2018
104+
- agent: dummy
105+
branch_init: human/JerryKott/jerrykott-2017
106+
- agent: dummy
107+
branch_init: human/altersaddle/untimely-neglected-wearable
108+
- agent: dummy
109+
branch_init: human/MorganConrad/sisiutl
110+
- agent: dummy
111+
branch_init: human/tyrelh/tyrelh-2018
112+
- agent: dummy
113+
branch_init: human/noahspriggs/tr-8r
114+
- agent: dummy
115+
branch_init: human/woofers/woofers-java
116+
- agent: dummy
117+
branch_init: human/Petah/project-z
118+
- agent: dummy
119+
branch_init: human/tbgiles/feisty-snake
120+
- agent: dummy
121+
branch_init: human/hirethissnake/sneaky-snake
122+
- agent: dummy
123+
branch_init: human/aleksiy325/snek-two
124+
- agent: dummy
125+
branch_init: human/tyrelh/tyrelh-2019
126+
- agent: dummy
127+
branch_init: human/jhawthorn/snek
128+
- agent: dummy
129+
branch_init: human/smallsco/robosnake

0 commit comments

Comments
 (0)