0109. Champion and challenger: decided experiments stay live, and every version is compared on all of them
Source:
docs/decisions/0109-champion-and-challenger.md. Generated at build time; edit the source file.
Date: 2026-11-24. Status: accepted (lane champ, branch feat/champion-challenger). Builds on ADRs 0104, 0105, 0106, 0107 and 0108; replaces the “historical, not rerun” rule of ADR 0106.
Context
Section titled “Context”ADR 0106 let an experiment age: once the algorithm moved on, its results were historical, checked for their registration, freeze and inputs, and never rerun. That throws away the most useful thing a decided experiment has, a registered design with registered seeds that can measure any later version. The owner asked that “with the experiments we need to constantly reuse and adapt based on their results, we aim for the best”, and, from ADR 0107, that “every experiment we run is actually valuable and not just wasting resources and time”.
Two experiments are decided today, both on algo-1.1.0+fa5e2186e1dd. EXP-0001’s pilot is 3,840 games through the real pipeline: 1,489 seconds with 8 Stockfish 19 engines, about 2.44 CPU-hours, and it needs Postgres. EXP-0002 is 49,600 profile computations and no engine: 1,592 seconds on one core, about 0.44 CPU-hours. Both run in about 25 minutes of wall time on the documented machine.
Decision
Section titled “Decision”- The champion is the production algorithm. In a pull request it is main’s
algorithm/manifest.json; on the weekly run it is the newest release tag’s; on a release it is the release before. Every change is a challenger. - Decided experiments stay live. A decided experiment’s
summary.mdsayslive: true, how often it is re-run (rerun: per-pr|weekly|release), and the measured cost of one run (run_cpu_hours,run_minutes), with its comparison rule inarena.pynext toanalysis.py; orlive: falsewith the reason inretired.python -m rematch_lab.experiments checkenforces it. A scope runs its own experiments and every cheaper one:weeklyrunsper-prandweekly,releaseruns all three. - The arena compares on identical seeds and inputs.
python -m rematch_lab.arenaruns each live experiment’s frozenanalysis.pyfor both versions on the registered seed namespace, with--algorithm <id>and that version’scli, and compares them with the experiment’s rule: per metric, the effect, its interval and a verdict (better, worse, no clear difference). A record is reused only with the same seed namespace and the same sha256 ofanalysis.py,inputs.sha256andarena.py. The champion’s records come from the champion’s own commit (itslab/leaderboard.jsonand committedresults.json), never from the challenger’s tree, which a pull request can edit. When an experiment’sSOURCE_PATHSdiffer between the two commits (EXP-0001’s synthetic players live inbackend/crates/bench/src, outside the manifest) the arena refuses the comparison, and it refuses a champion run when the champion’s pinned Stockfish differs from the image’s. - The rules. EXP-0001 (as registered): recall at 2 at 80 games is better when the paired two-sided 97.5% Newcombe interval lies wholly above 0 (its ship rule) and worse when the 80% interval lies wholly below 0 (ADR 0104’s guard); coverage up to 80 games is guarded by the change in the distance from 0.8, with an 80% paired cluster bootstrap resampled within flaw (section 8), worse only when the interval lies wholly above the registered tolerance of 0.05; the clean controls are reported and never gate, since two players cannot decide anything. EXP-0002 registered no comparison of two versions, so its rule is the one drafted in the EXP-0006 issue, adopted here and not pre-registered: the primary is the largest distance from 0.8 among the 20 coverages, with the interval of the maximum (the largest lower and the largest upper bound of the simultaneous Bonferroni intervals), and the coverage at ρ = 1 is guarded; each change is the MOVER interval of the two versions. EXP-0002’s results keep coverages, not each player’s flags, so that interval ignores the correlation of two versions on the same seeds and errs towards “no clear difference”. EXP-0006’s registration supersedes it for that experiment’s own decision.
- The budget is planned before anything runs. The arena costs the runs the caches cannot answer from
run_cpu_hoursand refuses the plan past its scope’s budget (1 CPU-hour per pull request, 4 a week, 8 a release, unless--max-cpu-hourssays otherwise). A run is stopped at 150% of its measuredrun_minutes(timesARENA_SLOWDOWN, 2 on a hosted runner), and each experiment’s ownBudgetstill caps what it counts (ADR 0107). - EXP-0002 is
per-pr, EXP-0001 isrelease. EXP-0002 costs 0.44 CPU-hours on one core with no engine and no database, and it measures the profile layer that EXP-0006 will change first, so a pull request that bumps the algorithm version pays for it. EXP-0001 costs 2.44 CPU-hours with 8 engines and Postgres; its primary, recall at 2, is already gated on every pipeline pull request by the smoke suite and measured weekly by the full suite (bench.yml), so a weekly EXP-0001 would buy little, and it runs on release. - The shipping gate.
lab.ymlruns the arena when a pull request changesalgorithm/manifest.json(per-pragainst main), every Monday (weeklyagainst the newest release) and fromrelease.yml(releaseagainst the release before; the images wait for it). A clear regression on a primary or a guarded metric fails the job. A behaviour change ships when the experiment registered for it says ship and the arena shows no clear regression elsewhere; a challenger replaces the champion on the leaderboard only when it beats it on the primaries. - The leaderboard is committed, in
lab/leaderboard.json. Each record holds the version, the experiment, the seed namespace, the sha256 of the analysis, inputs, rule and results, the compact measures the comparison needs, the metrics with their intervals, the champion it was compared with, the verdict and the date. A pull request that bumps the version must commit its challenger’s record (--require-records); the pull request and release runs re-run the challenger and fail when the run differs from a committed record (--verify). The weekly and release runs write the file to their artifact and never push. The site’s Experiments page renders it: a row per version, a column per live experiment’s primary metric, the champion marked. - The emergency override is an ADR. In an emergency (a security fix that cannot wait for a fix of its regression) the owner writes an ADR in
docs/decisions/that names the version, the experiment and the metrics, and adds the same tolab/overrides.json(algorithm_id,experiment,metrics,adr,reason). The arena then reports the regression as “overridden” and passes. An entry whose ADR is missing, is not adocs/decisions/NNNN-*.mdfile, or does not name the version, the experiment and every metric does nothing.lab/overrides.json,lab/leaderboard.jsonand everyarena.pyare owned by the maintainer in CODEOWNERS and are sensitive paths (ADR 0108). A release whose images the arena held back is published by the maintainer by hand after the override is merged (re-publishing the Release startsrelease-images.yml); that step is the maintainer’s alone. - Every decision ends with a Next. A decided experiment’s
decision.mdhas a## Nextsection whose numbered items each name a roadmap issue, by anEXP-NNNNid with its experiment issue in.github/settings/roadmap-issues.jsonor byIssue: "<exact title>", and at least one item is an experiment issue.scripts/github/test-settings.mjsenforces it on every pull request.
Options considered
Section titled “Options considered”- The leaderboard on the
bench-historydata branch. Rejected for now: the records are deterministic (the same version and seeds give the same bytes), so a person can commit them and a reviewer can read them in the pull request, with no bot writing anywhere; the site builds from the commit with no fetch; and the branch does not exist yet.bench-historystays the home of the RunRecords, whose timings depend on the machine (ADR 0104). - Re-run every live experiment on every pull request. Rejected: 2.88 CPU-hours a pull request, most of it EXP-0001’s engines, for a primary the smoke suite already gates.
- Keep the historical rule. Rejected: it discards registered designs that can measure every later version, against the owner’s “we aim for the best”.
- A single generic comparison for every experiment. Rejected: each experiment registered its own unit, interval and level; a generic rule would compare EXP-0001’s players as if they were independent games.
- Holm across a release’s metrics. Not adopted yet. A release gates three metrics today (EXP-0001’s recall and coverage, EXP-0002’s two), and only a change that moves behaviour can trip a guard: the coverage guard has the registered 0.05 margin and recall’s guard needs a clear net loss. If the number of gating metrics grows, the false-alarm rate of a neutral change is the next thing to measure, and the correction comes with it.
Consequences
Section titled “Consequences”- A pull request that bumps the algorithm version costs about one extra EXP-0002 run in CI, and its author commits the arena’s
lab/leaderboard.json(the job’s artifact holds it). - The release pipeline waits for the arena, about two hours on a hosted runner for both challenger runs, longer when the release before has no cached record and its
cliis built. - When an experiment’s design or rule changes, its old records stop being reused (the sha256 differ), and the next run writes new ones.
- The same registered seeds are reused for every version, so a challenger can be tuned to them. A challenger is developed on other seed namespaces (
--seed-namespace), and a confirmatory replication on fresh seeds is the way to check a leaderboard lead that matters. - The weekly scope holds no experiment of its own yet; EXP-0001 is seen at release, after a regression in it has merged, which the smoke suite’s per-pull-request gate on recall at 2 mitigates.
docs/evaluation.md(“The loop: champion and challenger”),lab/README.mdandlab/experiments/README.mddescribe the loop; ADR 0106’s historical rule is replaced.
Amendment 1 (2026-11-24): EXP-0007 is live, external inputs, and reviewed source changes
Section titled “Amendment 1 (2026-11-24): EXP-0007 is live, external inputs, and reviewed source changes”EXP-0006 and EXP-0007 merged together, and two gaps stopped the merge: EXP-0007 was decided but neither live nor retired, and EXP-0006’s side-by-side bench code falls under EXP-0001’s SOURCE_PATHS, so a release arena would have refused EXP-0001.
-
EXP-0007 is live,
rerun: release. The next algorithm version hides its six untrusted tags, and EXP-0020 and EXP-0021 change the deflection and pin rules, so every version must be measured on it again. One run is 54,987 lines in 28cli lab tag-motifscalls, about 60 seconds in the lab container with no engine (run_cpu_hours: 0.02,run_minutes: 1, from itsdecision.md). Its rule (lab/experiments/EXP-0007/arena.py) is the registered section 9 per tag: the primary is the set of tags the rule trusts (worse when the challenger stops trusting any, better when it trusts one more and loses none); each tag’s precision is guarded, worse when the champion trusts the tag and the lower end of the challenger’s Bonferroni interval falls below 0.80; each tag’s recall is reported. A tag clears only by the registered rule, as the frozen analysis decides it. Itsanalysis.pywas frozen before the arena and takes no--algorithm, so the rule saysALGORITHM_FLAG = False, and the arena checks every run’s recordedalgorithm_idagainst the version it asked for, for every experiment. Its confirmatory run draws nothing at run time (it reads the committedsample.csv, checked byinputs.sha256), so its results record no seed namespace and the rule’sSEED_NAMESPACE = "EXP-0007"stands for it. -
No data, no run, and the report says so. An experiment whose external input (ADR 0106 Amendment 1) is not on the machine is never planned: its entry reads “not run: external input missing (lichess-puzzles/lichess_db_puzzle.csv)”, the job summary names it, and
--require-externalmakes it a problem (exit 3). With--verify, a challenger record already on the leaderboard is compared and reported as not re-run. A hosted runner has no snapshot, and Lichess replaces the file at its URL every month, so CI cannot fetch it by checksum. The operator runs EXP-0007’s side of a release where the snapshot is: downloadhttps://database.lichess.org/lichess_db_puzzle.csv.zst(the copy of 2026-11-01, sha2567b0d235fa40cfd7fdb7df1fec56a96b3b6ee1496b32ed2eb05be90d0ebf94253), decompress it with zstd todata/lichess-puzzles/lichess_db_puzzle.csv(sha2568ce98180bcb7cb60f3f51f12afdbe6a4fd294d8aaf4f1410e8c25e85ac78fdc9), mount it read-only in the lab image with-v "$PWD/data:/data:ro" -e REMATCH_DATA_DIR=/data, runpython -m rematch_lab.arena --scope release --only EXP-0007 --champion-ref <the release before> --require-external --write, and commitlab/leaderboard.json.algo-2.0.0’s record on EXP-0007 was made that way on 2026-11-24, in 49 seconds, with no clear difference on any of its 31 metrics. Archiving the snapshot as a release asset, so CI can run it too, stays the follow-up of ADR 0106 Amendment 1. -
A reviewed source change does not refuse the comparison. The guard of decision 3 exists to catch a change to the code that measures, not additive code an experiment never calls. The arena now lists the files that differ under
SOURCE_PATHSand refuses only those thatlab/source-reviews.jsondoes not accept. An entry names the experiment, the path, the git blob sha of the file’s exact content (git hash-object), the reason and this kind of ADR, which must exist and name the experiment and the path. Any later edit of the file changes its blob and brings the refusal back; a deleted file is never accepted.lab/source-reviews.jsonis a sensitive path, owned by the maintainer in CODEOWNERS, likelab/overrides.json. -
EXP-0001’s measured path did not change in EXP-0006. Between main (
algo-1.1.0+fa5e2186e1dd) andalgo-2.0.0, five files underbackend/crates/bench/srcchanged, andflaws.rs,generate.rs,memo.rs,policy.rsandsuite.rs, which make the synthetic players and their games, did not:backend/crates/bench/src/harness.rs: avariantfield andcheckpoint_under; every added statement runs only whenvariantisSome, and the perturbed checkpoint is the same value through a tuple.backend/crates/bench/src/run.rs:RunOptions::variant, passed to the harness, andRunOutput::variant, built only when it is set.backend/crates/bench/src/results.rs:PlayerResult::variant(skipped in JSON whenNone),VariantResultandas_variant, which nothing calls without a variant.backend/crates/bench/src/lib.rs:variant_from_envand its test.backend/crates/bench/src/lab.rs:variant: Nonein the harnesscli lab analysebuilds; EXP-0001 does not call it.
EXP-0001 calls
rematch_lab.bench(suite_file=…)with novariant, and the bridge then setsALGO_VARIANTto the empty string, whichvariant_from_envreads asNone. Its run takes exactly the statements it took before, and itsbench-results.jsonhas no new field. EXP-0006’s own check agrees: the champion’s pilot under the new code equalled EXP-0001’s stored rows field for field (EXP-0006decision.md). The five blobs atalgo-2.0.0are inlab/source-reviews.json. EXP-0001’s pre-registration is not edited.