Skip to content

avoid Jacobian resets for endpoint checkpoints#237

Merged
martinjrobins merged 2 commits intomainfrom
codex/propose-fix-for-issue-223
Jan 19, 2026
Merged

avoid Jacobian resets for endpoint checkpoints#237
martinjrobins merged 2 commits intomainfrom
codex/propose-fix-for-issue-223

Conversation

@martinjrobins
Copy link
Owner

@martinjrobins martinjrobins commented Jan 19, 2026

fixes #223

Motivation

  • Avoid redundant internal Jacobian reinitialisations when taking the first and last checkpoints during checkpointed solves to reduce unnecessary work and potential side-effects.
  • Provide a way to clone solver state without triggering Jacobian updates so forward solver clones used for checkpointing are side-effect free.

Description

  • create the trait method state_clone on OdeSolverMethod.
  • Use state_clone for the initial and final checkpoints in solve_with_checkpointing and solve_dense_with_checkpointing instead of taking a full checkpoint that forces Jacobian updates.
  • Implement state_clone for ExplicitRk, Sdirk, and Bdf by returning a plain clone of their internal state.
  • Stop the eager Jacobian reset during Bdf Clone so cloning does not trigger an immediate Jacobian recalculation.

Testing

  • No automated tests were run for this change.

Codex Task

@martinjrobins martinjrobins changed the title Rename state_snapshot to state_clone and avoid Jacobian resets for endpoint checkpoints avoid Jacobian resets for endpoint checkpoints Jan 19, 2026
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.24%. Comparing base (df915d6) to head (41fd84e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #237      +/-   ##
==========================================
+ Coverage   74.22%   74.24%   +0.02%     
==========================================
  Files          85       85              
  Lines        9377     9382       +5     
==========================================
+ Hits         6960     6966       +6     
+ Misses       2417     2416       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@martinjrobins martinjrobins merged commit e575b26 into main Jan 19, 2026
14 checks passed
@martinjrobins martinjrobins deleted the codex/propose-fix-for-issue-223 branch January 19, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

first and last checkpoint of solve_checkpointing should not reset the jacobian

1 participant