← Back to Pull requests

Use Base.allocatedinline to decide whether an argument is boxed #1084

Closed
unknown closed this pull request without merging on Nov 11, 2026 06:35 UTC
View on GitHub
unknown unknown commented on Nov 09, 2026 15:30 UTC
Author

deserves_argbox/deserves_retbox are meant to mirror deserves_stack in Julia's codegen, but the hand-written is_inlinealloc checked only the mayinlinealloc flag and uninitialized fields. Julia also stores an immutable with GC pointers boxed when its field descriptors need 32 bits (fielddesc_type > 1), e.g. Tuple{NTuple{4100, Float64}, Vector{Float64}}. For such a type deserves_argbox returned false while Julia passes the argument as a single boxed pointer, on every supported Julia version.

GPUCompiler doesn't act on this itself, but Enzyme does, and on 1.12+ it breaks: its argument classification uses deserves_argbox to decide whether an argument comes with a separate inline-roots argument. A custom rule whose tape is such a type, or a plain @noinline callee taking one, fails with codegen_i=N > length(codegen_types) in classify_arguments. Found while reviewing EnzymeAD/Enzyme.jl#3953, which fixes the same mismatch for the returned tape; EnzymeAD/Enzyme.jl#3954 works around it with a local deserves_argbox.

Base.allocatedinline is jl_stored_inline, which for a DataType is the same jl_datatype_isinlinealloc check codegen's deserves_stack makes (1.10 through master). deserves_stack now calls it directly and is_inlinealloc is gone; nothing downstream used it. deserves_stack still checks is_concrete_immutable first, so unions and abstract types are unaffected.

Tests: a new deserves_argbox testset in test/utils.jl, which fails on main and passes here on 1.10, 1.12 and 1.13.

Diff: 193 lines (+144 / -49) across 2 files Reviewer: maleadt Review duration: 2344m
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.36) × (1 − Review Confidence (0.64)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 193 lines diff across 2 files
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 70%
64%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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.315
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1084"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 64% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.0% (MEDIUM) · Higher = larger blast radius
36.0%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 64% · Lower = rushed or shallow review
64%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 13.0% · Safe to merge
13.0%