9.5 RNG versioning, checkpoints and resume
The current source declares RNG derivation version 2. This integer is added during stream construction and stored in posterior checkpoints. It separates intentional stream changes from silent reproducibility regressions.
A checkpoint records:
- configuration schema version;
- RNG derivation version;
- engine version;
- analysis hash;
- original arguments;
- completion state and aggregated stability state.
Resume refuses a checkpoint whose schema or RNG derivation version differs from the current build. The error explains that continuing across versions would change random streams. This refusal is preferable to producing a hybrid analysis whose early and late replicates use different derivations.
Analysis identity
The posterior analysis hash includes engine/version, analysis name, learners, seed, replicate/resampling schedule, draw method, candidate relationships and hashes of input artifacts. Resume rereads inputs and compares identity before continuing.
Atomic checkpoint write
Checkpoint JSON is written to checkpoint.json.tmp and renamed to checkpoint.json. This reduces the chance that interruption leaves a partially written main checkpoint. Filesystem guarantees differ, so archive and failure-injection tests should still cover power loss and network filesystems.
Completing a run
A completed checkpoint retains identity but can clear large aggregation state. Do not use completion status alone as result validation; verify outputs and checksums. A checkpoint is execution state, not the published result.
Common mistakes
- Editing the RNG version field to force resume.
- Resuming after changing inputs because the seed stayed constant.
- Treating checkpoint JSON as the final scientific record.
Checklist
- Preserve schema, RNG and engine versions.
- Verify analysis hash and input hashes before resume.
- Test interruption at checkpoint boundaries.
Further reading
See hashes and numerical identity, stream derivation and Chapter 7's provenance discussion.