Skip to content

Regression: remake does not respect specialization #925

@devmotion

Description

@devmotion

Describe the bug 🐞

remake(prob; f=f) drops the specialization of the provided function f. This is a regression compared with e.g. SciMLBase 2.38.0.

Expected behavior

The function of the constructed problem should have the same specialization as f.

Minimal Reproducible Example 👇

On the master branch:

julia> using SciMLBase

julia> f = ODEFunction{false,SciMLBase.FullSpecialize}((u, p, t) -> u);

julia> prob = ODEProblem(f, nothing, nothing);

julia> SciMLBase.specialization(prob.f)
SciMLBase.FullSpecialize

julia> prob2 = remake(ODEProblem((u, p, t) -> 2 .* u, nothing, nothing); f = f);

julia> SciMLBase.specialization(prob2.f)
SciMLBase.AutoSpecialize

With SciMLBase@2.38.0 on the other hand:

julia> using SciMLBase

julia> f = ODEFunction{false,SciMLBase.FullSpecialize}((u, p, t) -> u);

julia> prob = ODEProblem(f, nothing, nothing);

julia> SciMLBase.specialization(prob.f)
SciMLBase.FullSpecialize

julia> prob2 = remake(ODEProblem((u, p, t) -> 2 .* u, nothing, nothing); f = f);

julia> SciMLBase.specialization(prob2.f)
SciMLBase.FullSpecialize

Environment (please complete the following information):

  • Output of using Pkg; Pkg.status()
julia> using Pkg; Pkg.status()
Project SciMLBase v2.72.2
Status `~/.julia/dev/SciMLBase/Project.toml`
  [47edcb42] ADTypes v1.12.1
  [7d9f7c33] Accessors v0.1.41
  [4fba245c] ArrayInterface v7.18.0
  [38540f10] CommonSolve v0.2.4
  [187b0558] ConstructionBase v1.5.8
  [ffbed154] DocStringExtensions v0.9.3
  [4e289a0a] EnumX v1.0.4
⌅ [6b7a57c9] Expronicon v0.8.5
  [77dc65aa] FunctionWrappersWrappers v0.1.3
  [82899510] IteratorInterfaceExtensions v1.0.0
  [aea7be01] PrecompileTools v1.2.1
  [21216c6a] Preferences v1.4.3
  [3cdcf5f2] RecipesBase v1.3.4
  [731186ca] RecursiveArrayTools v3.29.0
  [189a3867] Reexport v1.2.2
  [7e49a35a] RuntimeGeneratedFunctions v0.5.13
  [c0aeaf25] SciMLOperators v0.3.12
  [53ae85a6] SciMLStructures v1.6.1
  [1e83bf80] StaticArraysCore v1.4.3
  [10745b16] Statistics v1.11.1
  [2efcf032] SymbolicIndexingInterface v0.3.37
  [8ba89e20] Distributed v1.11.0
  [37e2e46d] LinearAlgebra v1.11.0
  [56ddb016] Logging v1.11.0
  [d6f4376e] Markdown v1.11.0
  [de0858da] Printf v1.11.0
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated`
  • Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
julia> using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
Project SciMLBase v2.72.2
Status `~/.julia/dev/SciMLBase/Manifest.toml`
  [47edcb42] ADTypes v1.12.1
  [7d9f7c33] Accessors v0.1.41
  [79e6a3ab] Adapt v4.1.1
  [4fba245c] ArrayInterface v7.18.0
  [38540f10] CommonSolve v0.2.4
  [a33af91c] CompositionsBase v0.1.2
  [187b0558] ConstructionBase v1.5.8
  [9a962f9c] DataAPI v1.16.0
  [e2d170a0] DataValueInterfaces v1.0.0
  [ffbed154] DocStringExtensions v0.9.3
  [4e289a0a] EnumX v1.0.4
  [e2ba6199] ExprTools v0.1.10
⌅ [6b7a57c9] Expronicon v0.8.5
  [069b7b12] FunctionWrappers v1.1.3
  [77dc65aa] FunctionWrappersWrappers v0.1.3
  [46192b85] GPUArraysCore v0.2.0
  [3587e190] InverseFunctions v0.1.17
  [82899510] IteratorInterfaceExtensions v1.0.0
  [d8e11817] MLStyle v0.4.17
  [1914dd2f] MacroTools v0.5.15
  [bac558e1] OrderedCollections v1.8.0
  [aea7be01] PrecompileTools v1.2.1
  [21216c6a] Preferences v1.4.3
  [3cdcf5f2] RecipesBase v1.3.4
  [731186ca] RecursiveArrayTools v3.29.0
  [189a3867] Reexport v1.2.2
  [ae029012] Requires v1.3.0
  [7e49a35a] RuntimeGeneratedFunctions v0.5.13
  [c0aeaf25] SciMLOperators v0.3.12
  [53ae85a6] SciMLStructures v1.6.1
  [1e83bf80] StaticArraysCore v1.4.3
  [10745b16] Statistics v1.11.1
  [2efcf032] SymbolicIndexingInterface v0.3.37
  [3783bdb8] TableTraits v1.0.1
  [bd369af6] Tables v1.12.0
  [0dad84c5] ArgTools v1.1.2
  [56f22d72] Artifacts v1.11.0
  [2a0f44e3] Base64 v1.11.0
  [ade2ca70] Dates v1.11.0
  [8ba89e20] Distributed v1.11.0
  [f43a241f] Downloads v1.6.0
  [7b1f6079] FileWatching v1.11.0
  [b27032c2] LibCURL v0.6.4
  [76f85450] LibGit2 v1.11.0
  [8f399da3] Libdl v1.11.0
  [37e2e46d] LinearAlgebra v1.11.0
  [56ddb016] Logging v1.11.0
  [d6f4376e] Markdown v1.11.0
  [ca575930] NetworkOptions v1.2.0
  [44cfe95a] Pkg v1.11.0
  [de0858da] Printf v1.11.0
  [9a3f8284] Random v1.11.0
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization v1.11.0
  [6462fe0b] Sockets v1.11.0
  [fa267f1f] TOML v1.0.3
  [a4e569a6] Tar v1.10.0
  [cf7118a7] UUIDs v1.11.0
  [4ec0a83e] Unicode v1.11.0
  [e66e0078] CompilerSupportLibraries_jll v1.1.1+0
  [deac9b47] LibCURL_jll v8.6.0+0
  [e37daf67] LibGit2_jll v1.7.2+0
  [29816b5a] LibSSH2_jll v1.11.0+1
  [c8ffd9c3] MbedTLS_jll v2.28.6+0
  [14a3606d] MozillaCACerts_jll v2023.12.12
  [4536629a] OpenBLAS_jll v0.3.27+1
  [83775a58] Zlib_jll v1.2.13+1
  [8e850b90] libblastrampoline_jll v5.11.0+0
  [8e850ede] nghttp2_jll v1.59.0+0
  [3f19e933] p7zip_jll v17.4.0+2
  • Output of versioninfo()
julia> versioninfo()
Julia Version 1.11.2
Commit 5e9a32e7af2 (2024-12-01 20:02 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 10 × Apple M2 Pro
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m2)
Threads: 6 default, 0 interactive, 3 GC (on 6 virtual cores)
Environment:
  JULIA_PKG_USE_CLI_GIT = true
  JULIA_PKG_PRESERVE_TIERED_INSTALLED = true
  JULIA_EDITOR = code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions