Skip to content

Prepare default algorithms before AutoDespecialize concretization - #4247

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/prepare-default-alg-before-concretization
Aug 14, 2026
Merged

ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/prepare-default-alg-before-concretization

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

What changed

DiffEqBase now asks the public prepare_alg hook for a default algorithm before concretizing an AutoDespecialize problem. If a downstream package supplies one, the existing explicit-algorithm path uses it for autodiff/Jacobian preparation and wrapper construction before __solve or __init runs.

OrdinaryDiffEqDefault supplies its existing defaults through that hook:

  • ODEProblem → DefaultODEAlgorithm(autodiff=AutoFiniteDiff());
  • DAEProblem → DFBDF(autodiff=AutoFiniteDiff()).

The DAE default-solver regression uses AutoDespecialize, verifies that implicit and explicit DFBDF initialization produce identical concrete problem/cache types, and retains the exact trajectory comparison. This is the generic handoff required by the DAE precompile workloads in #4241.

Ignore this PR until it has been reviewed by @ChrisRackauckas.

Failing before

I removed only the new early prepare_alg call and ran the focused DiffEqBase Core regression. It failed:

High Level solve Interface | 17 pass / 1 error
Error: Default algorithm choices require DifferentialEquations.jl.

The existing OrdinaryDiffEqDefault discriminator also showed the incorrect late handoff when run against the generic change without the OrdinaryDiffEqDefault hook:

Default Solver Tests | 46 pass / 2 fail
naccept: 48 != 54
nf:      182 != 241

The implicit default concretized a generic four-signature function wrapper while the explicit default selected the algorithm-dependent autodiff/Jacobian path.

Passing after

The identical DiffEqBase regression passed 21/21, and the full DiffEqBase Core group passed.

An isolated environment developed this branch's local DiffEqBase, OrdinaryDiffEqBDF, and OrdinaryDiffEqDefault. The official Default test suite then passed:

Pkg.test("OrdinaryDiffEqDefault"; allow_reresolve=false)

Default Solver Tests | 48 pass / 48 total
Testing OrdinaryDiffEqDefault tests passed

The default init(prob) and explicit init(prob, DFBDF(autodiff=AutoFiniteDiff())) produced identical concrete problem/cache types, trajectories, and solver statistics.

Required QA passed:

DiffEqBase:             Aqua 9/9
OrdinaryDiffEqDefault: JET 1/1, Aqua 20/20

Julia Runic, typos over the diff, and git diff --check exited 0. No public API, docstring, or documentation changed, so a docs build was not required.

Not verified

GPU, Julia prerelease, and downstream package suites were not run locally.

@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title Prepare default algorithms before problem concretization Prepare default algorithms before AutoDespecialize concretization Aug 13, 2026
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 14, 2026 02:45
@ChrisRackauckas
ChrisRackauckas merged commit d9e4e26 into SciML:master Aug 14, 2026
238 of 273 checks passed
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.

2 participants