Use finite-difference AD for BVP default nonlinear solvers - #559
Use finite-difference AD for BVP default nonlinear solvers#559ChrisRackauckas-Claude wants to merge 5 commits into
Conversation
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
5cb261d to
a1ef939
Compare
Benchmark Results (Julia v1.11)Time benchmarks
Memory benchmarks
|
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
|
Verified against the clean current ModelingToolkit master downstream failure from SciML/ModelingToolkit.jl#4731. Baseline environment:
Baseline focused command: timeout 3600 env JULIA_DEPOT_PATH="$PWD/../mtkb-bvp-repro-depot" \
julia +1.12 --startup-file=no --project=../mtkb-bvp-repro-env \
lib/ModelingToolkitBase/test/bvproblem.jlIt reproduced the CI error in the first Lotka-Volterra MIRK solve after 2m00.2s: I then developed only this PR's This covers both errors from the ModelingToolkitBase InterfaceII job: Lotka-Volterra at For comparison, MIRK PR #542's type-adaptive interpolation cache removed the conversion error and made Lotka pass, but both cost-function assertions subsequently evaluated as |
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
|
CI audit for the red FIRK AD Julia 1.12 job: this is an exact clean- |
|
Final audit for the red FIRK NESTED job ( Environment: Julia 1.12.6, LinearSolve 4.3.0, BoundaryValueDiffEqCore 2.7.3, BoundaryValueDiffEqFIRK 1.17.2, SciMLBase 3.35.2, NonlinearSolveBase 2.34.1, NonlinearSolveFirstOrder 2.2.0, ForwardDiff 1.4.1. Case: Results:
The hosted job had already passed the basic FIRK NESTED block (223 pass / 26 broken) before reporting |
Ignore until reviewed by @ChrisRackauckas.
Summary
This changes the internal BVP-compatible default nonlinear solver polyalgorithms to use
AutoFiniteDiff()when no autodiff backend is specified.The master downgrade failures were coming from the downgraded NonlinearSolve stack selecting ForwardDiff through these internal defaults, which propagated dual numbers into user boundary-condition residual arrays and failed with
Float64(::ForwardDiff.Dual...).Validation
git diff --checkjulia +1 --startup-file=no --project=/home/crackauc/sandbox/tmp_20260708_121627_10236/runic_env -e 'using Runic; exit(Runic.main(["--check", "--verbose", "."]))'checked 110 files successfully.e2b50b00:BoundaryValueDiffEqShooting tests passedwithShooting Basic Problems Tests | 82 pass,Shooting NLLS Tests | 56 pass, andShooting Orbital Tests | 40 pass.e2b50b00:BoundaryValueDiffEqMIRK tests passedwithMIRK Basic Tests | 200 pass,MIRK NLLS Tests | 72 pass,MIRK Ensemble Tests | 10 pass,MIRK Singular BVP Tests | 8 pass,MIRK VectorOfVector Initials Tests | 2 pass, andMIRK Dynamic Optimization Tests | 6 pass.masteradvanced to4dfc3ef2via release-prep version-onlyProject.tomlbumps. I rebased over that and rerangit diff --checkplus Runic successfully.Master-failure investigation: reproduced on clean master and bisected the Shooting downgrade failure to
fe630c867aae5706a2e2a6edd1967519ec3c91f8, where the SciMLBase compat floor moved the downgraded stack to SciMLBase 3.30 / NonlinearSolveBase 2.33 / NonlinearSolveFirstOrder 2.1+.