Repository navigation
Fix reinit! to propagate Initial(...) params with SciMLBase 3.6 - #3577
Merged
ChrisRackauckas merged 2 commits intoApr 28, 2026
Merged
ChrisRackauckas merged 2 commits into
ChrisRackauckas merged 2 commits into
Conversation
SciMLBase 3.6.0 added a `LateBindingUpdateU0PContext` argument to `late_binding_update_u0_p`. The 6-arg wrapper now forwards through a new 8-arg `(prob, root_indp, u0, p, t0, newu0, newp, ctx)` overload, so MTK's existing 7-arg overload `(prob, sys::AbstractSystem, ...)` is never reached. As a result, `reinit!(integrator, new_u0)` no longer propagated the new state into `Initial(x)` / `Initial(y)` parameters, leaving both the `integ.ps[Initial(...)]` values and `integ[x]` / `integ[y]` stale. Sidestep the new context-aware dispatch by computing `root_indp` here and calling the 7-arg form directly, which still hits MTK's overload. Fixes the four `reinit!` updates initial parameters` failures in `lib/OrdinaryDiffEqNonlinearSolve/test/modelingtoolkit/dae_initialize_integration.jl`. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
3 tasks
ChrisRackauckas
added a commit
that referenced
this pull request
May 27, 2026
`benchmark.yml` already pins the depot path with the comment "Force consistent Julia depot path for self-hosted runners" (#3577). The same workaround is needed in `CI.yml` and `SublibraryCI.yml`, where self-hosted runners labeled `ubuntu-latest` (demeter3-*, deepsea4-*) intermittently fail with `expected package X to be registered` (X = FastBroadcast / ADTypes / SciMLBase / CoverageTools / etc.) during `Pkg.develop`. Mechanism (reconstructed from a SublibraryCI log on PR #3407 where this fired): 1. The "Refresh General registry" step runs `julia --project=. {0}` with no env, so DEPOT_PATH defaults to `~/.julia` = `/home/chrisrackauckas/.julia`. `Pkg.Registry.add(General.git)` writes the fresh registry there. (Log shows the pidfile at `/home/chrisrackauckas/.julia/registries/.pid`.) 2. `julia-actions/julia-runtest@v1` invokes Julia through the action wrapper, which on a self-hosted runner picks up the runner-injected `JULIA_DEPOT_PATH=~/github-runners/<name>/.julia` instead. (Log shows "Updating registry at ~/github-runners/demeter3-12/.julia/registries/HolyLabRegistry".) 3. That per-runner depot is missing the General registry refreshed in step 1, so `Pkg.develop` fails with "expected package FastBroadcast [7034ab61] to be registered". Pinning `JULIA_DEPOT_PATH: ~/.julia` at the job level forces every step (refresh, buildpkg, runtest) to read and write the same depot, so the freshly-added General registry is visible to subsequent resolve calls. This is the same fix `benchmark.yml` already deploys, just extended to the other two workflows that run against self-hosted runners. Co-authored-by: ChrisRackauckas-Claude <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.
Summary
Fixes 4 pre-existing master failures in
OrdinaryDiffEqNonlinearSolve_ModelingToolkitCI (e.g. https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/25053979241/job/73389128637) — the\reinit!` updates initial parameterstestset inlib/OrdinaryDiffEqNonlinearSolve/test/modelingtoolkit/dae_initialize_integration.jl` (lines 98-101).Root cause
SciMLBase 3.6.0 added a
LateBindingUpdateU0PContextparameter tolate_binding_update_u0_p. Its 6-arg wrapper now forwards through a new 8-arg(prob, root_indp, u0, p, t0, newu0, newp, ctx)overload, which dispatches to the SciMLBase identity stub. MTK's existing 7-arg overloadlate_binding_update_u0_p(prob, sys::AbstractSystem, u0, p, t0, newu0, newp)(withoutctx) is no longer reached fromreinit!. As a result,reinit!(integrator, new_u0)stops propagating the new state intoInitial(x)/Initial(y)parameters: bothinteg.ps[Initial(x)]/integ.ps[Initial(y)]andinteg[x]/integ[y]stay at their pre-reinit!values.This is dispatch-driven and does not show up at all under SciMLBase < 3.6.
Fix
In
OrdinaryDiffEqCore'sreinit!, sidestep the new context-aware dispatch by computingroot_indp = SciMLBase.get_root_indp(integrator.sol.prob)ourselves and calling the 7-arg formlate_binding_update_u0_p(prob, root_indp, u0, ..., newp)(noctx). That form still dispatches to MTK's 7-arg overload, which is the path that actually updates theInitial(...)parameters inMTKParameters.initials.This keeps the change scoped to ODE Core (one-line plus comment) and works whether MTK upgrades to overload the new 8-arg form or not.
Test plan
~/.juliaup/bin/julia +1.11 --project=lib/OrdinaryDiffEqNonlinearSolve/test/modelingtoolkit lib/OrdinaryDiffEqNonlinearSolve/test/modelingtoolkit/dae_initialize_integration.jlagainst master — 4 fails onreinit!testsetreinit!updates initial parameters: 8/8lib/OrdinaryDiffEqCore/src/integrators/integrator_interface.jlOrdinaryDiffEqNonlinearSolve_ModelingToolkitto confirm green