Skip to content

Report implicit midpoint nonconvergence - #19

Closed
rogeriojorge wants to merge 3 commits into
agent/pytree-implicit-midpointfrom
agent/report-midpoint-nonconvergence
Closed

rogeriojorge wants to merge 3 commits into
agent/pytree-implicit-midpointfrom
agent/report-midpoint-nonconvergence

Conversation

@rogeriojorge

Copy link
Copy Markdown
Member

Summary

  • return the Newton convergence flag from the midpoint nonlinear solve
  • promote Optimistix's standard nonlinear_max_steps_reached status through Diffrax when Newton exhausts max_iters
  • add a forced-exhaustion regression test

This is stacked on #18. It does not change converged midpoint solutions, Newton updates, GMRES, tolerances, or physics. It only stops an unconverged step from being labeled successful.

Motivation

ImplicitMidpoint.step currently returns diffrax.RESULTS.successful unconditionally, even when its Newton loop exits because max_iters was reached. Diffrax can only reject, stop, or expose such a failure if the solver returns the correct status.

Validation

  • pytest -q: 5 passed
  • ruff check spectrax/midpoint_solver.py tests/test_simulation_runs.py: passed
  • the regression test uses max_iters=0 and verifies the exact promoted nonlinear_max_steps_reached result

@rogeriojorge
rogeriojorge changed the base branch from agent/pytree-implicit-midpoint to main July 13, 2026 04:34
@rogeriojorge rogeriojorge reopened this Jul 13, 2026
@rogeriojorge
rogeriojorge changed the base branch from main to agent/pytree-implicit-midpoint July 13, 2026 04:34
@rogeriojorge
rogeriojorge marked this pull request as ready for review July 13, 2026 04:35
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
spectrax/midpoint_solver.py 98.03% <100.00%> (+0.08%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rogeriojorge

Copy link
Copy Markdown
Member Author

Squashed into #18.

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