Skip to content

Name the actual solver in Aragog retry-ladder failures - #835

Open
timlichtenberg wants to merge 3 commits into
mainfrom
tl/aragog-retry-ladder-label
Open

Name the actual solver in Aragog retry-ladder failures#835
timlichtenberg wants to merge 3 commits into
mainfrom
tl/aragog-retry-ladder-label

Conversation

@timlichtenberg

Copy link
Copy Markdown
Member

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() to AragogRunner, which checks solver_method plus aragog's own _CVODE_AVAILABLE flag 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.py suite (17 tests, all passing), including two new tests covering CVODE available, CVODE unavailable (silent fallback to Radau), explicit radau, and explicit bdf, 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 in entropy_solver.py at the pinned release 26.07.04 to confirm CVODE-unavailable resolves to Radau, not BDF. ruff check and ruff format --check are clean on both changed files.

Test configuration: macOS, Python 3.12, conda env proteus-dev-2.

Checklist

  • I have followed the contributing guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors
  • I have checked that the tests still pass on my computer
  • I have updated the docs, as appropriate
  • I have added tests for these changes, as appropriate
  • I have checked that all dependencies have been updated, as required

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.
@timlichtenberg
timlichtenberg requested a review from a team as a code owner August 23, 2026 07:35
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.13%. Comparing base (84b029b) to head (173e260).

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     
Flag Coverage Δ
unit-tests 86.70% <100.00%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant