M-CHECKPOINT CHK.7: checkpoint Reorganization Energy's geometry optimizations - #55
Merged
Merged
Conversation
…izations Reorganization Energy runs 2-3 independent geometry optimizations under one Calculate-tab run (the neutral reference plus one per ion channel) and was dispatched with no checkpoint at all — the run most likely to be interrupted (two full geometry opts plus four SCF energies) had nothing to resume into. - checkpoint.py: new Checkpoint.sub() derives a nested child checkpoint (own resume_key, dir nested under <parent.dir>/legs/) for one leg of a multi-stage run — a single shared checkpoint would let one leg's trajectory/Hessian overwrite another's. has_progress() now also checks nested legs, since the parent itself never writes a trajectory directly; without this the run would never be offered as resumable no matter how much of a leg had completed. - reorganization_energy.py: run_reorganization_energy() takes checkpoint/resume params, builds+begins a leg checkpoint for the neutral optimization and each ion-channel optimization, and marks the parent complete once every required single point has converged (mirrors pes_scan.py's "every point attempted" convention) — without this a successful run would linger forever in the "unfinished calculations" list. - app.py: the Reorganization Energy branch of _do_run now passes checkpoint=_ckpt, resume=_resume like the PES Scan and Single Point branches already did. - app_runflow.py: fixed a real bug found while wiring this up — _CALC_TYPE_KEYS (the dropdown-label -> checkpoint/estimator key map) never listed "Reorganization Energy", so checkpoint_identity() silently built every reorg checkpoint under the "single_point" key, colliding with actual single-point checkpoints on the same molecule/method/basis, and the runtime estimator was scoring reorg runs against single-point history. Verified against real PySCF (RHF/STO-3G, H2 hole channel): two leg checkpoints written with distinct resume keys, correct steps_done, parent correctly marked complete and no longer offered as resumable. CHK.4 (frequency displacement restart) stays deferred, per the roadmap's own scope note — logged as a grounded design proposal in the planning repo rather than implemented this pass. Full suite: 2557 passed, 14 failed (pre-existing NMR failures, unrelated), 23 skipped. ruff + black + mypy (pre-push hook-stage) clean. Contributions: - Claude (Opus 4.8): implementation, tests, verification - Jonathan Schultz: direction and review Co-authored-by: Jonathan Schultz <schultzdjon@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Last in the stack behind M-METAL (#52), M-TYPECHECK (#53), and M-EXPORT2 (#54) — all merged. This branch has
mainmerged in and is green.Reorganization Energy runs 2-3 independent geometry optimizations under one Calculate-tab run (the neutral reference plus one per ion channel) and was dispatched with no checkpoint at all — arguably the longest-running calc type in the app had nothing to resume into.
Checkpoint.sub(tag, *, charge, multiplicity, coords)on theCheckpointclass derives a nested per-leg checkpoint (own resume key, own directory under<parent.dir>/legs/) — a single shared checkpoint would let one leg's trajectory/BFGS Hessian overwrite another's.has_progress()extended to read progress from nested legs, since the parent itself never writes a trajectory directly.run_reorganization_energy()now takescheckpoint/resume, builds+begins a leg checkpoint for the neutral optimization and each ion-channel optimization, and marks the parent complete once every required single point has converged (mirrorspes_scan.py's "every point attempted" convention)._CALC_TYPE_KEYSnever listed "Reorganization Energy" — every reorg checkpoint silently collided with an actual single-point checkpoint on the same molecule/method/basis, and the runtime estimator scored reorg runs against single-point history. And the parent checkpoint was never marked complete on success, so a finished run would have lingered forever in the "unfinished calculations" list.steps_done, parent correctly marked complete afterward.Scope note: this ships CHK.7. The milestone stays open — CHK.8 (live real-PySCF verification, LOCAL/Voilà only) and CHK.4 (deferred) remain.
Test plan
pytest -m "not network"— full suite passes on CI (ubuntu 3.9/3.10/3.11 + windows 3.11). Locally the only failures are the two GFN-FFtest_preopt_gfnfftests, environmental to this dev box (brokenxtbC-API extension); they pass on CI where the xtb wheel is intact.tests/test_checkpoint_reorg_legs.py(no PySCF —optimize_geometry/run_in_sessionmonkeypatched) + a manual real-PySCF smoke test.pre-commit run --hook-stage pre-push mypy --all-files— clean (re-confirmed on themain-merged branch).mainbase: Lint & type check + all test matrix jobs.