Skip to content

fix: let the despecialization barrier accept unwrapped parameters - #4297

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-despecialization-zero-wrappers
Aug 21, 2026
Merged

fix: let the despecialization barrier accept unwrapped parameters#4297
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-despecialization-zero-wrappers

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Aug 18, 2026

Copy link
Copy Markdown
Member

Please ignore this PR until reviewed by @ChrisRackauckas.

What changed and why

Allow the parameter-despecialization barrier to receive zero DespecializedParameters wrappers and pass that call through unchanged. DAE initialization wraps its residual in a NonlinearFunction, which unwraps parameters before forwarding to the outer AutoDespecialize function; the barrier therefore re-enters with zero wrappers and previously threw. More than one wrapper remains an error.

The branch is rebuilt as one commit on current master while preserving the original author and the required Chris Rackauckas co-author trailer. DiffEqBase is bumped from 7.18.0 to 7.18.1.

Failing before / passing after

With the checked-in regression test present and the source fix reverted, the full DiffEqBase Core group fails:

the barrier accepts already-unwrapped parameters: Error During Test
Expression: DiffEqBase._invoke_parameter_despecialization(collect_args, (1, p, 2)) == (1, p, 2)
a parameter-despecialization barrier requires exactly one parameter wrapper
Despecialized-p Hook | Pass 45 Fail 1 Error 1 Total 47
ERROR: Package DiffEqBase errored during testing

With the fix restored, the identical full Core command passes:

Despecialized-p Hook | Pass 47 Total 47
Testing DiffEqBase tests passed

The public DAE reproducer also reaches a successful solve and satisfies its algebraic constraint:

retcode=Success, constraint=1.0

Local verification

  • GROUP=Core julia +1.12 --startup-file=no --project=lib/DiffEqBase -e 'using Pkg; Pkg.test()': passed on current master; the discriminating hook is 47/47.
  • GROUP=QA julia +1.12 --startup-file=no --project=lib/DiffEqBase -e 'using Pkg; Pkg.test()': Aqua 9/9; package tests passed.
  • Standalone public DAE solve using DFBDF, AutoDespecialize, and BrownFullBasicInit: retcode=Success, constraint sum 1.0.
  • Runic --check --diff, typos on all changed files, and git diff --check: passed.

The complete Downstream/Downstream2, GPU, and prerelease-Julia groups were not run locally. The public DAE reproducer covers the observed behavior, while the full Core and QA groups cover the changed DiffEqBase package.

`_invoke_parameter_despecialization` required exactly one
`DespecializedParameters` argument. A caller that has already unwrapped the
parameters re-enters the barrier with them passed concretely, which errored.

DAE initialization does exactly this: `BrownFullBasicInit` wraps the residual in
a `NonlinearFunction`, whose call unwraps the parameters before forwarding to
the outer `AutoDespecialize` function. Any `DAEProblem` needing a consistent
initialization solve therefore failed once `AutoDespecialize` became the
default.

Accept zero wrappers and pass the call through, mirroring SciMLBase's own
`invoke_with_despecialized_parameters`.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

The requested DiffEqBase source change triggered the full matrix. The completed run produced 268 completed CPU checks (236 success, 28 failure, 3 skipped, 1 cancelled); the remaining GPU jobs were queued/running when the branch was rebased. Every red CPU job is now assigned:

Full triggered CPU/GPU workflow: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/32391249144
Sublibrary workflow: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/32391250140
Downgrade-sublibrary workflow: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/32391248972
Downstream workflow: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/32391247975

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Final OrdinaryDiffEq follow-ups from the matrix are now published: the Julia 1.10 initdt forward-mode verifier fix is #4327 (QA 92/92; Interface I green with #4261; AD 28,302/28,302 with #4242), and the fixed-step multistep convergence fix is the stacked #4328 (Core 891 pass/40 pre-existing broken; ModelingToolkit and QA green). No CPU failure from the triggered matrix remains unassigned.

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 21, 2026 05:55
@ChrisRackauckas
ChrisRackauckas merged commit f2ebdb9 into SciML:master Aug 21, 2026
318 of 352 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.

3 participants