Lower cuda.lanemask_lt() by reading the %lanemask_lt special register #420
All Vouch review confidence checks passed
Residual risk 0.16 = 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 · 264 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.334
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #420"
general
weight: 0.35
atmnp
Fixes #373
cuda.lanemask_lt()is listed in the kernel API reference and types as() -> uint32, but it had no lowering, so a kernel that calls it failed to compile:This PR:
@lower(cuda.lanemask_lt)inlowering/cuda.pythat emitsnvvm.read_ptx_sreg_lanemask_lt();NVVM::LaneMaskLtOpto the special-register table in the LLVM 7 translator (cext/mlir-llvm70/lib/LLVM70Target.cpp,translateSregOpand thetranslateNVVMOpcase list), lowering it tomov.u32 $0, %lanemask_lt;like the other special registers. Without it the translator rejects the op with "unsupported NVVM op: nvvm.read.ptx.sreg.lanemask.lt";read_lanemask_ltcase tocext/mlir-llvm70/test/sreg_extra.mlirthat checks both the LLVM IR and the PTX.The existing
test_warp_ops.py::test_lanemask_lt(ported from numba-cuda) already checks laneiagainst(1 << i) - 1. Itsxfail(True, reason="Lanemask not implemented")marker is removed.(The first version of this PR read the register with inline asm from Python. It was switched to the translator approach after review.)
Testing
RTX 4050 Laptop (sm_89), CUDA 13.4, Python 3.12.
bd28aefwheel:nvvm.read_ptx_sreg_lanemask_lt()builds and prints asnvvm.read.ptx.sreg.lanemask.lt : i32, the op the new translator case matches.ireturned(1 << i) - 1) andtest_lanemask_lt.pytest -n 4 tests --ignore=tests/benchmarksmatched the unmodified wheel except fortest_lanemask_ltmoving from xfail to pass.pre-commitpasses on the changed files.This change was developed with AI assistance (Claude Code).