Skip to content

Bump RecursiveArrayTools and SciMLBase compat to also allow 4 / 3#214

Merged
MilesCranmer merged 1 commit into
JuliaPhysics:mainfrom
ChrisRackauckas-Claude:bump-sciml-compat-4-3
Apr 22, 2026
Merged

Bump RecursiveArrayTools and SciMLBase compat to also allow 4 / 3#214
MilesCranmer merged 1 commit into
JuliaPhysics:mainfrom
ChrisRackauckas-Claude:bump-sciml-compat-4-3

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Summary

DynamicQuantitiesRecursiveArrayToolsExt and DynamicQuantitiesSciMLBaseExt were introduced in #201 with RecursiveArrayTools = "3" / SciMLBase = "2" in compat. The SciML ecosystem has since moved to RecursiveArrayTools 4 and SciMLBase 3, which forces Pkg to resolve DynamicQuantities back to v1.11.0 (the last version without the weak-dep constraint) in any environment that pulls recent DifferentialEquations / OrdinaryDiffEq. That means neither SciML-facing extension loads, and downstream solvers trip over things like zero(::Type{<:Quantity}) and recursive_unitless_bottom_eltype(::Type{<:Quantity}) returning a still-unitful type.

Change

-RecursiveArrayTools = "3"
-SciMLBase = "2"
+RecursiveArrayTools = "3, 4"
+SciMLBase = "2, 3"

The extension code only touches stable public APIs across these major versions:

  • SciMLBase.value, SciMLBase.unitfulvalue — unchanged surface in SciMLBase 3.
  • RecursiveArrayTools.recursive_unitless_eltype, recursive_unitless_bottom_eltype — unchanged in RAT 4.

Verification

Ran test/test_sciml.jl locally on a fork with:

[06fc5a27] DynamicQuantities v1.12.1 (this branch)
[731186ca] RecursiveArrayTools v4.2.0
[0bca4576] SciMLBase v3.3.0
Test Summary:       | Pass  Total  Time
SciMLBase extension |   12     12  0.6s
Test Summary:                 | Pass  Total  Time
RecursiveArrayTools extension |    8      8  0.0s

Downstream motivation

This unblocks SciML/OrdinaryDiffEq.jl#3493, which is currently carrying duplicate overrides in DiffEqBaseDynamicQuantitiesExt.jl for SciMLBase.value, SciMLBase.unitfulvalue, RecursiveArrayTools.recursive_unitless_bottom_eltype, and recursive_unitless_eltype — exactly the methods this package already defines — purely because Pkg can't pick up the extension-carrying version. Once a patch release with this bump is out, those workarounds can be removed.

Test plan

  • test/test_sciml.jl passes under RAT 4 + SciMLBase 3
  • CI green

`DynamicQuantitiesRecursiveArrayToolsExt` and `DynamicQuantitiesSciMLBaseExt`
were added in JuliaPhysics#201 with `RecursiveArrayTools = "3"` / `SciMLBase = "2"` in
compat. The SciML ecosystem has since moved to RecursiveArrayTools 4 and
SciMLBase 3, which forces Pkg to resolve DynamicQuantities back to v1.11.0
(the last version without the weak-dep constraint) in any environment
pulling recent DifferentialEquations. That in turn means neither extension
loads and downstream solvers trip over `zero(::Type{<:Quantity})` /
`recursive_unitless_bottom_eltype(::Type{<:Quantity})` returning a
still-unitful type.

The extensions touch only `SciMLBase.value` / `unitfulvalue` and
`RecursiveArrayTools.recursive_unitless_(bottom_)eltype` — all stable APIs
across these major versions. Verified: `test/test_sciml.jl` passes on a fork
that pulls `RecursiveArrayTools v4.2.0` and `SciMLBase v3.3.0`.

This lets downstream packages (OrdinaryDiffEq.jl in particular — see
SciML/OrdinaryDiffEq.jl#3493) drop their in-tree DQ-wrapper-stripping
workarounds once a DQ patch with this bump is released.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1.10)

Time benchmarks
main 87f9d36... main / 87f9d36...
Quantity/creation/Quantity(x) 3.13 ± 0.0093 ns 3.48 ± 0.01 ns 0.9 ± 0.0037
Quantity/creation/Quantity(x, length=y) 3.48 ± 0.01 ns 3.48 ± 0.001 ns 1 ± 0.0029
Quantity/with_numbers/*real 3.14 ± 0.01 ns 3.48 ± 0 ns 0.902 ± 0.0029
Quantity/with_numbers/^int 8.39 ± 2.4 ns 8.39 ± 2.8 ns 1 ± 0.44
Quantity/with_numbers/^int * real 8.39 ± 2.8 ns 8.74 ± 2.1 ns 0.96 ± 0.39
Quantity/with_quantity/+y 4.16 ± 0.04 ns 3.86 ± 0.03 ns 1.08 ± 0.013
Quantity/with_quantity//y 3.5 ± 0.01 ns 3.48 ± 0.01 ns 1 ± 0.0041
Quantity/with_self/dimension 3.13 ± 0.01 ns 3.48 ± 0.001 ns 0.9 ± 0.0029
Quantity/with_self/inv 3.48 ± 0.01 ns 3.48 ± 0.01 ns 1 ± 0.0041
Quantity/with_self/ustrip 3.13 ± 0.001 ns 3.13 ± 0.001 ns 1 ± 0.00045
QuantityArray/broadcasting/multi_array_of_quantities 0.152 ± 0.01 ms 0.149 ± 0.0026 ms 1.02 ± 0.072
QuantityArray/broadcasting/multi_normal_array 0.0599 ± 0.0035 ms 0.056 ± 0.0035 ms 1.07 ± 0.091
QuantityArray/broadcasting/multi_quantity_array 0.173 ± 0.0021 ms 0.173 ± 0.0016 ms 0.999 ± 0.015
QuantityArray/broadcasting/x^2_array_of_quantities 28.8 ± 2.3 μs 28.5 ± 2.1 μs 1.01 ± 0.11
QuantityArray/broadcasting/x^2_normal_array 4.53 ± 0.45 μs 4.3 ± 0.47 μs 1.05 ± 0.16
QuantityArray/broadcasting/x^2_quantity_array 8.89 ± 0.44 μs 8.59 ± 0.63 μs 1.04 ± 0.092
QuantityArray/broadcasting/x^4_array_of_quantities 0.0897 ± 0.0021 ms 0.0892 ± 0.0021 ms 1.01 ± 0.034
QuantityArray/broadcasting/x^4_normal_array 0.0561 ± 0.0035 ms 0.0526 ± 0.0034 ms 1.07 ± 0.096
QuantityArray/broadcasting/x^4_quantity_array 0.0562 ± 0.0035 ms 0.0564 ± 0.0035 ms 0.996 ± 0.087
time_to_load 0.21 ± 0.002 s 0.21 ± 0.00064 s 1 ± 0.01
Memory benchmarks
main 87f9d36... main / 87f9d36...
Quantity/creation/Quantity(x) 0 allocs: 0 B 0 allocs: 0 B
Quantity/creation/Quantity(x, length=y) 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_numbers/*real 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_numbers/^int 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_numbers/^int * real 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_quantity/+y 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_quantity//y 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_self/dimension 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_self/inv 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_self/ustrip 0 allocs: 0 B 0 allocs: 0 B
QuantityArray/broadcasting/multi_array_of_quantities 2 allocs: 0.382 MB 2 allocs: 0.382 MB 1
QuantityArray/broadcasting/multi_normal_array 2 allocs: 0.0763 MB 2 allocs: 0.0763 MB 1
QuantityArray/broadcasting/multi_quantity_array 2 allocs: 0.0763 MB 2 allocs: 0.0763 MB 1
QuantityArray/broadcasting/x^2_array_of_quantities 2 allocs: 0.382 MB 2 allocs: 0.382 MB 1
QuantityArray/broadcasting/x^2_normal_array 2 allocs: 0.0763 MB 2 allocs: 0.0763 MB 1
QuantityArray/broadcasting/x^2_quantity_array 2 allocs: 0.0763 MB 2 allocs: 0.0763 MB 1
QuantityArray/broadcasting/x^4_array_of_quantities 2 allocs: 0.382 MB 2 allocs: 0.382 MB 1
QuantityArray/broadcasting/x^4_normal_array 2 allocs: 0.0763 MB 2 allocs: 0.0763 MB 1
QuantityArray/broadcasting/x^4_quantity_array 2 allocs: 0.0763 MB 2 allocs: 0.0763 MB 1
time_to_load 0.153 k allocs: 14.5 kB 0.153 k allocs: 14.5 kB 1

@codecov

codecov Bot commented Apr 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.15%. Comparing base (c2098b5) to head (87f9d36).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #214   +/-   ##
=======================================
  Coverage   99.15%   99.15%           
=======================================
  Files          23       23           
  Lines        1305     1305           
=======================================
  Hits         1294     1294           
  Misses         11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
main 87f9d36... main / 87f9d36...
Quantity/creation/Quantity(x) 2.03 ± 0.002 ns 2.31 ± 0.001 ns 0.88 ± 0.00095
Quantity/creation/Quantity(x, length=y) 2.35 ± 0.28 ns 2.61 ± 0.014 ns 0.897 ± 0.11
Quantity/with_numbers/*real 2.32 ± 0.01 ns 2.33 ± 0.001 ns 0.997 ± 0.0043
Quantity/with_numbers/^int 12.6 ± 1.2 ns 12.4 ± 1.2 ns 1.02 ± 0.14
Quantity/with_numbers/^int * real 11.8 ± 1.2 ns 12.3 ± 1.4 ns 0.955 ± 0.15
Quantity/with_quantity/+y 4.04 ± 0.002 ns 4.04 ± 0.002 ns 1 ± 0.0007
Quantity/with_quantity//y 2.31 ± 0.002 ns 2.89 ± 0.008 ns 0.801 ± 0.0023
Quantity/with_self/dimension 2.31 ± 0.001 ns 2.31 ± 0.003 ns 1 ± 0.0014
Quantity/with_self/inv 2.31 ± 0.001 ns 2.6 ± 0.008 ns 0.889 ± 0.0028
Quantity/with_self/ustrip 2.03 ± 0.002 ns 2.04 ± 0.001 ns 0.994 ± 0.0011
QuantityArray/broadcasting/multi_array_of_quantities 0.121 ± 0.0081 ms 0.121 ± 0.0083 ms 0.993 ± 0.095
QuantityArray/broadcasting/multi_normal_array 0.0494 ± 0.0026 ms 0.0499 ± 0.003 ms 0.991 ± 0.078
QuantityArray/broadcasting/multi_quantity_array 0.0525 ± 0.002 ms 0.0532 ± 0.0055 ms 0.987 ± 0.11
QuantityArray/broadcasting/x^2_array_of_quantities 0.037 ± 0.019 ms 0.0371 ± 0.015 ms 0.997 ± 0.64
QuantityArray/broadcasting/x^2_normal_array 4.61 ± 3.4 μs 4.64 ± 3.5 μs 0.993 ± 1.1
QuantityArray/broadcasting/x^2_quantity_array 6.4 ± 2 μs 5.73 ± 2.8 μs 1.12 ± 0.65
QuantityArray/broadcasting/x^4_array_of_quantities 0.0937 ± 0.0087 ms 0.0938 ± 0.0086 ms 0.999 ± 0.13
QuantityArray/broadcasting/x^4_normal_array 0.0431 ± 0.0019 ms 0.0457 ± 0.0017 ms 0.943 ± 0.054
QuantityArray/broadcasting/x^4_quantity_array 0.0462 ± 0.0021 ms 0.0469 ± 0.0056 ms 0.985 ± 0.13
time_to_load 0.184 ± 0.0019 s 0.184 ± 0.001 s 1 ± 0.012
Memory benchmarks
main 87f9d36... main / 87f9d36...
Quantity/creation/Quantity(x) 0 allocs: 0 B 0 allocs: 0 B
Quantity/creation/Quantity(x, length=y) 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_numbers/*real 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_numbers/^int 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_numbers/^int * real 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_quantity/+y 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_quantity//y 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_self/dimension 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_self/inv 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_self/ustrip 0 allocs: 0 B 0 allocs: 0 B
QuantityArray/broadcasting/multi_array_of_quantities 3 allocs: 0.382 MB 3 allocs: 0.382 MB 1
QuantityArray/broadcasting/multi_normal_array 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
QuantityArray/broadcasting/multi_quantity_array 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
QuantityArray/broadcasting/x^2_array_of_quantities 3 allocs: 0.382 MB 3 allocs: 0.382 MB 1
QuantityArray/broadcasting/x^2_normal_array 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
QuantityArray/broadcasting/x^2_quantity_array 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
QuantityArray/broadcasting/x^4_array_of_quantities 3 allocs: 0.382 MB 3 allocs: 0.382 MB 1
QuantityArray/broadcasting/x^4_normal_array 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
QuantityArray/broadcasting/x^4_quantity_array 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
time_to_load 0.147 k allocs: 0.0732 MB 0.145 k allocs: 11 kB 6.84

@MilesCranmer MilesCranmer merged commit 28424f2 into JuliaPhysics:main Apr 22, 2026
7 checks passed
@ChrisRackauckas

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants