Skip to content

Commit 6ae6ec4

Browse files
Merge pull request #1203 from ChrisRackauckas-Claude/fix-split-cache-copy
Partial revert of PR #1188: Copy cache for SplitFunction in promote_f
2 parents 7e3ecf1 + 2817983 commit 6ae6ec4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/solve.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,14 @@ end
865865

866866
hasdualpromote(u0, t) = true
867867

868-
promote_f(f::SplitFunction, ::Val{specialize}, u0, p, t) where {specialize} = f
868+
function promote_f(f::SplitFunction, ::Val{specialize}, u0, p, t) where {specialize}
869+
if isnothing(f._func_cache)
870+
f
871+
else
872+
# Copy the cache to ensure it's properly initialized
873+
remake(f, _func_cache = copy(f._func_cache))
874+
end
875+
end
869876
prepare_alg(alg, u0, p, f) = alg
870877

871878
function get_concrete_tspan(prob, isadapt, kwargs, p)

0 commit comments

Comments
 (0)