From 4d83a2219aa2577fd8d00621e0c2d75f14159518 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Sat, 26 Jul 2025 22:11:43 +0530 Subject: [PATCH 1/4] fix: fix type-instability of `get_root_indp` --- src/solutions/save_idxs.jl | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/solutions/save_idxs.jl b/src/solutions/save_idxs.jl index 6e4afbd33..7a2db44e6 100644 --- a/src/solutions/save_idxs.jl +++ b/src/solutions/save_idxs.jl @@ -44,12 +44,30 @@ function as_diffeq_array(vt::Vector{VectorTemplate}, t) return DiffEqArray(typeof(TupleOfArraysWrapper(vt))[], t, (1, 1)) end -function get_root_indp(indp) - if hasmethod(symbolic_container, Tuple{typeof(indp)}) && - (sc = symbolic_container(indp)) !== indp - return get_root_indp(sc) +function get_root_indp(prob::AbstractSciMLProblem) + get_root_indp(prob.f) +end + +function get_root_indp(f::T) where {T <: AbstractSciMLFunction} + if hasfield(T, :sys) + return f.sys + elseif hasfield(T, :f) && f.f isa AbstractSciMLFunction + return get_root_indp(f.f) + else + return nothing end - return indp +end + +function get_root_indp(prob::LinearProblem) + get_root_indp(prob.f) +end + +get_root_indp(prob::AbstractJumpProblem) = get_root_indp(prob.prob) + +get_root_indp(x) = x + +function get_root_indp(f::SymbolicLinearInterface) + get_root_indp(f.sys) end # Everything from this point on is public API From 3393e16eb0b43f8e1498cb9a224c090b15ca172c Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 24 Oct 2025 17:26:23 +0530 Subject: [PATCH 2/4] test: `init(::SteadyStateProblem)` now works --- test/downstream/comprehensive_indexing.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/downstream/comprehensive_indexing.jl b/test/downstream/comprehensive_indexing.jl index cd01bb4b4..41ac6135f 100644 --- a/test/downstream/comprehensive_indexing.jl +++ b/test/downstream/comprehensive_indexing.jl @@ -83,7 +83,7 @@ begin sint = init(sprob, ImplicitEM(); save_everystep = false) jint = init(jprob, SSAStepper()) nint = init(nprob, NewtonRaphson(); save_everystep = false) - @test_broken ssint = init(ssprob, DynamicSS(Tsit5()); save_everystep = false) # https://github.com/SciML/SteadyStateDiffEq.jl/issues/79 + ssint = init(ssprob, DynamicSS(Tsit5()); save_everystep = false) integrators = [oint, sint, jint, nint] integsystems = [osys, ssys, jsys, nsys] From dd507193d094745891d8fe055c62a902083555b7 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 24 Oct 2025 17:40:47 +0530 Subject: [PATCH 3/4] test: only run Zygote tests below Julia 1.12 --- test/runtests.jl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 8ab4b657d..0b91d06c1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -95,8 +95,10 @@ end @time @safetestset "Integer idxs" begin include("downstream/integer_idxs.jl") end - @time @safetestset "Autodiff Remake" begin - include("downstream/remake_autodiff.jl") + if VERSION < v"1.12" # Zygote is incredibly broken on 1.12 + @time @safetestset "Autodiff Remake" begin + include("downstream/remake_autodiff.jl") + end end @time @safetestset "Partial Functions" begin include("downstream/partial_functions.jl") @@ -134,8 +136,10 @@ end @time @safetestset "Problem Indexing" begin include("downstream/problem_interface.jl") end - @time @safetestset "Adjoints" begin - include("downstream/adjoints.jl") + if VERSION < v"1.12" # Zygote is incredibly broken on 1.12 + @time @safetestset "Adjoints" begin + include("downstream/adjoints.jl") + end end @time @safetestset "ModelingToolkit Remake" begin include("downstream/modelingtoolkit_remake.jl") From ebfe98347a52e2b5b7a6b4d1fc83ea7c7f59f259 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 24 Oct 2025 18:46:29 +0530 Subject: [PATCH 4/4] test: import SciMLSensitivity in test --- test/downstream/observables_autodiff.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/downstream/observables_autodiff.jl b/test/downstream/observables_autodiff.jl index 537a81bdb..222ca8e7f 100644 --- a/test/downstream/observables_autodiff.jl +++ b/test/downstream/observables_autodiff.jl @@ -5,6 +5,7 @@ import SymbolicIndexingInterface as SII import SciMLStructures as SS using ModelingToolkitStandardLibrary import ModelingToolkitStandardLibrary as MSL +using SciMLSensitivity @parameters σ ρ β @variables x(t) y(t) z(t) w(t)