Skip to content

refactor: update to new SciMLBase remake API hooks with context structs#4496

Merged
AayushSabharwal merged 4 commits into
masterfrom
as/scimlbase-ctx-api
Apr 28, 2026
Merged

refactor: update to new SciMLBase remake API hooks with context structs#4496
AayushSabharwal merged 4 commits into
masterfrom
as/scimlbase-ctx-api

Conversation

@AayushSabharwal
Copy link
Copy Markdown
Member

Supersedes #4474

ChrisRackauckas and others added 4 commits April 28, 2026 13:44
SciMLBase v3.1.0 (commit 09770ffa, 2026-04-10, "refactor: pass context
struct to late_binding_update_u0_p") added a trailing
`ctx::LateBindingUpdateU0PContext` argument (with default) that the v3
public path now forwards as an 8th positional. MTK's 7-arg overload no
longer dispatches; SciMLBase's 8-arg no-op fallback wins, so
`newp.initials` was never updated and `initialize_dae!` then re-solved
`u` against the stale `Initial` values. This surfaced as four failing
assertions in the OrdinaryDiffEq.jl `reinit! updates initial parameters`
testset (lib/OrdinaryDiffEqNonlinearSolve/test/modelingtoolkit/dae_initialize_integration.jl:98-101).

Wraps the original body in a small `_late_binding_update_u0_p_impl`
helper and dispatches via `@static if isdefined(SciMLBase,
:LateBindingUpdateU0PContext)` so the patch keeps working on the
SciMLBase v2 line that the package's `[compat]` still supports
(`SciMLBase = "2.149.0, 3"`). On v3.1.0+ the 8-arg method matches; on v2
the 7-arg method is defined as before.

Verified locally: with this patch and SciMLBase v3.6.0 resolved, the
OrdinaryDiffEq `reinit! updates initial parameters` testset goes from
4 fail / 4 pass to 8 / 8 pass.

Fixes #4473.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@AayushSabharwal AayushSabharwal merged commit 072d49b into master Apr 28, 2026
45 of 79 checks passed
@AayushSabharwal AayushSabharwal deleted the as/scimlbase-ctx-api branch April 28, 2026 10:32
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