Skip to content

Add RecursiveArrayToolsExt to support ArrayPartitions - #164

Open
hakkelt wants to merge 6 commits into
JuliaFirstOrder:masterfrom
hakkelt:recursive-array-tools-ext
Open

Add RecursiveArrayToolsExt to support ArrayPartitions#164
hakkelt wants to merge 6 commits into
JuliaFirstOrder:masterfrom
hakkelt:recursive-array-tools-ext

Conversation

@hakkelt

@hakkelt hakkelt commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a package extension (RecursiveArrayToolsExt) that lets SeparableSum and PrecomposedSlicedSeparableSum operate directly on RecursiveArrayTools.ArrayPartition, avoiding the need to manually convert to/from tuples.
  • Extension is triggered by RecursiveArrayTools as a weak dependency (Project.toml [weakdeps]/[extensions]), so it adds no dependency unless the user already has RecursiveArrayTools loaded.

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
master f285615... master / f285615...
IndBallL1/Float32 4.59 ± 4.4 μs 4.59 ± 0.34 μs 1 ± 0.97
IndBallL1/Float64 5.24 ± 1.5 μs 5.43 ± 1.5 μs 0.965 ± 0.39
IndBox/Float32 10.2 ± 0.19 μs 10.4 ± 0.22 μs 0.98 ± 0.028
IndBox/Float64 10.4 ± 1.2 μs 11.5 ± 0.56 μs 0.905 ± 0.11
IndExpPrimal/Float32 0.202 ± 0.012 ms 0.201 ± 0.012 ms 1.01 ± 0.085
IndExpPrimal/Float64 0.203 ± 0.015 ms 0.202 ± 0.016 ms 1.01 ± 0.11
IndNonnegative/Float32 11 ± 0.64 μs 11.4 ± 0.48 μs 0.961 ± 0.069
IndNonnegative/Float64 6.06 ± 1.2 μs 6.97 ± 0.78 μs 0.869 ± 0.19
IndPSD/("ComplexF64", 10) 19.2 ± 0.73 μs 19.2 ± 0.82 μs 1 ± 0.057
IndPSD/("ComplexF64", 20) 0.0719 ± 0.00089 ms 0.0721 ± 0.00095 ms 0.998 ± 0.018
IndPSD/("ComplexF64", 50) 0.602 ± 0.014 ms 0.604 ± 0.015 ms 0.996 ± 0.034
IndPSD/("Float64", 10) 15.3 ± 0.45 μs 15.5 ± 0.46 μs 0.988 ± 0.041
IndPSD/("Float64", 20) 0.0498 ± 0.0011 ms 0.0498 ± 0.0041 ms 1 ± 0.086
IndPSD/("Float64", 50) 0.304 ± 0.01 ms 0.304 ± 0.01 ms 1 ± 0.048
IndSimplex/Float32 25.5 ± 0.44 μs 24.9 ± 0.68 μs 1.02 ± 0.033
IndSimplex/Float64 29.8 ± 2.4 μs 29.5 ± 2.6 μs 1.01 ± 0.12
LeastSquares/("ComplexF64", "(11, 5)", 0, 0) 1.22 ± 0.04 μs 1.2 ± 0.04 μs 1.02 ± 0.047
LeastSquares/("ComplexF64", "(11, 5)", 0, 1) 1.56 ± 0.14 μs 1.58 ± 0.13 μs 0.988 ± 0.12
LeastSquares/("ComplexF64", "(11, 5)", 1, 0) 9.7 ± 0.38 μs 9.83 ± 0.44 μs 0.988 ± 0.059
LeastSquares/("ComplexF64", "(11, 5)", 1, 1) 1.57 ± 0.13 μs 1.54 ± 0.13 μs 1.02 ± 0.12
LeastSquares/("ComplexF64", "(5, 11)", 0, 0) 1.41 ± 0.08 μs 1.39 ± 0.08 μs 1.01 ± 0.082
LeastSquares/("ComplexF64", "(5, 11)", 0, 1) 1.74 ± 0.14 μs 1.79 ± 0.13 μs 0.972 ± 0.11
LeastSquares/("ComplexF64", "(5, 11)", 1, 0) 9.96 ± 0.37 μs 10.1 ± 0.46 μs 0.988 ± 0.058
LeastSquares/("ComplexF64", "(5, 11)", 1, 1) 1.81 ± 0.15 μs 1.84 ± 0.15 μs 0.983 ± 0.11
LeastSquares/("Float64", "(11, 5)", 0, 0) 0.992 ± 0.03 μs 1.01 ± 0.021 μs 0.981 ± 0.036
LeastSquares/("Float64", "(11, 5)", 0, 1) 1.31 ± 0.13 μs 1.29 ± 0.14 μs 1.02 ± 0.15
LeastSquares/("Float64", "(11, 5)", 1, 0) 9.49 ± 0.29 μs 9.55 ± 0.34 μs 0.994 ± 0.047
LeastSquares/("Float64", "(11, 5)", 1, 1) 1.31 ± 0.15 μs 1.26 ± 0.15 μs 1.04 ± 0.17
LeastSquares/("Float64", "(5, 11)", 0, 0) 1.14 ± 0.03 μs 1.15 ± 0.031 μs 0.991 ± 0.037
LeastSquares/("Float64", "(5, 11)", 0, 1) 1.46 ± 0.11 μs 1.48 ± 0.12 μs 0.987 ± 0.11
LeastSquares/("Float64", "(5, 11)", 1, 0) 9.68 ± 0.28 μs 9.76 ± 0.34 μs 0.992 ± 0.045
LeastSquares/("Float64", "(5, 11)", 1, 1) 1.46 ± 0.16 μs 1.44 ± 0.16 μs 1.01 ± 0.16
NormL2/Float32 3.98 ± 0.31 μs 4.07 ± 0.34 μs 0.978 ± 0.11
NormL2/Float64 11.1 ± 1.7 μs 11.1 ± 0.74 μs 0.996 ± 0.17
time_to_load 1.08 ± 0.011 s 1.1 ± 0.0054 s 0.984 ± 0.011
Memory benchmarks
master f285615... master / f285615...
IndBallL1/Float32 10 allocs: 10.4 kB 10 allocs: 10.4 kB 1
IndBallL1/Float64 10 allocs: 20.5 kB 10 allocs: 20.5 kB 1
IndBox/Float32 1 allocs: 16 B 1 allocs: 16 B 1
IndBox/Float64 1 allocs: 16 B 1 allocs: 16 B 1
IndExpPrimal/Float32 11 k allocs: 0.179 MB 11 k allocs: 0.179 MB 1
IndExpPrimal/Float64 11 k allocs: 0.179 MB 11 k allocs: 0.179 MB 1
IndNonnegative/Float32 1 allocs: 16 B 1 allocs: 16 B 1
IndNonnegative/Float64 1 allocs: 16 B 1 allocs: 16 B 1
IndPSD/("ComplexF64", 10) 19 allocs: 11.9 kB 19 allocs: 11.9 kB 1
IndPSD/("ComplexF64", 20) 22 allocs: 29.2 kB 22 allocs: 29.2 kB 1
IndPSD/("ComplexF64", 50) 23 allocs: 0.116 MB 23 allocs: 0.116 MB 1
IndPSD/("Float64", 10) 16 allocs: 5.88 kB 16 allocs: 5.88 kB 1
IndPSD/("Float64", 20) 18 allocs: 14 kB 18 allocs: 14 kB 1
IndPSD/("Float64", 50) 19 allocs: 0.0564 MB 19 allocs: 0.0564 MB 1
IndSimplex/Float32 24 allocs: 0.0344 MB 24 allocs: 0.0344 MB 1
IndSimplex/Float64 26 allocs: 0.0685 MB 26 allocs: 0.0685 MB 1
LeastSquares/("ComplexF64", "(11, 5)", 0, 0) 7 allocs: 1.05 kB 7 allocs: 1.05 kB 1
LeastSquares/("ComplexF64", "(11, 5)", 0, 1) 17 allocs: 1.14 kB 17 allocs: 1.14 kB 1
LeastSquares/("ComplexF64", "(11, 5)", 1, 0) 0.059 k allocs: 4.6 kB 0.059 k allocs: 4.6 kB 1
LeastSquares/("ComplexF64", "(11, 5)", 1, 1) 17 allocs: 1.17 kB 17 allocs: 1.17 kB 1
LeastSquares/("ComplexF64", "(5, 11)", 0, 0) 7 allocs: 1.05 kB 7 allocs: 1.05 kB 1
LeastSquares/("ComplexF64", "(5, 11)", 0, 1) 17 allocs: 1.14 kB 17 allocs: 1.14 kB 1
LeastSquares/("ComplexF64", "(5, 11)", 1, 0) 0.059 k allocs: 4.6 kB 0.059 k allocs: 4.6 kB 1
LeastSquares/("ComplexF64", "(5, 11)", 1, 1) 17 allocs: 1.17 kB 17 allocs: 1.17 kB 1
LeastSquares/("Float64", "(11, 5)", 0, 0) 7 allocs: 0.609 kB 7 allocs: 0.609 kB 1
LeastSquares/("Float64", "(11, 5)", 0, 1) 17 allocs: 0.984 kB 17 allocs: 0.984 kB 1
LeastSquares/("Float64", "(11, 5)", 1, 0) 0.059 k allocs: 3.96 kB 0.059 k allocs: 3.96 kB 1
LeastSquares/("Float64", "(11, 5)", 1, 1) 17 allocs: 1.02 kB 17 allocs: 1.02 kB 1
LeastSquares/("Float64", "(5, 11)", 0, 0) 7 allocs: 0.609 kB 7 allocs: 0.609 kB 1
LeastSquares/("Float64", "(5, 11)", 0, 1) 17 allocs: 0.984 kB 17 allocs: 0.984 kB 1
LeastSquares/("Float64", "(5, 11)", 1, 0) 0.059 k allocs: 3.96 kB 0.059 k allocs: 3.96 kB 1
LeastSquares/("Float64", "(5, 11)", 1, 1) 17 allocs: 1.02 kB 17 allocs: 1.02 kB 1
NormL2/Float32 1 allocs: 16 B 1 allocs: 16 B 1
NormL2/Float64 1 allocs: 16 B 1 allocs: 16 B 1
time_to_load 0.149 k allocs: 11.2 kB 0.149 k allocs: 11.2 kB 1

stale_deps=false, persistent_tasks=false, and the OSQP stale-deps
ignore were not needed for the RecursiveArrayToolsExt addition —
Aqua.test_all(ProximalOperators; ambiguities=false) passes as-is with
the extension in place.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JHYpJyvm5XwhtMXLE1N8i9
@hakkelt
hakkelt marked this pull request as ready for review August 22, 2026 07:28
@hakkelt

hakkelt commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

@lostella This PR is ready to review.

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.

1 participant