Skip to content

ForceFreeStates - BUGFIX - Report an aborted Euler-Lagrange integration instead of failing in the edge scan - #564

Merged
matt-pharr merged 1 commit into
feature/solve-fixed-kineticfrom
bugfix/report-el-abort
Oct 26, 2026
Merged

matt-pharr merged 1 commit into
feature/solve-fixed-kineticfrom
bugfix/report-el-abort

Conversation

@matt-pharr

Copy link
Copy Markdown
Collaborator

Release note

  • Audience: users
  • Numerical impact: none (harness @ 7310db1)
  • Migration: none

When the Euler-Lagrange ODE solver gives up partway through an interval (for example when its step size underflows on a stiff kinetic run), GPEC now stops with an error naming the ψ it reached. Before, it carried on with a truncated solution and later failed with an unrelated MethodError in the edge dW scan.

Regression report

Regression Report: diiid_n1
Ref 1: feature/solve-fixed-kinetic  @ 0d7b8fe53 (2026-10-23)
Ref 2: bugfix/report-el-abort  @ 7310db1d1 (2026-10-23)
       env: julia 1.12.6, x86_64-linux-gnu, manifest aa94b997 (pinned), 8 threads/4 BLAS, jit build
Quantity                                      feature/solve-fixed-kinetic  bugfix/report-el-abort  Diff       Status
total energy Re(et[1])                        8.006123e-01                 8.006123e-01            0.0e+00    OK
plasma energy Re(ep[1])                       -1.372261e+00                -1.372261e+00           0.0e+00    OK
vacuum energy Re(ev[1])                       2.172874e+00                 2.172874e+00            0.0e+00    OK
PE plasma energy                              3.320677e+00                 3.320677e+00            0.0e+00    OK
NTV torque FGAR [N·m]                         5.483495e-01                 5.483495e-01            0.0e+00    OK
...
Summary: 53 unchanged

Regression Report: diiid_n1_riccati
delta prime (BVP diagonal)     [5 elem]                     [5 elem]                0.0e+00  OK
delta prime (raw side-major)   [10 elem]                    [10 elem]               0.0e+00  OK
total energy Re(et[1])         8.031971e-01                 8.031971e-01            0.0e+00  OK
...
Summary: 17 unchanged

Regression Report: solovev_n1
total energy Re(et[1])        1.090560e-02                 1.090560e-02            0.0e+00    OK
...
Summary: 22 unchanged

Regression Report: solovev_kinetic_calculated
total energy Re(et[1])    1.827879e+00                 1.827879e+00            0.0e+00  OK
total energy Im(et[1])    -1.326825e+00                -1.326825e+00           0.0e+00  OK
...
Summary: 17 unchanged

Notes for reviewers

  • Stacked on ForceFreeStates - FEATURE - Accept the fixed kinetic source in solve(EulerLagrangeProblem) #550 (feature/solve-fixed-kinetic). The harness compares against that branch.
  • solve_el is the single entry point for every Euler-Lagrange ODE solve: the forward integrate_el_region! and the five Riccati propagator solves. It now checks SciMLBase.successful_retcode(sol). No ForceFreeStates callback calls terminate!, so an unsuccessful return code always means a real failure.
  • findmax_dW_edge! is unchanged: with the root cause caught, its findfirst can no longer return nothing.
  • Tests:
    • a du/dψ = u² blow-up through solve_el (direct, deterministic), plus a decaying ODE as the control;
    • the original crash, the coarse Solovev fixture at kinetic_factor = 0.1 through solve, now raises the new message (it aborts at ψ ≈ 0.404).
  • The Riccati Δ′ case (diiid_n1_riccati) is in the harness to show that none of the currently passing propagator solves were silently ending early.

🤖 Generated with Claude Code

…on instead of failing in the edge scan

solve_el never checked the solver's return code, so a solve that stopped short
(e.g. the step size underflowing) was stored as if it had reached the end of its
interval, and the forward sweep later failed in findmax_dW_edge! with a
MethodError. solve_el now errors with the ψ reached, the target and the return
code. Covers the forward solve and the Riccati propagator solves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matt-pharr matt-pharr self-assigned this Oct 23, 2026
@matt-pharr
matt-pharr requested a review from logan-nc October 23, 2026 10:16
@github-actions github-actions Bot added bugfix Something was wrong and now is not labels Oct 23, 2026
@matt-pharr
matt-pharr added this pull request to stack #565 October 23, 2026 10:17

@logan-nc logan-nc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read in full. Ready to approve from my read; nothing to add. successful_retcode is the right gate given no FFS callback calls terminate!, the message names a real key (eulerlagrange_tolerance), and the blow-up/decay pair tests the gate directly rather than through a full solve.

@logan-nc logan-nc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 7310db1 on the comment review above. Stacked on #550.

@matt-pharr
matt-pharr merged commit ddad504 into develop Oct 26, 2026
14 checks passed
@matt-pharr
matt-pharr deleted the bugfix/report-el-abort branch October 26, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something was wrong and now is not

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants