From bc0d221d3df3707b4ba6b2982a8247491c50cda3 Mon Sep 17 00:00:00 2001 From: thomvet Date: Fri, 8 Aug 2025 15:35:05 +0200 Subject: [PATCH 1/2] do not replace LazyBufferCache when promoting f --- src/solve.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/solve.jl b/src/solve.jl index 4e23cfd12..065ea1498 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -1421,7 +1421,8 @@ end hasdualpromote(u0, t) = true function promote_f(f::SplitFunction, ::Val{specialize}, u0, p, t) where {specialize} - typeof(f._func_cache) === typeof(u0) && isinplace(f) ? f : + (typeof(f._func_cache) === typeof(u0) || + typeof(f._func_cache) == PreallocationTools.LazyBufferCache) && isinplace(f) ? f : remake(f, _func_cache = zero(u0)) end prepare_alg(alg, u0, p, f) = alg From 5cb0e2734f75dba6e0a7940e8be1fca8616dd17f Mon Sep 17 00:00:00 2001 From: thomvet Date: Fri, 8 Aug 2025 16:02:57 +0200 Subject: [PATCH 2/2] scimlbase --- src/solve.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solve.jl b/src/solve.jl index 065ea1498..4249262ea 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -1422,7 +1422,7 @@ hasdualpromote(u0, t) = true function promote_f(f::SplitFunction, ::Val{specialize}, u0, p, t) where {specialize} (typeof(f._func_cache) === typeof(u0) || - typeof(f._func_cache) == PreallocationTools.LazyBufferCache) && isinplace(f) ? f : + typeof(f._func_cache) == SciMLBase.PreallocationTools.LazyBufferCache) && isinplace(f) ? f : remake(f, _func_cache = zero(u0)) end prepare_alg(alg, u0, p, f) = alg