Repository navigation
Shape default initialization guesses for array derivatives - #5132
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Fixes SciML#5093 Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.154.0 Agent-Model: gpt-6-astra Agent-Session: local session ID 01a099aa-308a-7fd3-91bd-9fb2dc357b91
ChrisRackauckas-Claude
force-pushed
the
fix/array-derivative-initialization-guesses
branch
from
September 13, 2026 11:58
10beae0 to
832bcc2
Compare
This was referenced Sep 13, 2026
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.
Fixes #5093.
Default guesses for array derivatives now have the derivative's shape. Previously the initialization system stored a scalar
falsefor a whole-array dummy derivative, and reading its elements raisedMethodError: no method matching vec(::Bool). The change preserves scalar defaults and explicit user guesses.The regression constructs vector and matrix array-equation DAEs with initialization enabled and checks the initial states, derivatives, and residuals.
Regression evidence
Unfixed source:
Fixed source, same test:
Validation
Focused regression command (run before and after the source change):
TMPDIR="$PWD/tmp" /home/crackauc/.juliaup/bin/julia +1.12 --project=ModelingToolkit.jl/lib/ModelingToolkitBase ModelingToolkit.jl/lib/ModelingToolkitBase/test/array_initialization.jlFull Initialization group on rebased commit
832bcc22353a2fb553699db71248e0f59f72c9d4, based on upstream master21814d32c28572b27a77284f318d251a41c5a4c8:813 passes and 12 pre-existing broken tests; no test was skipped or changed to broken by this PR.
On rebased commit
832bcc22353a2fb553699db71248e0f59f72c9d4,GROUP=QA /home/crackauc/.juliaup/bin/julia +1.12 --project=ModelingToolkit.jl/lib/ModelingToolkitBase -e 'using Pkg; Pkg.test()'did not pass:The failed Aqua check is package-level JET analysis with 234 reports about generated Moshi variables. The existing standalone reproducer has four reports before Roger-luo/Moshi.jl#93 and zero with that patch. A controlled clean-master comparison analyzed the same 5,274 definitions with zero cached results: released Moshi produced 234 reports and failed (22m50.7s); the patch produced zero reports and passed (4m54.5s). This PR does not suppress reports or modify QA dependencies.
Runic 1.10.0, typos over the diff, and
git diff --checkpassed. Before rebasing, the direct regression was also rerun with--compiled-modules=existing: 6/6 passed (1m46.9s).The observed QA failure is tracked separately at #5063. Do not present it as passing. No docs or public API changes are included in this fix. GPU and Julia prerelease jobs have not been run locally.
CI failures at 10beae0
EnzymeNoTypeErroratCacheWriter{Any}through the despecialized-parameter barrier. The reduced workload passes 2/2 on the immediate parent of MTK commit07e618174820bbe7a2847cdbfd1ba1af6d854cbcand errors on that commit with identical dependencies; the unmodified SciMLBase control also fails. Reproducer and introduction evidence: Enzyme SCC initialization regresses at concretize_initializeprob on Julia 1.13 #5140 . Job: https://github.com/SciML/ModelingToolkit.jl/actions/runs/34750197165/job/103705242023 .0bba967daf57f802da4f393ecaa050d9b5f52811fails the same assertions with matching relevant dependency versions: https://github.com/SciML/ModelingToolkit.jl/actions/runs/34746574660/job/103696201760 . Existing report with a standalone counterexample for the underdetermined test problem: NNPDE1 PDE IV test is underdetermined on the full square (standalone counterexample) NeuralPDE.jl#1164 . PR job: https://github.com/SciML/ModelingToolkit.jl/actions/runs/34750197165/job/103705241893 .9.898834314793689e154versus finite difference-1.1538935724475508(initializationsystem.jl:2313); 690 pass / 1 fail / 12 pre-existing broken. Job: https://github.com/SciML/ModelingToolkit.jl/actions/runs/34750197557/job/103705298038 . The exact-base CI job passes with all 283 extracted package/version entries matching: https://github.com/SciML/ModelingToolkit.jl/actions/runs/34746575017/job/103695518610 . The isolated original testsets also pass on clean base, including a control changing only SCCNonlinearSolve 1.13.0 to 1.15.0. Paired full official Initialization runs now also pass locally with the pinned CI manifest, coverage, and exact CI startup flags: clean base 767 pass / 12 pre-existing broken (2139.55s); original PR commit10beae085773 pass / 12 pre-existing broken (2066.36s), both exit 0. Each includes the full preceding test/load order and 691 passing InitializationSystem assertions. After rebasing onto upstream master21814d32c, the refreshed downgrade Initialization CI job also passed: 813 pass / 12 pre-existing broken, including 731 InitializationSystem assertions. Verified log: https://github.com/SciML/ModelingToolkit.jl/actions/runs/34755813322/job/103720754513 . Neither a cause nor a dependency-floor fix has been established; the original failure did not repeat and remains unexplained.Refreshed CI at 832bcc2
SciMLSensitivity Core8: 59 pass / 20 errors / 5 pre-existing broken. The existing CacheWriter
EnzymeNoTypeErrorrepeats, and 19 additional callback tests fail converting aFakeIntegratorwith aSizedVectorstate to one specialized forMVector. The exact unmodified rebase target21814d32cfails identically: https://github.com/SciML/ModelingToolkit.jl/actions/runs/34753467083/job/103719302234 . Refreshed PR job: https://github.com/SciML/ModelingToolkit.jl/actions/runs/34755812885/job/103719876560 . The new conversion failures reproduce without ModelingToolkit on clean SciMLSensitivity master. Public reproducer, latent source history, and a locally tested one-line candidate are documented at Continuous-callback adjoints fail converting FakeIntegrator state from SizedVector to MVector SciMLSensitivity.jl#1660 . The MTK trigger boundary remains pending; the candidate has not received full-suite validation.Downgrade Initialization passed with 813 passes and 12 pre-existing broken tests, as detailed above.
ModelingToolkitBase QA repeated the same 234 Moshi reports: JET 54/54; Aqua 20 pass / 1 fail. Completed log: https://github.com/SciML/ModelingToolkit.jl/actions/runs/34755813278/job/103724682492 .
NeuralPDE NNPDE1 repeated the same two PDE-IV assertion failures at lines 105–106; the completed log was inspected. Job: https://github.com/SciML/ModelingToolkit.jl/actions/runs/34755812885/job/103719876456 . This remains the separately reproduced baseline failure tracked at NNPDE1 PDE IV test is underdetermined on the full square (standalone counterexample) NeuralPDE.jl#1164 .
Please ignore this draft until reviewed by @ChrisRackauckas.
🤖 Generated with Codex CLI 0.154.0 (model: gpt-6-astra; local session ID: 01a099aa-308a-7fd3-91bd-9fb2dc357b91).