TypeAnalysis: keep a zext's Anything off its i1 operand #3947
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 273 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.336
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #3947"
general
weight: 0.35
wsmoses
<!-- claude-projects-attribution: {"github_login":"vchuravy"} -->
_Requested by Valentin · project thread_
MITgcm hits this in
lab_sea(seaice_growth): the vectorizer emitszext <2 x i1> (fcmp ogt <2 x double> ...)and stores it to an integer mask array, and Enzyme fails withCause.
visitZExtInsttypes the zext of ani1as Anything and then hands the result's type back to its operand. Anything replaces Integer when type trees are merged, so thefcmploses the Integer thatvisitCmpInstgave it. For a scalari1this goes unnoticed, becausegetAnalysisreports every scalar integer under 16 bits as Integer whatever is stored. A vector ofi1is returned as stored, so activity analysis sees a value of unknown type computed from active floats and treats the mask as active.Fix. The Anything of an extended
i1was not derived from the operand, sovisitZExtInstno longer propagates it up to ani1(or vector ofi1) operand. The vector case then matches the scalar one: the compare stays Integer, and the mask and its store are inactive.This replaces the earlier version of this PR, which skipped
i1operands in the cast adjoint. That left the mask active, so storing it to active memory still failed:Tests.
TypeAnalysis/zexti1vector.ll: the compare feeding the zext stays Integer.ReverseMode/zext-i1-vector.ll: the reducedlab_seapattern, with the mask stored to inactive and to active memory.Both fail on main and pass with the fix. On an LLVM 18 build the Enzyme, TypeAnalysis and ActivityAnalysis lit suites show no new failures against main (the typed-pointer tests cannot run there). The LLVM 16 suite and the MITgcm
lab_seabuild have not been rerun with this version.https://claude.ai/code/session_01HgDfyh5CxbdWra5FFgUy6M
---
_Generated by Claude Code_