Skip to content

Simplify native AD, its tests, examples and README - #198

Open
rogeriojorge wants to merge 13 commits into
feat/native_ad_splitfrom
simplify/native-ad
Open

rogeriojorge wants to merge 13 commits into
feat/native_ad_splitfrom
simplify/native-ad

Conversation

@rogeriojorge

@rogeriojorge rogeriojorge commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Simplifies the AD branch, stacked on #191 (base feat/native_ad_split).

What

  • Port of Simplify native split solver, tests and benchmarks #197 onto Add checkpointed reverse AD for native orbit and split-collision solvers #191's split.py, tests and benchmarks; simplification of Add checkpointed reverse AD for native orbit and split-collision solvers #191's own additions (native_ad.py, examples, README). Gradients are bitwise identical before and after in the benchmark cases listed in the earlier version of this description.
  • Latest commit: removes the committed results file, 5 figures, 10 reference/validation scripts that the tests now cover, the QI augmented-Lagrangian examples with their 2.7 MB wout and coil file, unused loss helpers and six wrapper examples. One AD example (optimize_coils_native_ad.py) and one split example (native_split_slowing_down.py) remain. README: one section each, no figures.
  • Tests added: Spitzer slowing down (10 keV and 500 eV), Ito/Stratonovich consistency of the Milstein speed map, absent bath, particle lost mid-step, float64. The v = sqrt(v1^2 + 4 D_par h) update and the existing gradient checks stay.
  • Net for this commit: 34 files, +195 / -3736.

Checks

Applies the changes of the split-solver simplification PR (split.py, its tests, benchmarks, results
and README) to the AD branch, keeping the accepted-map recording hooks and the AD-branch fix for the
scalar-lowering common-subexpression pass. The AD benchmark follows the reduced SplitStats.
native_ad.py: one tableau/dense selector, one shared checkpointed orbit reverse for the orbit and
split rules, one recorder configuration, no unused replay options. Tests check reverse gradients
against forward mode and finite differences through the frozen schedule, the adjoint identity,
checkpoint independence and conservation laws, and run the persistent GPU kernels through the Pallas
interpreter against shared reverse. The two particle-optimization examples are table-driven; the two
reference confinement scripts are one script. Unused legacy options of the particle objectives are
removed.
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