Skip to content

Configure midpoint Krylov limits#22

Open
rogeriojorge wants to merge 1 commit into
agent/solvax-midpointfrom
agent/configure-midpoint-krylov
Open

Configure midpoint Krylov limits#22
rogeriojorge wants to merge 1 commit into
agent/solvax-midpointfrom
agent/configure-midpoint-krylov

Conversation

@rogeriojorge

Copy link
Copy Markdown
Member

Summary

  • expose linear_restart and linear_max_restarts on ImplicitMidpoint
  • pass those values directly to SOLVAX FGMRES
  • exercise a reduced-basis solve in the midpoint integration test

Defaults remain 20, preserving the current solver behavior. This is stacked on #21.

Why

FGMRES allocates a shape-static Krylov basis, so restart controls compilation size and accelerator memory even when a solve converges early. Large plasma states that converge in one or two inner iterations should be able to select a smaller basis without reducing the nonlinear Newton iteration limit.

Validation

  • clean-environment pytest -q (5 passed)
  • 65x65 x 6x6x6, five midpoint steps: 1.079 s at 20/20 versus 0.832 s at 2/2
  • compile/warm-up: 1.964 s versus 1.896 s
  • saved Ck, Fk, and total energy were bitwise identical

The measured 23% runtime improvement is configuration-specific; the PR changes no default.

@rogeriojorge rogeriojorge changed the base branch from main to agent/solvax-midpoint July 13, 2026 06:57
@rogeriojorge rogeriojorge marked this pull request as ready for review July 13, 2026 06:57
@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.18% <100.00%> (+0.06%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rogeriojorge rogeriojorge force-pushed the agent/configure-midpoint-krylov branch from 40c9082 to 134f3c3 Compare July 16, 2026 14:13
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