← Board · source

T-012: Runner, run folders and checkpoints

done · M1 · model opus · needs T-001

Goal

Run worlds headless for a long time and be able to pick any of them up later on another machine. This is the "run there, look here" requirement in docs/DESIGN.md section 12.

Scope

Done when

Result

Done on branch t-012-runner-checkpoints. People's guide: docs/RUNS.md.

What works

Checkpoint cost (Mac mini, 4 threads, load average about 6, testbed soup):

CellsSizeSerialize and compressWrite and syncResume
100,0006.1 MB5 ms15 ms
1,000,00061 MB55 to 80 ms33 to 43 msabout 0.2 s, 430 MB peak memory

A checkpoint costs 2 to 6 steps' worth of time, so at the auto interval it is well under 0.1% of a run.

Tests (crates/runner/tests/runs.rs, plus unit tests for thinning, manifest, names): resume equals continuous (stopped off-grid, resumed on 1 and 3 threads, extended); logs cut back; packed run (all, last, spread 3) unpacked elsewhere resumes to the same world; container version too new and too old refused, by resume, run --from and info; run layout too new refused; damaged newest falls back; lock; thinning stays small; real process killed with SIGKILL at random moments (18 to 31 kills per test run) resumes exactly; real Ctrl-C saves at the exact step and resumes exactly. Breaking log truncation or the re-application of churn on resume makes 4 and 6 of these tests fail.

Decisions