Skip to content

Simplify the native Dopri solvers - #195

Open
rogeriojorge wants to merge 10 commits into
feat/native_doprifrom
simplify/native-dopri
Open

rogeriojorge wants to merge 10 commits into
feat/native_doprifrom
simplify/native-dopri

Conversation

@rogeriojorge

@rogeriojorge rogeriojorge commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Simplify the native orbit tracer on #187 while preserving the public tracing interface. Shared-host CPU timings were inconclusive.

The JAX 0.12 suite passed 408 tests, with one skip and one expected failure. Local CPU timings varied about 20% between runs. The native Boozer guiding-centre case had a 1.4e-14 error on both revisions.

Measurements and test conditions

- One dense-output path for both methods: the Dopri5 quartic is expressed
  as the same per-stage polynomial table as Dopri8, so the Dopri5 branch in
  the CUDA kernel and the separate Python interpolants go away.
- Remove the unrolled/loop stage duplication (stage_execution), the public
  one-step functions and their interpolation wrappers, solve_rk45 and
  solve_dopri8 (use method=), and the unused record_steps/step_ts history.
- Validate solve_rk inputs from a single list of conditions that raises for
  concrete values and sets INVALID_INPUT for traced ones.
- Trim the README section and the tests: add fixed-step Diffrax agreement,
  convergence order, event-root accuracy, analytic gyration and energy
  conservation tests; drop tests of private helper internals.
Compiling the unrolled Dopri8 stages for the real VMEC equilibrium in the
CPU reference test needed 15.5 GB and 91 s with jax 0.6.2 on x86. A single
traced stage body returns it to 3.4 GB and 29 s, as before the
simplification. The default remains the unrolled stages.
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