Runner¶
src/retrospeedlab/runner/ runs the search for every game of the collection, one turn after another, on the GPU server. It also starts the lab.
uv run python -m retrospeedlab.runner rotate src/retrospeedlab/runner/config.yaml
uv run python -m retrospeedlab.runner search <slug> <config>
uv run python -m retrospeedlab.runner power-on src/retrospeedlab/runner/config.yaml
uv run python -m retrospeedlab.runner lab src/retrospeedlab/runner/config.yaml
uv run python -m retrospeedlab.runner lab-game src/retrospeedlab/runner/config.yaml comet_courier
| Command | What it does |
|---|---|
rotate |
Takes turns forever; the runner app's main process |
search |
Searches one game until stopped |
power-on |
Powers on every game and plays 300 frames of its action table; a failure stops the deploy |
lab |
Starts a lab session on the most stagnant game |
lab-game |
Starts a lab session on the game you name |
The rotation¶
Turns follow the clock: with turn_minutes: 120, turn t is the current two-hour block. The cycle is every game in collection order plus one Best runs position, and the turn's lineup is the slots entries starting at position t.
- Slot 1 is on stream, unless the backend features another game of the turn. When Best runs is in slot 1, the stream replays verified records while the other games search off stream.
- The first
policy_slotsslots train the PPO policy on the GPU beside their search. - Each turn writes every game's configuration, starts one search process per game and restarts one that stops, up to
search_restartstimes. A game that keeps crashing raises an alert and waits for its next turn. - The schedule of the coming turns goes to the backend, so the stream can show what is next.
The rotation needs the h264_nvenc encoder, so it refuses to start without an NVIDIA GPU.
The search bandit¶
With bandit.enabled, each game's turn asks the lake for its worker shares: a Thompson-sampling bandit over the worker kinds (scouts, backtrackers, beam scouts, vision scouts, polishers) learns which kind saves the most frames per worker-second. The runner splits its worker total by those shares and keeps at least one worker of every kind. A deterministic hash puts holdout (20 %) of the game-turns on the static split, so the lake can measure whether the bandit helps. Each turn's arm and workers go to Kafka as runs.allocations.
The lab¶
Every third day at 01:35 UTC the lab job picks the most stagnant game: games without a record first, then the one that has gone longest without progress while on turn, at least stagnant_hours. It then:
- clones the public repository as the unprivileged
agentuser and runs a Claude Code session, also asagent, on the game's package forminutes, with a team of scout, researcher, engineer and verifier subagents and a wrap-up at the end; - keeps only commits that touch
src/retrospeedlab/games/andtests/games/; - rebases them on
main, runs every check inlab.checksand replays the movie from power-on; - only when all of that passes, pushes them to a branch
lab/<slug>-<stamp>and opens a pull request with the run's report that auto-merges (squash) once CI passes, then searches the game's barred states again.
The session itself can never push: the runner fetches the session's commits as a bundle and pushes from its own repository with GITHUB_TOKEN, a fine-grained token for the suite (Contents and Pull requests: read and write) that the agent never sees. Its outcome (notes only, rejected or deployed), its reports and its timeline go to the backend and to Kafka as lab.events.
Configuration¶
runner/config.yaml holds the rotation (turn_minutes, slots, policy_slots, search_restarts), the search settings each game's configuration is built from, the bandit (enabled, holdout) and the lab (model, minutes, wrap_up_minutes, check_minutes, stagnant_hours, checks). The runner image is deploy/runner/Dockerfile.