Skip to content

Commit 42a6013

Browse files
author
yolo h8cker 93
committed
Enh(matrix): Avoid copying logs, you'll run out of space
1 parent d3bcca7 commit 42a6013

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

codeclash/analysis/matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def _evaluate_matrix_cell_parallel(
207207
self.logger.info(f"Evaluating {player1_name} round {i} vs {player2_name} round {j}")
208208

209209
round_id = str(uuid.uuid4().hex)
210-
stats = game_worker.run_round([agent1, agent2], round_id)
210+
stats = game_worker.run_round([agent1, agent2], round_id, copy_logs=False)
211211
result = stats.to_dict()
212212
self.logger.debug(f"Result: {result}")
213213

codeclash/games/game.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def _pre_round_setup(self, agents: list[Player]):
226226
logger=self.logger,
227227
)
228228

229-
def run_round(self, agents: list[Player], round_num: int) -> RoundStats:
229+
def run_round(self, agents: list[Player], round_num: int, *, copy_logs: bool = True) -> RoundStats:
230230
"""
231231
Run a single round of the game with the given agents.
232232
@@ -252,7 +252,8 @@ def run_round(self, agents: list[Player], round_num: int) -> RoundStats:
252252
if len(validated) > 1:
253253
self._pre_round_setup(validated)
254254
self.execute_round(validated)
255-
self.copy_logs_from_env(round_num)
255+
if copy_logs:
256+
self.copy_logs_from_env(round_num)
256257
self.get_results(validated, round_num, stats)
257258
elif len(validated) == 1:
258259
self.logger.info(f"Only one valid agent ({validated[0].name}), automatic win")

0 commit comments

Comments
 (0)