Replace OrdinaryDiffEq weakdep with OrdinaryDiffEqSymplecticRK#496
Open
ChrisRackauckas-Claude wants to merge 1 commit intoTuringLang:mainfrom
Open
Replace OrdinaryDiffEq weakdep with OrdinaryDiffEqSymplecticRK#496ChrisRackauckas-Claude wants to merge 1 commit intoTuringLang:mainfrom
ChrisRackauckas-Claude wants to merge 1 commit intoTuringLang:mainfrom
Conversation
The DiffEqIntegrator extension only ever used the symplectic solvers (VerletLeapfrog and friends) plus the standard `init`/`step!`/ `DynamicalODEProblem` interface. None of that requires the full OrdinaryDiffEq meta-package; everything lives in or is re-exported by OrdinaryDiffEqSymplecticRK. Switching the weakdep from OrdinaryDiffEq → OrdinaryDiffEqSymplecticRK: - Drops the heavy meta-package: users no longer pull in BDF, Rosenbrock, Tsit5, Verner, Default, OrdinaryDiffEqCore, NonlinearSolve, LinearSolve, etc. just to use a leapfrog integrator inside HMC. - Makes the dependency graph honest about what the extension actually uses (symplectic RK methods only). - Sidesteps the OrdinaryDiffEq v6 ↔ v7 compat ratchet entirely: OrdinaryDiffEqSymplecticRK v1 (works against OrdinaryDiffEq v6) and v2 (works against v7) both expose the same surface, so compat is just `"1, 2"`. - Aligns with the v7 ecosystem story: in v7 `VerletLeapfrog` no longer re-exports out of OrdinaryDiffEq itself (it lives in the symplectic sublib), so depending on the sublib directly is the forward-compatible shape. Renames: - weakdep `OrdinaryDiffEq` → `OrdinaryDiffEqSymplecticRK` - extension module `AdvancedHMCOrdinaryDiffEqExt` → `AdvancedHMCOrdinaryDiffEqSymplecticRKExt` - extension file matched Updates `test/runtests.jl`, `test/integrator.jl`, the `register_error_hint` message, and the inline source comment in `src/integrator.jl` to refer to the new package name. Verified locally on Julia 1.10: - AHMC_TEST_GROUP=AdvancedHMC: 5052 tests, exit 0, no errors - Integrator subtests: 35/35 pass - Numerical equivalence: DiffEqIntegrator(VerletLeapfrog()) matches native Leapfrog bit-for-bit over 1000 steps; Hamiltonian drift ~1.7e-5 over the same trajectory. Unblocks downstream Turing v0.45 + SciML stack composition (e.g. SciMLExpectations.jl docs). Co-Authored-By: Chris Rackauckas <[email protected]>
fa28d9f to
3bb142f
Compare
Contributor
|
This version I think is better, just moving to the smaller dep that you actually use. I think this is good to go. |
Merged
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR should be ignored until reviewed by @ChrisRackauckas.
Summary
Replaces the
OrdinaryDiffEqweakdep with the smallerOrdinaryDiffEqSymplecticRKsub-package. TheDiffEqIntegratorextension only ever used the symplectic solvers (VerletLeapfrogand friends) plus the standardinit/step!/DynamicalODEProbleminterface — none of which requires the full meta-package.Why
OrdinaryDiffEqv6 ↔ v7 compat ratchet entirely.OrdinaryDiffEqSymplecticRKv1 (built againstOrdinaryDiffEqv6) and v2 (built against v7) both expose the same surface, so compat is just"1, 2".OrdinaryDiffEqv7,VerletLeapfrogno longer re-exports out ofOrdinaryDiffEqitself (it lives in the symplectic sublib). Depending on the sublib directly is the forward-compatible shape.Turingv0.45 + SciML stack composition (e.g.SciMLExpectations.jl/docs), whereTuring 0.45 → AdvancedHMC ≥ 0.8.3andOrdinaryDiffEq 7cannot currently coexist due to theOrdinaryDiffEq = "6"weakdep compat.Changes
Project.toml: weakdepOrdinaryDiffEq→OrdinaryDiffEqSymplecticRK; extension entry, compat ("1, 2"), and[extras]updated.ext/AdvancedHMCOrdinaryDiffEqExt.jl→ext/AdvancedHMCOrdinaryDiffEqSymplecticRKExt.jl(rename + module name + import).test/runtests.jl,test/integrator.jl: switchusing OrdinaryDiffEqtousing OrdinaryDiffEqSymplecticRK.src/AdvancedHMC.jl:register_error_hintmessage updated ("Did you forget to loadOrdinaryDiffEqSymplecticRK?").src/integrator.jl: inline comment updated.Verification
Tested locally on Julia 1.10:
AHMC_TEST_GROUP=AdvancedHMCtest suite: 5052 tests, exit 0, no errors.Integratortestset: 35/35 pass.DiffEqIntegrator(VerletLeapfrog())produces bit-identical trajectories to nativeLeapfrogover 1000 steps; Hamiltonian drift ~1.7e-5 over the same trajectory.Relation to existing CompatHelper PRs
CompatHelper opened #494 and #495 with the simpler compat-only bump on the
OrdinaryDiffEqweakdep ("6"→"6, 7"). That approach works but keeps the whole meta-package as a dep, and breaks the existingtest/integrator.jltest which referencesOrdinaryDiffEq.VerletLeapfrog(in v7 that name moved toOrdinaryDiffEqSymplecticRK). This PR avoids both problems by depending on the sublib directly. Closing #494 and #495 in favor of this would be reasonable.Test plan
OrdinaryDiffEqSymplecticRKv1 and v2AdvancedHMCtest group passes locally on Julia 1.10DiffEqIntegrator(VerletLeapfrog())matches nativeLeapfrognumerically🤖 Generated with Claude Code