Name the actual solver in Aragog retry-ladder failures - #835
Open
timlichtenberg wants to merge 3 commits into
Open
Name the actual solver in Aragog retry-ladder failures#835timlichtenberg wants to merge 3 commits into
timlichtenberg wants to merge 3 commits into
Conversation
The CVODE wrapper can fail to import on a build or ABI mismatch, in which case aragog falls back to a scipy integrator without saying so. The retry-ladder exhaustion message hardcoded "CVODE status=..." regardless, so a run that silently fell back to scipy still reported CVODE failures, pointing anyone reading the log at the wrong solver. Add _active_solver_name(), which checks aragog's own _CVODE_AVAILABLE import-time flag instead of trusting the configured solver_method, and use it to build the exhaustion reason. It mirrors aragog's own Radau/BDF choice rather than collapsing both into a generic "scipy" label, and falls back to a safe label instead of crashing the coupled run if that private flag is ever renamed or removed upstream. Also generalizes the comment above the status==0 branch, which made the same CVODE-only assumption.
Add an explicit 'radau' case alongside cvode/fallback/bdf, and assert solve() ran once per retry attempt in each case, so a mutant that breaks the retry loop itself fails alongside the solver label. Add a second assertion to the missing-flag fallback test covering the 'bdf' branch, which never consults the flag.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #835 +/- ##
==========================================
+ Coverage 93.02% 93.13% +0.10%
==========================================
Files 112 112
Lines 16680 16689 +9
Branches 2975 2976 +1
==========================================
+ Hits 15517 15543 +26
+ Misses 1163 1146 -17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
The Aragog retry-ladder's exhaustion error always said "CVODE status=N", even when CVODE was unavailable and the wrapper silently fell back to scipy Radau, or when solver_method was explicitly set to bdf. That mislabels the failure and sends anyone debugging a failed run toward the wrong integrator. I added
_active_solver_name()toAragogRunner, which checkssolver_methodplus aragog's own_CVODE_AVAILABLEflag and reports the integrator that actually ran (CVODE, BDF, or Radau) in the exhaustion message.Validation of changes
I ran the full
tests/interior_energetics/test_aragog.pysuite (17 tests, all passing), including two new tests covering CVODE available, CVODE unavailable (silent fallback to Radau), explicitradau, and explicitbdf, each asserting both the reported label and that the retry loop ran the expected number of attempts. I checked the mapping against aragog's real dispatch logic inentropy_solver.pyat the pinned release26.07.04to confirm CVODE-unavailable resolves to Radau, not BDF.ruff checkandruff format --checkare clean on both changed files.Test configuration: macOS, Python 3.12, conda env
proteus-dev-2.Checklist