SIM001

SIM001 › For developers › Making the executor better

The loop

The league runs generations, one after the other. In each generation, each strategy gives challengers. The league plays them all, and promotes the best one that passes. It writes all of it in the folder league.

There are three strategies. The evolution strategy (es) gives 8 challengers near a point of its own, at random. After each generation it moves the point to its two best challengers, also when none of them was promoted. Thus small gains add up until one challenger is clearly better than the champion. The Claude tuner (claude-tuner) reads the report of the last generation and gives new numbers, with its reasons. The Claude engineer (claude-engineer) changes the code of the executor or the tactics in a git worktree of its own.

The league does not trust what a strategy says. It runs the tests of the executor on the code of each Claude engineer, and refuses code that fails them. It refuses code that changes the safety envelope. A promoted change to the code goes on the branch league/champion. The league never merges it into master.

Each Claude run has a limit of money and a limit of time. The league stops a run when its time is up, and refuses its challenger. The league keeps a record of each Claude run: the prompt, what Claude said and the files that it wrote. The report of the generation gives the cost of each run.

Each generation is written down

If the league is new, type cargo run --release -p cognition_league -- run --generations 1 --strategies es. The file league/history.jsonl has 8 lines, one for each challenger. The file league/generations/001.md gives the scores of the generation. The file league/champion.json holds the tuning, the tactics and the hash of the champion.

If the league is new, type cargo run --release -p cognition_league -- run --generations 1 --strategies es. The file league/history.jsonl has 8 lines, one for each challenger. The file league/generations/001.md gives the scores of the generation. The file league/champion.json holds the tuning, the tactics and the hash of the champion.

See it in Your first league run.

The evolution strategy improves on a slow start

If the league is started from the slow executor, type cargo run --release -p cognition_league -- run --generations 5 --strategies es. On the same games, the mean score of the champion is at least 0.05 more than that of the slow executor.

If the league is started from the slow executor, type cargo run --release -p cognition_league -- run --generations 5 --strategies es. On the same games, the mean score of the champion is at least 0.05 more than that of the slow executor.

A challenger whose tests fail stays out

If the league is new, the Claude engineer changes the code of the executor, and cargo test -p cognition_executor fails in its worktree. The league says refused and the reason. The champion stays. The reason is tests fail.

If the league is new, the Claude engineer changes the code of the executor, and cargo test -p cognition_executor fails in its worktree. The league says refused and the reason. The champion stays. The reason is tests fail.

A challenger that changes the envelope stays out

If the league is new, the Claude engineer changes the safety envelope of the executor. The league says refused and the reason. The champion stays. The reason is envelope changed.

If the league is new, the Claude engineer changes the safety envelope of the executor. The league says refused and the reason. The champion stays. The reason is envelope changed.

A Claude run that does not stop in time is stopped

If the league is new, the Claude tuner does not stop before its time is up. Each Claude run gets 30 minutes, or the minutes that --claude-minutes gives. The league says refused and the reason. The champion stays. The reason is timed out.

If the league is new, the Claude tuner does not stop before its time is up. Each Claude run gets 30 minutes, or the minutes that --claude-minutes gives. The league says refused and the reason. The champion stays. The reason is timed out.

Each Claude run is written down

If the league is new, the Claude tuner writes new numbers in .league/candidates.json, and it spends $0.42. The report of the generation gives the cost, the turns and the time of the Claude run. The folder league/work/001/claude-tuner.run keeps the prompt, the output of Claude and the files that Claude wrote.

If the league is new, the Claude tuner writes new numbers in .league/candidates.json, and it spends $0.42. The report of the generation gives the cost, the turns and the time of the Claude run. The folder league/work/001/claude-tuner.run keeps the prompt, the output of Claude and the files that Claude wrote.