Methodology

How the environment, learner and self-play fit together, and what they produced.

16 min read

How our bots are trained: the ideas we borrowed, the code that does the training, the results so far, and how training was made faster. New to RL? Read the ML primer first.

Prior art#

Two community references shaped the design. We read them for ideas and constants; neither is run as code. More on both: External projects.

Necto#

The community bot that won the RLBot Championship 2022; its successor Nexto is in the same repo (.external/Necto @ 2e6ed7d). It trained by PPO with self-play in the real game, on many distributed workers, with an attention network over every car, the ball and the boost pads.

  • We took: the 90-action table, past-version opponents 20% of the time, its random, kickoff-like and goalie starting states, the score-difference clip, the team goal reward of 10, and team spirit.

  • We didn't take: the attention network (we use a plain MLP), distributed real-game workers (RocketSim runs in-process), replay starting states (no dataset), or its reward. Its flip-reset detector is noted for mechanics work.

  • As opponents: Necto's and Nexto's released models now play inside our environment (results).

Lucy-SKG#

A 2023 paper (Moschopoulos et al., arXiv:2305.15801) that kept Necto's network and PPO and redesigned the reward. At 1 B steps each, its bot beat Necto 300–54 and Nexto 300–4 in single-goal 2v2 games.

Its main ideas: rewards that multiply their parts (KRC), parameterised distance rewards, potential-based shaping, a smaller observation with the last 5 actions, and two auxiliary prediction tasks. We implemented almost all of them and A/B-tested each rather than taking it on faith:

IdeaResult here
The paper's reward tableReached 0.8 vs ball_chaser in half the steps of a simple dense reward (52.4 M vs 104.9 M), and won 0.76–0.79 head to head
Potential shapingWorks as the math predicts (tested on real episodes)
Last 5 actions in the observationNo measurable difference (0.510 head to head)
Reward-prediction auxiliary taskBroke 1v1 training (0.002 head to head); off by default
State-representation auxiliary taskNo difference, 1.8× update time; off by default
Half-life discounting, starting states (no replays), end conditionsImplemented as in the paper

Not adopted: the attention network, device-alternating PPO and the paper's Win % metric. Every item with its tests: Lucy-SKG coverage.

The training stack#

  • the environment: RocketSim arenas stepped in batches (Rust)
    • src/batch.rs BatchEnv: many arenas on a thread pool, auto-reset
    • src/env.rs single-agent episodes: reset, step, success/failure, export
    • src/match_env.rs match episodes: every car an agent, end conditions, team spirit
    • src/task.rs the task-file schema and its validation
    • src/obs.rs / action.rs observation layouts and the 90-action table
    • src/reward.rs / events.rs reward terms; touch, shot, goal and demo events
    • src/setters.rs match starting states (kickoff, kickoff-like, random, goalie, aerial)
    • src/seeds.rs separate training and evaluation seeds
    • src/scripted.rs ball_chaser, idle, random baselines
  • crates/rlenv-py/ Python bindings, built as physlab_rl._native
  • the learner (PyTorch, uv)
    • ppo.py PPO, rollout buffer, GAE, optional auxiliary heads
    • train.py the training loop and CLI
    • selfplay.py opponent pool and batched frozen-policy inference
    • evaluate.py / ratings.py / league.py held-out evaluation, ratings, round robins
    • manifest.py / checkpoint.py run records and checkpoints
    • runs_table.py / watch.py run tables for A/B tests, live RLViser view
  • tasks/ training task files (JSON)
  • runs/ run outputs (gitignored)

Environment (crates/rlenv)#

BatchEnv steps many independent RocketSim arenas per call, in parallel on all CPU threads.

  • Deterministic. An episode depends only on its task file, seed and actions; results are identical for any thread count.

  • Separate seeds. Evaluation seeds have bit 63 set and training seeds never do, so training never sees an evaluation episode.

  • Events come from physics. A touch is RocketSim's CarHitBall event, never a distance check.

  • Every episode is a scenario. Any episode can be exported and replayed exactly with physlab run, demolitions included.

  • Two task kinds. Single-agent tasks have one car and a success test. Match tasks run 1v1 to 3v3 with every car an agent, and end at the first goal or a timeout. Each car sees the field rotated so it attacks +Y.

  • No input latency. An action applies from the next tick, which keeps exports replayable. A bot run through RLBot would see one tick more.

Details: Environment conventions, Match mode.

Task files#

A task is a JSON file in tasks/. Unknown fields are rejected and every shipped task is tested. A trimmed example, the last stage of the single-agent curriculum:

json
{
  "task_schema_version": 1,
  "id": "aerial-touch-v1",
  "tick_skip": 8,
  "episode_seconds": 5,
  "obs": { "action_stack": 5 },
  "initializer": {
    "car": { "position_uu": [[-2000, 2000], [-3000, 3000], [17, 17]],
             "yaw_rad": [-3.14159265, 3.14159265], "boost": [50, 100] },
    "ball": {
      "placement": { "kind": "near_car", "distance_uu": [600, 1600],
                     "bearing_rad": [-3.14159265, 3.14159265], "z_uu": [500, 1200] },
      "linear_velocity_uu_s": [[-250, 250], [-250, 250], [200, 500]]
    }
  },
  "success": { "kind": "touch", "min_ball_z_uu": 250, "require_car_airborne": true },
  "failure": { "ball_hits_ground": true },
  "utilities": { "approach": { "krc": ["face_ball", "distance_to_ball", "velocity_to_ball"] } },
  "rewards": { "success": 10, "failure": -2, "time": -0.01 },
  "potentials": { "approach": 2.0 },
  "shaping_gamma": 1.0,
  "eval": { "seed_base": 3000000, "episodes": 256 }
}
TaskKindPurpose
ground-touch-v1single agentCurriculum stage 0: touch a resting ball
aerial-touch-easy-v1, aerial-touch-v1single agentCurriculum stages 1–2: touch a rising ball in the air before it lands
ground-touch-dense-v1, ground-touch-nostack-v1single agentA/B variants
match-1v1-v1, match-2v2-v1matchThe full Lucy-SKG reward
match-1v1-simple-v1, match-1v1-nostack-v1matchA/B variants: simple reward; no action stack

All fields: Task file format.

Learner (python/physlab_rl)#

PPO over the 90 actions, in the style of CleanRL. The Python bindings release the GIL and copy into fresh numpy arrays; through Python the environment still runs about 1.44 M steps/s.

SettingSingle-agentMatch
Steps per update131,072 (4096 envs × 32)131,072 (4096 car rows × 32)
Minibatches × epochs8 × 48 × 3
Networkactor and critic MLPs, 256-256512-512-256 (0.93 M parameters, 1v1)
Learning rate3e-4, annealed2e-4, constant (self-play has no natural end)
Discount half-lifescales with episode length, 1.5–4 s5 s (1v1), 10 s (2v2)
GAE λ, clip, entropy, value coef.0.95, 0.2, 0.01, 0.5same

Untuned; the source of every value is in Defaults and their sources.

The training loop#

just train / just train-match (python -m physlab_rl.train):

  1. Set up: load the task, build the environment on all CPU threads, write the run record (manifest), seed every random generator.

  2. Play 32 steps in every game. The learner picks actions on the GPU; frozen past versions run in one batched pass; scripted bots run in Rust.

  3. Score each step's advantage, separately per car, adding the critic's estimate where a time limit cut an episode short.

  4. Update the policy with PPO, on the learner's own cars only.

  5. Log one line to metrics.jsonl per update.

  6. Every so often: save a past version into the opponent pool (every 10 M steps), evaluate on held-out seeds and refit ratings (about every 21 M steps for matches), and checkpoint.

  7. Stop at --total-steps, at --target-eval-success, or when a STOP file appears in the run directory. The final evaluation and checkpoint are still written.

A test (python/tests/test_selfplay.py) checks the learner's stored data against what the environment actually did, at every update.

Self-play and the opponent pool#

One policy drives every car. Blue is always the learner. Each episode, Orange is:

  • a frozen past version with probability 0.2;

  • the scripted ball_chaser with probability --opponent-scripted-prob (default 0);

  • otherwise the learner itself, so both cars produce training data.

The pool keeps 20 past versions, one every 10 M steps, picked with weight 0.9^age (recent ones more often, not by rating). All of them run in one batched pass, which cut opponent inference from 0.50 s to 0.16 s per update with 6 in play. A warm start (--init-checkpoint) carries the pool over. In the main run, 90.3% of samples were the learner's. Details: Self-play learner.

Evaluation and ratings#

  • Single-agent tasks: all 256 held-out seeds, best action each step, success rate with a Wilson 95% interval.

  • Match tasks: single-goal games from held-out kickoffs. Win = Blue scores, loss = Orange scores, draw = timeout. Actions are sampled with a fixed seed; with the best action on both sides, each of the 5 kickoff spots would replay the same game.

  • Opponents: ball_chaser, Necto and Nexto (--eval-bots, on by default), and earlier checkpoints 1, 2, 4, 8 and 16 evaluations back.

  • Ratings: Bradley–Terry on the Elo scale over every game, ball_chaser fixed at 1000. just league-match runs a round robin over a run's checkpoints afterwards.

Results and caveats: Bot standings.

A run, end to end#

The main 1v1 run (runs/selfplay/main-1v1-s11/):

sh
python -m physlab_rl.train --task tasks/match-1v1-v1.json --total-steps 1_500_000_000 \
    --eval-every 80 --seed 11 --run-dir runs/selfplay/main-1v1-s11      # STOP file at 90 min
python -m physlab_rl.league runs/selfplay/main-1v1-s11 --every 10 --episodes 128
python -m physlab_rl.evaluate runs/selfplay/main-1v1-s11/final.pt --opponents ball_chaser idle \
    runs/selfplay/main-1v1-s11/checkpoints/step_{104857600,524288000,838860800,943718400}.pt \
    --export 1
FileContents
manifest.jsonWritten before training, then read-only: command line, a hash of all source code (the repo has no commits yet), the task, every setting, seeds, library versions, GPU state
metrics.jsonlOne line per update, evaluation and rating refit (Telemetry)
checkpoints/step_<n>.pt, best.pt, final.ptModel, optimiser and normaliser state, config, task, random-generator states
pool/, pool.json, ratings.jsonPast versions and the rating table
summary.jsonStop reason, steps, wall time, final evaluation, steps to 0.5/0.8/0.9
eval/, eval_scenarios/Standalone evaluations and exported games (as scenarios)
league/The round robin's results and ratings

The local Command Center shows all of this live, for every run.

Results so far#

Single-agent curriculum#

Held-out success on 256 seeds, seed 1, each stage starting from the previous stage's best checkpoint (runs/t1/):

StageTaskStepsWallSteps to 50 / 80 / 90 / 95%Final held-out success
0ground-touch-v1 (from scratch)19.9 M1.2 min2.6 / 2.6 / 3.3 / 3.3 M256/256 [0.985, 1.000]
1aerial-touch-easy-v187.7 M4.7 min15.7 / 18.4 / 18.4 / 21.0 M256/256 [0.985, 1.000]
2aerial-touch-v1499.9 M27.1 min5.2 / 18.4 / 138.9 / 191.4 M246/256 = 0.961 [0.930, 0.979]
aerial-touch-v1: held-out success and 95% CI
runs/t1/20261015-054625-aerial-touch-v1-s1-stage2/metrics.jsonl, snapshotted when the site was built
  • eval/success_ratelast 0.961
  • eval/ci95_lolast 0.93
  • eval/ci95_hilast 0.979
00.20.40.60.810100M200M300M400MAgent stepsAgent steps: 7.86M eval/success_rate: 0.73 eval/ci95_lo: 0.673 eval/ci95_hi: 0.781Agent steps: 23.6M eval/success_rate: 0.813 eval/ci95_lo: 0.76 eval/ci95_hi: 0.856Agent steps: 39.3M eval/success_rate: 0.844 eval/ci95_lo: 0.794 eval/ci95_hi: 0.883Agent steps: 55M eval/success_rate: 0.855 eval/ci95_lo: 0.807 eval/ci95_hi: 0.893Agent steps: 70.8M eval/success_rate: 0.867 eval/ci95_lo: 0.82 eval/ci95_hi: 0.903Agent steps: 86.5M eval/success_rate: 0.875 eval/ci95_lo: 0.829 eval/ci95_hi: 0.91Agent steps: 102M eval/success_rate: 0.863 eval/ci95_lo: 0.816 eval/ci95_hi: 0.9Agent steps: 118M eval/success_rate: 0.875 eval/ci95_lo: 0.829 eval/ci95_hi: 0.91Agent steps: 134M eval/success_rate: 0.875 eval/ci95_lo: 0.829 eval/ci95_hi: 0.91Agent steps: 149M eval/success_rate: 0.918 eval/ci95_lo: 0.878 eval/ci95_hi: 0.946Agent steps: 165M eval/success_rate: 0.934 eval/ci95_lo: 0.896 eval/ci95_hi: 0.958Agent steps: 181M eval/success_rate: 0.934 eval/ci95_lo: 0.896 eval/ci95_hi: 0.958Agent steps: 194M eval/success_rate: 0.957 eval/ci95_lo: 0.925 eval/ci95_hi: 0.976Agent steps: 210M eval/success_rate: 0.953 eval/ci95_lo: 0.92 eval/ci95_hi: 0.973Agent steps: 225M eval/success_rate: 0.953 eval/ci95_lo: 0.92 eval/ci95_hi: 0.973Agent steps: 241M eval/success_rate: 0.961 eval/ci95_lo: 0.93 eval/ci95_hi: 0.979Agent steps: 257M eval/success_rate: 0.965 eval/ci95_lo: 0.935 eval/ci95_hi: 0.981Agent steps: 273M eval/success_rate: 0.961 eval/ci95_lo: 0.93 eval/ci95_hi: 0.979Agent steps: 288M eval/success_rate: 0.961 eval/ci95_lo: 0.93 eval/ci95_hi: 0.979Agent steps: 304M eval/success_rate: 0.961 eval/ci95_lo: 0.93 eval/ci95_hi: 0.979Agent steps: 320M eval/success_rate: 0.961 eval/ci95_lo: 0.93 eval/ci95_hi: 0.979Agent steps: 336M eval/success_rate: 0.961 eval/ci95_lo: 0.93 eval/ci95_hi: 0.979Agent steps: 351M eval/success_rate: 0.961 eval/ci95_lo: 0.93 eval/ci95_hi: 0.979Agent steps: 367M eval/success_rate: 0.957 eval/ci95_lo: 0.925 eval/ci95_hi: 0.976Agent steps: 383M eval/success_rate: 0.961 eval/ci95_lo: 0.93 eval/ci95_hi: 0.979Agent steps: 398M eval/success_rate: 0.965 eval/ci95_lo: 0.935 eval/ci95_hi: 0.981Agent steps: 414M eval/success_rate: 0.965 eval/ci95_lo: 0.935 eval/ci95_hi: 0.981Agent steps: 430M eval/success_rate: 0.957 eval/ci95_lo: 0.925 eval/ci95_hi: 0.976Agent steps: 446M eval/success_rate: 0.961 eval/ci95_lo: 0.93 eval/ci95_hi: 0.979Agent steps: 461M eval/success_rate: 0.961 eval/ci95_lo: 0.93 eval/ci95_hi: 0.979Agent steps: 477M eval/success_rate: 0.957 eval/ci95_lo: 0.925 eval/ci95_hi: 0.976Agent steps: 493M eval/success_rate: 0.965 eval/ci95_lo: 0.935 eval/ci95_hi: 0.981
Data
SeriesSteps rangeFirstLastMinMaxPoints
eval/success_rate2.62M – 500M0.4690.9610.4690.965191
eval/ci95_lo2.62M – 500M0.4090.930.4090.935191
eval/ci95_hi2.62M – 500M0.530.9790.530.981191

The remaining failures are mostly balls behind the car or low and slowly rising; some may be impossible. More: Capabilities.

Main 1v1 self-play run#

runs/selfplay/main-1v1-s11/: the full Lucy-SKG reward, seed 11, stopped at 90 minutes.

  • Scale: 1.024 B steps in 90 minutes, 189.6 k steps/s including evaluations.

  • Healthy: no NaNs in 7,809 updates; entropy fell from 4.50 to 2.84 and stayed stable.

  • Behaviour: touches took off at 25–35 M steps and levelled at about 60 per car-minute by 200 M. Shots kept rising, from 4.0 to 10.1 per car-minute between 105 M and 1024 M.

  • Final bot (256 held-out kickoffs): 241/0/15 vs ball_chaser (0.941 [0.906, 0.964]); 0.949, 0.641 and 0.537 against its own 105 M, 524 M and 943 M checkpoints.

  • League: ratings rose from 830 to 1669 over 11 checkpoints and 7,040 games.

Main run: score vs ball_chaser (128 held-out kickoffs per evaluation)
runs/selfplay/main-1v1-s11/metrics.jsonl, snapshotted when the site was built
00.20.40.60.810200M400M600M800M1BAgent stepsAgent steps: 21M eval/ball_chaser/score: 0.488Agent steps: 52.4M eval/ball_chaser/score: 0.82Agent steps: 83.9M eval/ball_chaser/score: 0.961Agent steps: 115M eval/ball_chaser/score: 0.984Agent steps: 147M eval/ball_chaser/score: 0.977Agent steps: 178M eval/ball_chaser/score: 0.922Agent steps: 210M eval/ball_chaser/score: 0.922Agent steps: 241M eval/ball_chaser/score: 0.93Agent steps: 273M eval/ball_chaser/score: 0.922Agent steps: 304M eval/ball_chaser/score: 0.914Agent steps: 336M eval/ball_chaser/score: 0.859Agent steps: 367M eval/ball_chaser/score: 0.938Agent steps: 398M eval/ball_chaser/score: 0.914Agent steps: 430M eval/ball_chaser/score: 0.914Agent steps: 461M eval/ball_chaser/score: 0.875Agent steps: 493M eval/ball_chaser/score: 0.914Agent steps: 524M eval/ball_chaser/score: 0.938Agent steps: 556M eval/ball_chaser/score: 0.922Agent steps: 587M eval/ball_chaser/score: 0.922Agent steps: 619M eval/ball_chaser/score: 0.945Agent steps: 661M eval/ball_chaser/score: 0.953Agent steps: 692M eval/ball_chaser/score: 0.961Agent steps: 724M eval/ball_chaser/score: 0.977Agent steps: 755M eval/ball_chaser/score: 0.977Agent steps: 786M eval/ball_chaser/score: 0.961Agent steps: 818M eval/ball_chaser/score: 0.953Agent steps: 849M eval/ball_chaser/score: 0.922Agent steps: 881M eval/ball_chaser/score: 0.938Agent steps: 912M eval/ball_chaser/score: 0.977Agent steps: 944M eval/ball_chaser/score: 0.953Agent steps: 975M eval/ball_chaser/score: 0.938Agent steps: 1.01B eval/ball_chaser/score: 0.969

eval/ball_chaser/score, last 0.961

Data
SeriesSteps rangeFirstLastMinMaxPoints
eval/ball_chaser/score10.5M – 1.02B0.4380.9610.4380.99298
Main run: touch steps and shots per car-minute (training episodes)
runs/selfplay/main-1v1-s11/metrics.jsonl, snapshotted when the site was built
  • match/touch_steps_per_car_minutelast 59.3
  • match/shots_per_car_minutelast 10.1
0102030405060700200M400M600M800M1BAgent stepsAgent steps: 14M match/touch_steps_per_car_minute: 0.398 match/shots_per_car_minute: 0.00248Agent steps: 47.6M match/touch_steps_per_car_minute: 21.3 match/shots_per_car_minute: 1.44Agent steps: 79.2M match/touch_steps_per_car_minute: 36.9 match/shots_per_car_minute: 3.67Agent steps: 114M match/touch_steps_per_car_minute: 50.4 match/shots_per_car_minute: 3.91Agent steps: 144M match/touch_steps_per_car_minute: 51.6 match/shots_per_car_minute: 4.28Agent steps: 178M match/touch_steps_per_car_minute: 55.6 match/shots_per_car_minute: 4.08Agent steps: 207M match/touch_steps_per_car_minute: 63.6 match/shots_per_car_minute: 5.21Agent steps: 237M match/touch_steps_per_car_minute: 60.6 match/shots_per_car_minute: 5.71Agent steps: 272M match/touch_steps_per_car_minute: 63.5 match/shots_per_car_minute: 4.41Agent steps: 303M match/touch_steps_per_car_minute: 57.6 match/shots_per_car_minute: 6.37Agent steps: 335M match/touch_steps_per_car_minute: 60.3 match/shots_per_car_minute: 7.2Agent steps: 366M match/touch_steps_per_car_minute: 68.1 match/shots_per_car_minute: 7.73Agent steps: 398M match/touch_steps_per_car_minute: 64.7 match/shots_per_car_minute: 7.21Agent steps: 430M match/touch_steps_per_car_minute: 61.8 match/shots_per_car_minute: 8.27Agent steps: 463M match/touch_steps_per_car_minute: 60.4 match/shots_per_car_minute: 7.78Agent steps: 497M match/touch_steps_per_car_minute: 61.8 match/shots_per_car_minute: 8.03Agent steps: 527M match/touch_steps_per_car_minute: 62.1 match/shots_per_car_minute: 7.28Agent steps: 560M match/touch_steps_per_car_minute: 58.4 match/shots_per_car_minute: 7.1Agent steps: 592M match/touch_steps_per_car_minute: 61.5 match/shots_per_car_minute: 8.15Agent steps: 624M match/touch_steps_per_car_minute: 59.7 match/shots_per_car_minute: 8.01Agent steps: 654M match/touch_steps_per_car_minute: 58.6 match/shots_per_car_minute: 8.57Agent steps: 689M match/touch_steps_per_car_minute: 58.4 match/shots_per_car_minute: 7.71Agent steps: 721M match/touch_steps_per_car_minute: 57.4 match/shots_per_car_minute: 7.93Agent steps: 752M match/touch_steps_per_car_minute: 53.7 match/shots_per_car_minute: 8.25Agent steps: 784M match/touch_steps_per_car_minute: 59.7 match/shots_per_car_minute: 9.66Agent steps: 817M match/touch_steps_per_car_minute: 58.1 match/shots_per_car_minute: 9.46Agent steps: 845M match/touch_steps_per_car_minute: 56.4 match/shots_per_car_minute: 9.06Agent steps: 881M match/touch_steps_per_car_minute: 56.5 match/shots_per_car_minute: 8.13Agent steps: 912M match/touch_steps_per_car_minute: 62.1 match/shots_per_car_minute: 8.93Agent steps: 944M match/touch_steps_per_car_minute: 60.9 match/shots_per_car_minute: 9.82Agent steps: 974M match/touch_steps_per_car_minute: 59.4 match/shots_per_car_minute: 10.2Agent steps: 1.01B match/touch_steps_per_car_minute: 62.9 match/shots_per_car_minute: 10.4
Data
SeriesSteps rangeFirstLastMinMaxPoints
match/touch_steps_per_car_minute131k – 1.02B059.3069.9300
match/shots_per_car_minute131k – 1.02B010.1010.9300

The in-run ratings went flat mid-run because each checkpoint was only compared with near neighbours. That led to wider opponent spacing and the league tool (Bot standings).

Flip-preserving 1v1 run (10 B steps)#

Pure self-play: the bot never played Necto or Nexto in training. One lineage of warm starts under runs/selfplay/: flip-1v1-s14 (from scratch, 210 M steps), fork210/drill-s15 (300 M), main2-1v1-s16 (63 M), main10b-1v1-s17 (1.01 B) and main10b-1v1-s18 (8.42 B). The task was match-1v1-flip-v1 (Necto's ang_vel and touch_grass terms from step 0), then match-1v1-flip-kickoff-v1 (plus a 5 s kickoff drill) from 210 M on.

256 held-out kickoffsOld main bot (1 B)This run at 1.58 BThis run at 10 B
vs Necto0.1640.3480.719 [0.661, 0.770]
vs Nexto0.0230.1480.242 [0.194, 0.298]
vs old main bot–0.8590.980

What made the difference: the flip terms keep dodges alive (the old run stopped dodging by 115 M steps), the kickoff drill breaks the 50/50 of mirror-image kickoffs, and scale.

main10b-1v1-s18: score vs Necto and Nexto (128 kickoffs per evaluation; step 0 = 1.58 B cumulative)
runs/selfplay/main10b-1v1-s18/metrics.jsonl, snapshotted when the site was built
No data on this machine: runs/selfplay/main10b-1v1-s18/metrics.jsonl is not here. runs/ is gitignored, so the chart is only drawn when the site is built on a machine that has the run.

A false plateau at 1.9 B steps#

At 1.9 B cumulative steps the bot was exactly even with its 1.58 B starting checkpoint (0.50 after 335 M steps), and about 0.4 against Necto. We called that a plateau and proposed changing the setup. The run kept going while that was being decided, and it was wrong:

Cumulative steps1.7 B2.1 B2.9 B3.3 B3.8 B6.7 B10 B
vs Necto (128 kickoffs)0.370.420.490.520.660.710.66

The genuine flattening came only in the last ~3 B steps (about 0.6–0.75 against Necto, and about 0.5 against the bot's own recent checkpoints).

Lesson: self-play progress comes in steps, and a few hundred million flat steps is not a plateau. Before changing a run, let the flat stretch last at least as long as the gain before it (here, billions of steps, not 335 M), and judge it against long-range and fixed opponents (older checkpoints, the league, Necto and Nexto), not against near neighbours.

A/B experiments#

One to three seeds each, so treat small differences as noise.

QuestionRunsResult
Potential vs dense shaping, action stack, RP head on ground touchruns/ab-ground/, 3 seeds × 8 MAll reached 80% in 2.4–4.2 M steps, within the seed spread. RP cut throughput 2.3×
RP head on aerial-touch-easyruns/ab-aerial-easy/, 2 seeds × 50 M80% at 14.8 M ± 1.4 M with RP vs 13.1 M ± 0.9 M without, at 2.8× the wall time
Lucy-SKG vs a dense linear reward (1v1)runs/selfplay/ab/, seed 21, 120 M0.5 / 0.8 / 0.9 vs ball_chaser at 31.5 / 52.4 / 78.6 M vs 73.4 / 104.9 M / not reached. Head to head 0.762 and 0.789 for Lucy-SKG
Auxiliary tasks and action stack (1v1)runs/selfplay/ab/, seed 21RP collapses training (0.002 head to head). SR neutral (0.52–0.54). No action stack: 0.510

Full tables: Lucy-SKG A/B experiments, Reward A/B, Lucy-SKG ablations.

Making training fast#

The goal is less wall-clock time to a skill, not just more steps per second: doubling steps/s is no win if it takes twice the steps. So:

  • Options that only change float rounding are on by default.

  • Options that change the learning itself needed a training A/B before becoming defaults.

  • Every option is a flag, recorded in the run's manifest.

The environment is not the bottleneck#

One BatchEnv holds thousands of arenas in one process: no game client, no sockets. Two settings matter: RocketSim's Balanced memory mode (12.29 M vs 6.99 M ticks/s on 28 threads; Heavy arenas thrash the cache) and a link-time-optimised build (release-lto, 8–12% faster).

BatchEnv, 28 threads, random actions, full rewardSteps/s
ground-touch-v1 (1 car)1.93 M
match-1v1-v1 (2 cars)2.20 M
match-2v2-v1 (4 cars)2.57 M

Even in the single-agent curriculum, playing 131 k steps took 0.09 s against 0.24 s for the PPO update, so the learner was the bottleneck, and most speed work went there. More: Benchmarks.

Learner throughput#

Median milliseconds per 131,072-step update on match-1v1-v1 (just bench-learner, Rocket League running on the same GPU):

ArmCycleEnvRolloutUpdateSteps/svs legacy
legacy (before this work)63298125409207 k1.00×
default: fused Adam, pinned memory, deferred bootstrap5989794408219 k1.06×
+ bf16 autocast45199106246291 k1.40×
+ CUDA graphs for the update41199104209319 k1.54×
+ CUDA graph for rollout inference3699664209355 k1.71×
+ overlapped update, decoupled correction (the match default)23994128241 (hidden)549 k2.65×
  • bf16 autocast (--amp bf16) runs forward passes in bfloat16 in both rollout and update: the biggest single gain.

  • CUDA graphs (--cuda-graphs, --cuda-graph-act) replay recorded GPU work instead of launching each kernel, cutting launch overhead from about 50 ms to 4 ms per update.

  • Overlapped update (--overlap-update) learns on a second thread while the next rollout plays with the previous weights, so the cycle is about the longer of the two instead of their sum.

  • Decoupled correction (Hilton et al., 2021) makes the overlap safe. With classic PPO on the one-update-old data, learning stalled for about 60 M steps: don't use --overlap-correction none.

  • torch.compile gave nothing over CUDA graphs and stays optional.

Every flag and the remaining rows: Learner speed.

Fixed wall-clock A/B#

The deciding test gave each arm the same budget, about 1200 s of training on match-1v1-v1 (evaluations excluded), evaluating every 40 updates on 256 kickoffs against ball_chaser (runs/perf/ab/):

ArmSeedSteps in budgetSteps to 0.5 / 0.8 / 0.9Training s to 0.8Wall s to 0.8 (with evals)Final score vs ball_chaser
base: legacy flags11242 M26.2 / 52.4 / 68.2 M266331224/0/32 = 0.875
base12223 M36.7 / 52.4 / 78.6 M284351254/0/2 = 0.992
fast: the fast set11536 M31.5 / 52.4 / 89.1 M120189249/0/7 = 0.973
fast12538 M31.5 / 47.2 / 78.6 M101157251/0/5 = 0.980
fastep2: fast + --update-epochs 211548 M36.7 / 68.2 / 99.6 M146242255/0/1 = 0.996
gact: bf16 + both CUDA graphs, no overlap11388 M31.5 / 57.7 / 62.9 M172239252/0/4 = 0.984
base-s11 (legacy flags): score vs ball_chaser over wall time
runs/perf/ab/base-s11/metrics.jsonl, snapshotted when the site was built
00.20.40.60.8105101520Wall-clock time (min)Wall-clock time (min): 0.511 min eval/success_rate: 0.418Wall-clock time (min): 1.06 min eval/success_rate: 0.426Wall-clock time (min): 1.64 min eval/success_rate: 0.441Wall-clock time (min): 2.75 min eval/success_rate: 0.508Wall-clock time (min): 3.31 min eval/success_rate: 0.479Wall-clock time (min): 3.87 min eval/success_rate: 0.504Wall-clock time (min): 4.99 min eval/success_rate: 0.791Wall-clock time (min): 5.52 min eval/success_rate: 0.809Wall-clock time (min): 6.06 min eval/success_rate: 0.859Wall-clock time (min): 7.16 min eval/success_rate: 0.926Wall-clock time (min): 7.65 min eval/success_rate: 0.914Wall-clock time (min): 8.68 min eval/success_rate: 0.934Wall-clock time (min): 9.18 min eval/success_rate: 0.953Wall-clock time (min): 9.7 min eval/success_rate: 0.922Wall-clock time (min): 10.7 min eval/success_rate: 0.949Wall-clock time (min): 11.2 min eval/success_rate: 0.949Wall-clock time (min): 12.2 min eval/success_rate: 0.969Wall-clock time (min): 12.7 min eval/success_rate: 0.961Wall-clock time (min): 13.7 min eval/success_rate: 0.945Wall-clock time (min): 14.2 min eval/success_rate: 0.949Wall-clock time (min): 15.1 min eval/success_rate: 0.922Wall-clock time (min): 15.6 min eval/success_rate: 0.949Wall-clock time (min): 16.6 min eval/success_rate: 0.957Wall-clock time (min): 17.1 min eval/success_rate: 0.934Wall-clock time (min): 18.1 min eval/success_rate: 0.926Wall-clock time (min): 18.6 min eval/success_rate: 0.941Wall-clock time (min): 19.5 min eval/success_rate: 0.898Wall-clock time (min): 20.5 min eval/success_rate: 0.926Wall-clock time (min): 21 min eval/success_rate: 0.957Wall-clock time (min): 21.9 min eval/success_rate: 0.928Wall-clock time (min): 22.4 min eval/success_rate: 0.922Wall-clock time (min): 23.4 min eval/success_rate: 0.906

eval/success_rate, last 0.875

Data
SeriesTime rangeFirstLastMinMaxPoints
eval/success_rate0.511 min – 23.6 min0.4180.8750.4180.97747
fast-s11 (fast set): score vs ball_chaser over wall time
runs/perf/ab/fast-s11/metrics.jsonl, snapshotted when the site was built
00.20.40.60.810510152025Wall-clock time (min)Wall-clock time (min): 0.265 min eval/success_rate: 0.441Wall-clock time (min): 1.21 min eval/success_rate: 0.453Wall-clock time (min): 2.17 min eval/success_rate: 0.641Wall-clock time (min): 2.82 min eval/success_rate: 0.719Wall-clock time (min): 3.81 min eval/success_rate: 0.838Wall-clock time (min): 4.69 min eval/success_rate: 0.801Wall-clock time (min): 5.54 min eval/success_rate: 0.941Wall-clock time (min): 6.38 min eval/success_rate: 0.914Wall-clock time (min): 7.17 min eval/success_rate: 0.922Wall-clock time (min): 8 min eval/success_rate: 0.949Wall-clock time (min): 8.77 min eval/success_rate: 0.988Wall-clock time (min): 9.59 min eval/success_rate: 0.988Wall-clock time (min): 10.6 min eval/success_rate: 0.979Wall-clock time (min): 11.3 min eval/success_rate: 0.984Wall-clock time (min): 12.1 min eval/success_rate: 0.961Wall-clock time (min): 12.9 min eval/success_rate: 0.977Wall-clock time (min): 13.8 min eval/success_rate: 0.969Wall-clock time (min): 14.7 min eval/success_rate: 0.965Wall-clock time (min): 15.5 min eval/success_rate: 0.98Wall-clock time (min): 16.3 min eval/success_rate: 0.969Wall-clock time (min): 17.3 min eval/success_rate: 0.988Wall-clock time (min): 18.1 min eval/success_rate: 0.984Wall-clock time (min): 18.8 min eval/success_rate: 0.977Wall-clock time (min): 19.6 min eval/success_rate: 0.988Wall-clock time (min): 20.6 min eval/success_rate: 0.996Wall-clock time (min): 21.4 min eval/success_rate: 0.988Wall-clock time (min): 22.1 min eval/success_rate: 0.973Wall-clock time (min): 23.1 min eval/success_rate: 0.982Wall-clock time (min): 23.9 min eval/success_rate: 0.988Wall-clock time (min): 24.7 min eval/success_rate: 0.98Wall-clock time (min): 25.7 min eval/success_rate: 0.977Wall-clock time (min): 26.5 min eval/success_rate: 0.988

eval/success_rate, last 0.973

Data
SeriesTime rangeFirstLastMinMaxPoints
eval/success_rate0.265 min – 26.8 min0.4410.9730.4041103

Head to head (runs/perf/ab/h2h/, 256 kickoffs from each side; the first-named arm's score):

PairingSeedAs BlueAs Orange
fast final (536 M) vs base final (242 M)110.7340.742
fast final (538 M) vs base final (223 M)120.7810.799
fast at 241 M vs base at 242 M (equal steps)110.6250.537
fast at 220 M vs base at 223 M (equal steps)120.5350.535
fastep2 final vs fast final110.4410.463
  • The fast set fits about 2.2× the steps into the same time and reached 0.8 in 2.2× (seed 11) and 2.8× (seed 12) less training time (1.75× and 2.24× counting evaluations).

  • At equal steps it's no worse (0.535–0.625 head to head), so at equal time it wins 0.73–0.80.

  • Two epochs instead of three reached 0.8 later and lost slightly (0.44–0.46), within one seed's noise.

So since train.py 14:31 the fast set is the default for match tasks on CUDA. Single-agent tasks keep it off, as they had no A/B. To opt out:

sh
--amp off --no-cuda-graphs --no-cuda-graph-act --no-overlap-update

Caveats#

  • Seeds: two per arm for base and fast, one for the others. The switch was made on seed 11, before seed 12 finished.

  • Shared GPU: Rocket League held about 45% of the GPU during the benchmarks, so timings are pessimistic and noisy.

  • Short runs: fast-learner runs have reached about 550 M steps; the 1 B-step main run used the old learner.

  • Evaluations now cost: one evaluation (about 10 s) takes as long as 40 updates, so the default cadence went to every 160 updates.

  • The environment is now about 40% of the cycle (94 of 239 ms), so further gains need both sides faster.