Split the `BroadcastStyle` method to avoid invalidations #231
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 252 lines diff across 3 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.331
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #231"
general
weight: 0.35
giordano
The
BroadcastStylemethod forFixedSizeArrayDimsand their views has aUnionof both signatures:When the package is loaded, this method invalidates compiled code that calls
BroadcastStyleof unrelated types. This PR splits it into two methods with the same bodies, one per signature, which do not.Found via the invalidations check of trixi-framework/Trixi.jl#3357, which adds FixedSizeArrays.jl as a dependency. With
@snoop_invalidations using Trixion Julia 1.10:| | invalidations |
|---|---|
| Trixi.jl
main(without FixedSizeArrays.jl) | 1863 || trixi-framework/Trixi.jl#3357 with FixedSizeArrays.jl v1.5.0 | 1875 |
| trixi-framework/Trixi.jl#3357 with this PR | 1867 |
The 8 removed invalidations are all
BroadcastStyleofTupletypes, e.g.:The remaining 4 come from the method for views. They are
BroadcastStyle(::Type{SubArray}),combine_styles(::SubArray, ...)andmaterialize!(::SubArray, ...)compiled for abstractSubArrays. AnyBroadcastStylemethod for views would invalidate these. Thecconvertmethod only replaces a method of StaticArrays.jl as the root of the same invalidations and adds none.The broadcast style is unchanged, e.g. for
view(a, :, :),view(a, 1:2, :)andview(a, :, 2)(which keepsDefaultArrayStyle{1}as before) of aFixedSizeArray, and for views of arrays with static dimensions. The existing test of the style of views (test/static_dims.jl) still passes. The tests pass on Julia 1.10 and 1.12.🤖 Generated with Claude Code