# Recipe — restartable Ritz step All paths project-relative; `python3` is the project virtualenv. ## Banked resume (no recomputation) ``` cd research/0023 ../../../../.venv/bin/python3 src/seed_ckpt.py # once: bank the vectors ../../../../.venv/bin/python3 src/ritz_ckpt.py 50 1/25 25 --prec 1024 # [ckpt] ... resumed finished vector (lam=4.001246593, n=1780) -- no recomputation # real 0m0.157s ``` ## A fresh run, stopped cleanly and restarted ``` cd research/0024 ../../../../.venv/bin/python3 src/ritz_ckpt.py 50 1/25 21 --prec 512 \ --ckpt out/ckpt_demo & pid=$! sleep 50 touch out/ckpt_demo/STOP wait $pid; echo $? # 75 = stopped, restartable cat out/ckpt_demo/heartbeat.json # clear STOP and run again; it resumes from the checkpoint directory rm out/ckpt_demo/STOP ``` ## Heartbeat contents `heartbeat.json` (rewritten every 10 s): `stage` (`build` / `equil` / `chol` / `whiten` / `eig` / `resumed-vector` / `done`), `rows` (progress within the row loops), `n`, `pid`, `started`, `updated`, `elapsed_s`, `stop_requested`. ## Unit tests ``` cd research/0024 ../../../../.venv/bin/python3 tests/test_ritz_ckpt.py ``` ## Certificates (unchanged path, now skip-if-banked) ``` cd research/0023 SAH_PREC=1024 ../../../../.venv/bin/python3 src/certify_stream.py # skips existing SAH_PREC=1024 ../../../../.venv/bin/python3 src/certify_stream.py --force ``` ## Reuse `ritz_ckpt.py` is promoted to `lib/maynard/ritz_ckpt.py`; it imports the exact engine and blocked `arb` Cholesky from `research/0022/src` (also in `lib/maynard/`) rather than duplicating them.