Skip to main content

cwright resume

cwright resume <checkpoint> <model> --mode recover|fork [--out FILE]
[--checkpoint FILE --checkpoint-every EVENTS]

Continues a run from a checkpoint written by simulate. --mode is mandatory — there is deliberately no default, because recover and fork are the same checkpoint producing two legitimately different runs, and choosing wrong is silent rather than an error. See Checkpointing for the full explanation.

Flags​

FlagMeaning
--mode recoverContinue the interrupted run. Same generation, same random draws from here on — the finished result is bit-identical to the run that was killed. This is crash recovery.
--mode forkStart a new run from this state. The generation is bumped, so every draw from here on differs. This is how one warmed-up state becomes many independent replications.
--out FILEWhere to write the resulting outcome document (as for simulate).
--checkpoint FILE --checkpoint-every EVENTSContinue checkpointing from here, same as simulate.

Safety check​

Before doing anything else, resume compares the checkpoint's recorded model hash against the model document you supplied, and refuses outright on a mismatch:

this checkpoint was taken from model <hash-a> but model.yaml hashes to <hash-b>. Refusing to
resume -- continuing would produce a run matching neither document.

This is deliberate: a run resumed against the wrong model document would silently produce a result that is not the continuation of anything, and there is no way to detect that after the fact from the output alone.

Example​

cwright simulate model.yaml --checkpoint run.ckpt --checkpoint-every 250000
# ... interrupted, e.g. by a crash or SIGKILL ...
cwright resume run.ckpt model.yaml --mode recover --out result.json

produces exactly the outcome the original run would have, had it never been interrupted.