From afc906e5bbcd1c4f406ea40be35f8244f60ff5ef Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Wed, 29 Jul 2026 18:21:44 -0400 Subject: [PATCH 1/3] Keep Default precompile helpers local Co-Authored-By: Chris Rackauckas --- .../src/OrdinaryDiffEqDefault.jl | 55 +++++++++++++------ lib/OrdinaryDiffEqDefault/test/qa/qa.jl | 6 -- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/lib/OrdinaryDiffEqDefault/src/OrdinaryDiffEqDefault.jl b/lib/OrdinaryDiffEqDefault/src/OrdinaryDiffEqDefault.jl index 281fd7d8ee..fa96a0696d 100644 --- a/lib/OrdinaryDiffEqDefault/src/OrdinaryDiffEqDefault.jl +++ b/lib/OrdinaryDiffEqDefault/src/OrdinaryDiffEqDefault.jl @@ -6,7 +6,6 @@ using OrdinaryDiffEqVerner: Vern7 using OrdinaryDiffEqTsit5: Tsit5 using OrdinaryDiffEqRosenbrock: Rosenbrock23, Rodas5P using OrdinaryDiffEqBDF: FBDF, DFBDF -import OrdinaryDiffEqCore import OrdinaryDiffEqCore: is_mass_matrix_alg, default_autoswitch, isdefaultalg import ADTypes: AutoFiniteDiff @@ -20,11 +19,31 @@ using SciMLBase: SciMLBase, ODEProblem, DAEProblem, solve include("default_alg.jl") +function _lorenz!(du, u, p, t) + du[1] = 10.0(u[2] - u[1]) + du[2] = u[1] * (28.0 - u[3]) - u[2] + return du[3] = u[1] * u[2] - (8 / 3) * u[3] +end + +function _lorenz_p!(du, u, p, t) + du[1] = p.σ * (u[2] - u[1]) + du[2] = u[1] * (p.ρ - u[3]) - u[2] + return du[3] = u[1] * u[2] - p.β * u[3] +end + +const _lorenz_p_params = (σ = 10.0, ρ = 28.0, β = 8 / 3) + +function _lorenz_pref!(du, u, p, t) + du[1] = p[1] * (u[2] - u[1]) + du[2] = u[1] * (p[2] - u[3]) - u[2] + return du[3] = u[1] * u[2] - p[3] * u[3] +end + +const _lorenz_pref_params = [10.0, 28.0, 8 / 3] + import PrecompileTools import Preferences PrecompileTools.@compile_workload begin - lorenz = OrdinaryDiffEqCore.lorenz - lorenz_oop = OrdinaryDiffEqCore.lorenz_oop solver_list = [] prob_list = [] @@ -45,22 +64,22 @@ PrecompileTools.@compile_workload begin end if Preferences.@load_preference("PrecompileDefaultSpecialize", true) - push!(prob_list, ODEProblem(lorenz, [1.0; 0.0; 0.0], (0.0, 1.0))) - push!(prob_list, ODEProblem(lorenz, [1.0; 0.0; 0.0], (0.0, 1.0), Float64[])) + push!(prob_list, ODEProblem(_lorenz!, [1.0; 0.0; 0.0], (0.0, 1.0))) + push!(prob_list, ODEProblem(_lorenz!, [1.0; 0.0; 0.0], (0.0, 1.0), Float64[])) end if Preferences.@load_preference("PrecompileAutoSpecialize", false) push!( prob_list, ODEProblem{true, SciMLBase.AutoSpecialize}( - lorenz, [1.0; 0.0; 0.0], + _lorenz!, [1.0; 0.0; 0.0], (0.0, 1.0) ) ) push!( prob_list, ODEProblem{true, SciMLBase.AutoSpecialize}( - lorenz, [1.0; 0.0; 0.0], + _lorenz!, [1.0; 0.0; 0.0], (0.0, 1.0), Float64[] ) ) @@ -74,16 +93,16 @@ PrecompileTools.@compile_workload begin if Preferences.@load_preference("PrecompileAutoDePSpecialize", true) push!( depspecialize_prob_list, - ODEProblem{true, OrdinaryDiffEqCore.AutoDePSpecialize}( - OrdinaryDiffEqCore.lorenz_p, [1.0; 0.0; 0.0], - (0.0, 1.0), OrdinaryDiffEqCore.lorenz_p_params + ODEProblem{true, SciMLBase.AutoDePSpecialize}( + _lorenz_p!, [1.0; 0.0; 0.0], + (0.0, 1.0), _lorenz_p_params ) ) push!( depspecialize_prob_list, - ODEProblem{true, OrdinaryDiffEqCore.AutoDePSpecialize}( - OrdinaryDiffEqCore.lorenz_pref, [1.0; 0.0; 0.0], - (0.0, 1.0), OrdinaryDiffEqCore.lorenz_pref_params + ODEProblem{true, SciMLBase.AutoDePSpecialize}( + _lorenz_pref!, [1.0; 0.0; 0.0], + (0.0, 1.0), _lorenz_pref_params ) ) append!(prob_list, depspecialize_prob_list) @@ -93,14 +112,14 @@ PrecompileTools.@compile_workload begin push!( prob_list, ODEProblem{true, SciMLBase.FunctionWrapperSpecialize}( - lorenz, [1.0; 0.0; 0.0], + _lorenz!, [1.0; 0.0; 0.0], (0.0, 1.0) ) ) push!( prob_list, ODEProblem{true, SciMLBase.FunctionWrapperSpecialize}( - lorenz, [1.0; 0.0; 0.0], + _lorenz!, [1.0; 0.0; 0.0], (0.0, 1.0), Float64[] ) ) @@ -109,12 +128,14 @@ PrecompileTools.@compile_workload begin if Preferences.@load_preference("PrecompileNoSpecialize", false) push!( prob_list, - ODEProblem{true, SciMLBase.NoSpecialize}(lorenz, [1.0; 0.0; 0.0], (0.0, 1.0)) + ODEProblem{true, SciMLBase.NoSpecialize}( + _lorenz!, [1.0; 0.0; 0.0], (0.0, 1.0) + ) ) push!( prob_list, ODEProblem{true, SciMLBase.NoSpecialize}( - lorenz, [1.0; 0.0; 0.0], (0.0, 1.0), + _lorenz!, [1.0; 0.0; 0.0], (0.0, 1.0), Float64[] ) ) diff --git a/lib/OrdinaryDiffEqDefault/test/qa/qa.jl b/lib/OrdinaryDiffEqDefault/test/qa/qa.jl index 36b7f71ee1..d7c8d14592 100644 --- a/lib/OrdinaryDiffEqDefault/test/qa/qa.jl +++ b/lib/OrdinaryDiffEqDefault/test/qa/qa.jl @@ -50,12 +50,6 @@ without_local_project_sources(OrdinaryDiffEqDefault) do # stale because of the unanalyzable enum submodule above. ignore = (:Tsit5, :Vern7, :Rosenbrock23, :Rodas5P, :FBDF), ), - all_qualified_accesses_are_public = (; - # `lorenz`/`lorenz_oop` are OrdinaryDiffEqCore precompile-workload - # test problems (defined in `precompilation_setup.jl`), deliberately - # not part of its public extension surface. - ignore = (:lorenz, :lorenz_oop, :lorenz_p, :lorenz_p_params), - ), ), api_docs_kwargs = (; rendered = false, From 3cde93041fc10656b73797111500491ed695305c Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Wed, 29 Jul 2026 20:39:54 -0400 Subject: [PATCH 2/3] Bump OrdinaryDiffEqDefault to 2.4.2 OrdinaryDiffEqDefault 2.4.1 is already registered, so the helper-localization fix must ship as a new patch release. Co-Authored-By: Chris Rackauckas --- lib/OrdinaryDiffEqDefault/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqDefault/Project.toml b/lib/OrdinaryDiffEqDefault/Project.toml index 673f20da40..e7e4e26163 100644 --- a/lib/OrdinaryDiffEqDefault/Project.toml +++ b/lib/OrdinaryDiffEqDefault/Project.toml @@ -1,7 +1,7 @@ name = "OrdinaryDiffEqDefault" uuid = "50262376-6c5a-4cf5-baba-aaf4f84d72d7" authors = ["ParamThakkar123 "] -version = "2.4.1" +version = "2.4.2" [deps] OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a" From 528e9b085851c01a542ce2839bbc3389b7c49ba0 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Wed, 29 Jul 2026 20:58:50 -0400 Subject: [PATCH 3/3] Require OrdinaryDiffEqCore 4.11 for Default Co-Authored-By: Chris Rackauckas --- lib/OrdinaryDiffEqDefault/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqDefault/Project.toml b/lib/OrdinaryDiffEqDefault/Project.toml index e7e4e26163..8b0ecdff89 100644 --- a/lib/OrdinaryDiffEqDefault/Project.toml +++ b/lib/OrdinaryDiffEqDefault/Project.toml @@ -55,7 +55,7 @@ PrecompileTools = "1.2.1, 1.3" EnumX = "1.0.4" LinearAlgebra = "1.10" SciMLBase = "3.39" -OrdinaryDiffEqCore = "4.8" +OrdinaryDiffEqCore = "4.11" SparseArrays = "1.10" Preferences = "1.5.0" StaticArrays = "1.9.18"