ADR 0052: A benchmark survives a failed run, and goes on where it stopped
- Status: Accepted on 2026-11-29.
- Date: 2026-11-29
- SDD: 12; ADR 0021, 0026, 0050
- Prompted by: findings C10, C11 and C13 of
docs/design/hardening-2026-11.md
Context
A standard run is 756 runs and takes over two hours on Legion-bench. One exception in any of them, in a worker process or in the main one, ended the whole benchmark, and nothing was kept: the card is written only at the end. The nightly workflow was red every night because a secret was not set, so a real failure in another of its jobs would not be noticed. Runs of the benchmark runner from different refs did not share a queue, and could run on the one machine at once.
Decision
A failed run does not stop the others. Each call of a benchmark is made whatever happened to the one before. When any failed, bench run writes no card, says which failed and why, keeps every finished run, and exits 3. A card is never made with runs missing; the status of such a card would be INCOMPLETE (ADR 0050).
Every finished run is kept as it finishes. In <out>/.progress.jsonl, one line per run, flushed to disk before the next is counted, with a fingerprint of the benchmark: its version hashes, every setting that changes a run, the name of every call, the installed version of the package, and the ADC_ settings a served gate reads (hashed, never stored). A failure is a line too, so nothing tried is dropped from the record.
--resume goes on where a run stopped. It makes only the runs with no kept row of the same fingerprint, and the card is the same, byte for byte, as a run that never stopped. A row of another benchmark is never used, and a line cut short when a run was stopped is made again. Without --resume a run starts from nothing. There is no automatic retry: the simulator is deterministic, so a run that fails will fail again, unless what failed was outside it, and then a person decides.
Files are written whole or not at all. The card, the report and the summary are written beside their place and renamed into it.
A missing optional secret is SKIPPED, not red. The nightly scan of the history for forbidden terms needs the owner's key. Without it the step says SKIPPED in a warning and in the job summary, and that the requirement is unverified, and exits 0; every other job's status means something again. With the key it fails as before on a finding.
One queue for the one benchmark machine. The runner's concurrency group no longer depends on the ref.
Not done
- A gate that hangs is stopped by its binding's timeout (
ADC_GATE_TIMEOUT_S) for a served gate; a Python gate that hangs inside the process still holds the run. - The whole test suite still runs again on a push to
main. It checks the merge commit itself, which a pull request's checks do not, so it stays.