Skip to content

Commit 0d33d7a

Browse files
committed
Move logs/ to root, minor tweaks to mini config
1 parent 61c8ba6 commit 0d33d7a

6 files changed

Lines changed: 43 additions & 291 deletions

File tree

codeclash/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from codeclash import REPO_DIR
44

5-
DIR_LOGS = Path("logs") # this is used also for parts of the paths in the environment
6-
LOCAL_LOG_DIR = REPO_DIR / DIR_LOGS # this one is always relative to the location of this code
5+
DIR_LOGS = Path("/logs") # this is used also for parts of the paths in the environment
6+
LOCAL_LOG_DIR = REPO_DIR / "logs" # this one is always relative to the location of this code
77
DIR_WORK = Path("/testbed")
88
FILE_RESULTS = "results.json"
99
GH_ORG = "emagedoc"

codeclash/games/game.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __init__(self, config: dict, *, tournament_id: str, local_output_dir: Path,
9595
"game_id": tournament_id,
9696
"created_timestamp": int(time.time()),
9797
}
98-
self.log_env: Path = (DIR_WORK / DIR_LOGS).resolve()
98+
self.log_env: Path = DIR_LOGS
9999
self.log_local: Path = local_output_dir
100100
self.logger = get_logger(self.name, log_path=self.log_local / "game.log", emoji="🏓")
101101
self.environment: DockerEnvironment = self.get_environment()

codeclash/tournaments/pvp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from codeclash.agents import get_agent
1212
from codeclash.agents.player import Player
1313
from codeclash.agents.utils import GameContext
14-
from codeclash.constants import DIR_WORK, FILE_RESULTS
14+
from codeclash.constants import DIR_LOGS, DIR_WORK, FILE_RESULTS
1515
from codeclash.games import get_game
1616
from codeclash.games.game import CodeGame
1717
from codeclash.tournaments.tournament import AbstractTournament
@@ -106,7 +106,7 @@ def run_edit_phase(self, round_num: int) -> None:
106106
copy_to_container(
107107
agent.environment,
108108
self.game.log_local / "rounds" / str(round_num - 1),
109-
f"logs/rounds/{round_num - 1}/",
109+
DIR_LOGS / "rounds" / str(round_num - 1),
110110
)
111111

112112
with ThreadPoolExecutor() as executor:

configs/mini/default.yaml

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,41 @@ instance_template: |
2626
2727
## General tips about how to play the game
2828
29-
The details of the game are fully available within this codebase.
30-
- `docs/`: Game documentation
31-
- `logs/`: Past rounds and outcomes
32-
- `trajs/`: History of your edits
33-
- and a lot more. It's up to you to explore and utilize these resources.
34-
35-
The game is played in rounds and you will be evaluated on the performance over all the rounds. You won't remember past rounds.
36-
37-
In every round, you have a limit of {{step_limit}} steps and a cost limit of {{cost_limit}} dollars.
38-
We will show you the number of steps and cost used so far after every response in the `<limit_note>` tag.
39-
After you've reached the step or cost limit, you cannot continue working on this task, and we will play the game with your codebase.
40-
This means that it's fine to reach the step or cost limit while working on documentation or testing, but you shouldn't
41-
reach the limit while working on the actual game logic to avoid submitting an invalid codebase.
42-
43-
So if you want to carry knowledge forward — leave tools, notes, or strategies in the codebase.
44-
Good documentation means you (and others) can pick up right where you left off.
45-
46-
If you'd hate to repeat a step next round, encode it now — as a script, a note, or a tool.
47-
48-
Improve the bot however you like — experiment, document, iterate. Some ideas:
49-
- Build analysis tools
50-
- Create bot variants to test
51-
- Track strategies across rounds
52-
How you choose to evolve and document is up to you. Good luck!
29+
The game details are in this codebase ({{working_dir}}):
30+
- `docs/`: Game documentation
31+
- `/logs/`: Past rounds and outcomes (agent runs in `/logs/edits/`, gameplay logs in `/logs/rounds/`)
32+
33+
The game is played in team rounds. You play one round, then a teammate takes over.
34+
You're scored on total team performance across all rounds.
35+
36+
Each round has {{step_limit}} steps and {{cost_limit}} dollar limits.
37+
We show usage after each response in `<limit_note>` tags.
38+
After you've reached the step or cost limit, you cannot continue working on this task, and we will play the game with your codebase.
39+
We recommend submitting before you hit the limits to avoid losing work.
40+
41+
Each round starts fresh with no knowledge of previous actions.
42+
Leave tools, notes, and strategies in the codebase for teammates.
43+
Use README_agent.md at repository root to pass instructions to your next teammate.
44+
Document important files, analysis tools, and context.
45+
46+
Improve the bot however you like — experiment, document, iterate.
47+
48+
IMPORTANT: Store all changes in {{working_dir}} or subdirectories.
49+
50+
Tips:
51+
52+
1. Check README_agent.md for notes from previous teammates.
53+
2. Consider writing analysis scripts for game logs (in `/logs/`) to understand win/loss status and opponent strategies.
54+
Write analysis scripts and save them for teammates (mention in README_agent.md).
55+
3. You don't *have* to modify anything in your player code.
56+
For instance, if your team has been winning, and you think keeping the same strategy is best,
57+
feel free to just submit, or put more time towards adding analyses and documentation for your teammates.
58+
Of course, you can also try to improve your bot if you think you can do better.
59+
4. You can modify *any* part of the codebase, particularly if you think the code is impacting performance negatively.
60+
5. You could create tests to ensure your changes or bots are working as expected.
61+
6. Testing against previous versions can be helpful for making sure your changes are improvements.
62+
7. Examine game logic and documentation for clarity, but modifying game logic won't affect your rating.
63+
8. Remember `/logs/` is outside your working directory when writing analyses.
5364
5465
## Command Execution Rules
5566
@@ -146,6 +157,8 @@ instance_template: |
146157
EOF
147158
```
148159
160+
Note: You cannot combine this heredoc usage with other commands through the use of `&&` or `||`.
161+
149162
### Edit files with sed:
150163
151164
```bash

configs/mini/semi_prescriptive.yaml

Lines changed: 0 additions & 261 deletions
This file was deleted.

configs/scripts/generate_confs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def main(models, rounds, simulations, output: Path):
9393
{
9494
"agent": "mini",
9595
"name": get_name(p),
96-
"config": {"agent": IncludeTag("mini/semi_prescriptive.yaml"), "model": p},
96+
"config": {"agent": IncludeTag("mini/default.yaml"), "model": p},
9797
}
9898
for p in pair
9999
],

0 commit comments

Comments
 (0)