gf: Don't recache a call signature to a MethodInstance with undetermined sparams #63845
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.32) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.32 · 135 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.294
Real PR Conversation Timeline
1 comments
"Review active on #63845"
general
weight: 0.35
vtjnash
After inferring the compilation signature of a call, inference asks the runtime to let the call signature
dispatch to that signature's MethodInstance (
jl_recache_method_by_type). The compilation signature can leavestatic parameters undetermined that the call signature determines, like
Nforf(::Union{Int, NTuple{N,Int}}...) where {N}called with aTuple{Int,Int}argument among manyInts.recache_methodwas handed the MethodInstance's ownsparam_valsas those of the call, so it repointed thecall's leafcache entry (and cached the widened signature) at code that throws
UndefVarError: N not defined in static parameter matching.This skips the recache for such MethodInstances, as
need_copy_to_mi_cachedoes on the dispatch path;dispatch then caches the right MethodInstance itself. Only an optimization is lost for those methods.
The transient case described in the issue (the recursive
jl_compile_method_very_internalfallback brieflypromoting the widened MethodInstance) is not addressed here.
Fixes #63844
Assisted by: Opus 5.5