Skip to content

Simplify native split solver, tests and benchmarks - #197

Open
rogeriojorge wants to merge 11 commits into
feat/native_split_collisionsfrom
simplify/native-split
Open

rogeriojorge wants to merge 11 commits into
feat/native_split_collisionsfrom
simplify/native-split

Conversation

@rogeriojorge

@rogeriojorge rogeriojorge commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Simplifies the split solver PR, base feat/native_split_collisions.

What

  • Solver (essos/split.py, 2316 lines vs 2838): one conservative collision controller, no paper/candidate Wiener look-ahead or combined stepping; trace_split(..., interpret=True) runs the GPU kernel on CPU for tests; scalar-lowering CSE alias fix.
  • Latest commit: removes the committed results file, 5 figures and 10 reference/validation/coordinate benchmark scripts (about 1,800 lines) that the tests now cover; README section shortened. benchmark_split_orbits.py stays as the timing script. Adds examples/particle_tracing_collisions/native_split_slowing_down.py.
  • Tests added: Spitzer slowing down of protons in an electron bath at 10 keV and 500 eV (<E> = 3T/2 + (E0 - 3T/2) exp(-2t/tau_s), 4%), Ito/Stratonovich consistency of the Milstein speed map (1e-5 rms against a Heun scheme, wrong drift off by 3e-2), absent bath (density 0), particle lost mid-step, float64. The speed update v = sqrt(v1^2 + 4 D_par h) and the Lorentz l=1,2 eigenvalue test are kept.
  • Net for this commit: 19 files, +119 / -2425.

Checks

Remove the experimental split controllers and options that are not part of the
default path: full-step/two-half-step combined control, shared clock, the paper
and candidate Wiener look-ahead controllers (with the collision error model and
cumulative Brownian sampling they needed), the dense moment-defect reference
(now an independent oracle in the tests) and unused flags. solve_split keeps one
conservative collision controller; trace_split keeps "moments" and
"conservative". CollisionStep and SplitStats lose their experimental fields.

Add interpret=True to trace_split so the persistent GPU kernel can be run through
the Pallas interpreter on CPU, and fix CSE in the scalar lowering so a duplicate
of an equation with a dropped result no longer reads a dropped variable (this
broke the adaptive kernel on jax 0.6.2).

Tests: collision maps are checked against the Fokker-Planck generator (Lorentz
pitch-angle moments, speed drift/diffusion, Maxwellian stationarity, Einstein
relation), the Brownian bridge against its conditional law, Lie splitting
against its exact first-order weak and strong error, and the independent GPU
kernel against shared execution on coil, VMEC and Boozer fields.
Fold the one-function helper scripts into their callers (helix/mirror fields into
the coordinate benchmark, spatial and combined references into the Lorentz and
mirror references, event and conditional-noise helpers into the validators), drop
the paired-convergence script that rewrote solver source at run time, and adapt
the remaining scripts to the simplified solver API. Replace the two long result
reports with one record of the validated numbers, caveats and timings, keep five
figures, and shorten the README section to what users need.
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