abstractarray: Inline `_cat` and `__cat` so small `cat` calls stay specialized #64849
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 234 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.327
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #64849"
general
weight: 0.35
adienes
A
_cat(dims, X...)call that is not inlined is compiled as_cat(::Val{1}, ::Vector{T}, ::Vararg{Any}), which dispatches dynamically and is invalidated by any package addingsize,promote_rule,Colonortailmethods. #64582 movedvcat(::Vector{T}, ::T)over the inlining threshold for non-inline element types, and sincecreate_expr_cacheused such avcat, about 170 method instances of the loading code got invalidated by many packages (+3.2k invalidations in the TTFX run). This marks_catand__cat@inline, so a two-argument call always reaches__cat_offset!with concrete types, and avoidsvcatincreate_expr_cache.| | before #64582 | master | PR |
|---|---:|---:|---:|
| invalidated by
using ForwardDiff| 117 | 280 | 117 || invalidated by
using Unitful| 45 | 208 | 45 ||
vcat(::Vector{String}, ::String)| 17 ns | 285 ns | 18 ns ||
vcat(::Vector{Int}, ::Int)| 312 ns | 17 ns | 19 ns || first
vcat(xs...)of 100 mixed scalars and vectors | | 49–84 ms | 75–87 ms |The same-eltype method
_cat(catdims, A::AbstractArray{T}...)is marked@inlineas well. It was not inlined either (also on 1.12–1.14), socat(A, B; dims=3)called an instance compiled for_cat(::Int, ::Matrix{T}, ::Vararg{Matrix{T}}), which knows neither the constantdimsnor the number of arrays.vcat/hcatof same-eltype arrays were already inlined and are unchanged.| 2×2
Matrix{Int}| master | PR ||---|---:|---:|
|
cat(A, B; dims=3)| 370 ns | 23 ns ||
cat(A, B; dims=Val(3))| 412 ns | 27 ns ||
cat(A, B; dims=(1,2))| 389 ns | 28 ns ||
cat(A, B, C; dims=3)| 569 ns | 159 ns ||
cat(A, B; dims=d), runtimed| 582 ns | 275 ns |🤖 Generated with Claude Code