Skip to content

Commit c1d44ca

Browse files
Fix ragged broadcast invalidations: BroadcastStyle, not AbstractArrayStyle
Change RaggedVectorOfArrayStyle to subtype BroadcastStyle instead of AbstractArrayStyle. This eliminates all invalidations from the ragged sublibrary except the unavoidable 1 from materialize (needed because non-AbstractArray types can't provide axes/size for instantiate). Invalidation breakdown for `using RecursiveArrayToolsRaggedArrays`: - 1 from our materialize override (unavoidable for non-AbstractArray) - 17 from Accessors.jl (SII transitive dep, not our code) - 20 from Base cat chain (SII transitive dep, not our code) Also update sublibrary compat bounds to RecursiveArrayTools v4. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent aed06b0 commit c1d44ca

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

docs/src/assets/Project.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
4+
5+
[compat]
6+
Documenter = "1.3"
7+
RecursiveArrayTools = "3"

lib/RecursiveArrayToolsArrayPartitionAnyAll/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version = "1.0.0"
66
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
77

88
[compat]
9-
RecursiveArrayTools = "3.48"
9+
RecursiveArrayTools = "4"
1010
julia = "1.10"
1111

1212
[extras]

lib/RecursiveArrayToolsRaggedArrays/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ version = "1.0.0"
44

55
[deps]
66
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
7+
SnoopCompileCore = "e2b509da-e806-4183-be48-004708413034"
78
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
89

910
[compat]
10-
RecursiveArrayTools = "3.48"
11+
RecursiveArrayTools = "4"
12+
SnoopCompileCore = "3.1.1"
1113
SymbolicIndexingInterface = "0.3.35"
1214
julia = "1.10"
1315

lib/RecursiveArrayToolsRaggedArrays/src/RecursiveArrayToolsRaggedArrays.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ end
642642
# Broadcasting — column-wise, preserving ragged structure
643643
# ═══════════════════════════════════════════════════════════════════════════════
644644

645-
struct RaggedVectorOfArrayStyle{N} <: Broadcast.AbstractArrayStyle{N} end
645+
struct RaggedVectorOfArrayStyle{N} <: Broadcast.BroadcastStyle end
646646
RaggedVectorOfArrayStyle{N}(::Val{N}) where {N} = RaggedVectorOfArrayStyle{N}()
647647
RaggedVectorOfArrayStyle(::Val{N}) where {N} = RaggedVectorOfArrayStyle{N}()
648648

@@ -709,7 +709,10 @@ _ragged_unpack_args(::Any, ::Tuple{}) = ()
709709
return RaggedVectorOfArray(u)
710710
end
711711

712-
# Override materialize to skip instantiate (which needs axes/size)
712+
# Override materialize to skip instantiate (which needs axes/size on non-AbstractArray types)
713+
# This causes 1 invalidation tree from Base.Broadcast.materialize(::Broadcasted), but it's
714+
# unavoidable for non-AbstractArray types that need custom broadcasting, and this sublibrary
715+
# is opt-in to isolate exactly this kind of invalidation from the main path.
713716
@inline function Broadcast.materialize(bc::Broadcast.Broadcasted{<:RaggedVectorOfArrayStyle})
714717
return copy(bc)
715718
end

lib/RecursiveArrayToolsShorthandConstructors/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version = "1.0.0"
66
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
77

88
[compat]
9-
RecursiveArrayTools = "3.48"
9+
RecursiveArrayTools = "4"
1010
julia = "1.10"
1111

1212
[extras]

0 commit comments

Comments
 (0)