Fix generic vector float norm helpers #2257
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.43) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 363 lines diff across 4 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
Diff Size
diff_size
0.353
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #2257"
general
weight: 0.35
LiRunGuo
What problem are you trying to solve?
Fixes #2224.
A dtype-generic kernel that works with
wp.vec3fails to compile when instantiated withwp.vec3horwp.vec3d. The helpers mixed Python float constants with the vector's scalar type innorm_l1,norm_huber,norm_pseudo_huber, and consequentlysmooth_normalize.This blocks dtype-generic spatial/numerical kernels from using the same norm implementation across float16, float32, and float64 vectors.
What does this change?
vec3h,vec3f, andvec3d.2224.fixed.md.Existing pull requests
Validation
test_vec_norm_dtypesfails to compile before the helper changes and passes after them.uvx pre-commit run --files warp/_src/math.py warp/tests/test_math.py changelog/2224.fixed.mdpassed all hooks, including generated-file checks, Ruff, format, and typos.Targeted validation used the patched source files with the official
warp-lang==1.19.0wheel's CPU+CUDA native library because this host does not have the CUDA runtime headers needed to compile the currentmainnative library from source.Validation after syncing with main
The Huber threshold comparison uses the primal value for forward-mode jets.
The arithmetic retains the vector dtype and preserves the jet derivatives.
I built Warp from source on Yokota with CUDA 13.2 and ran the following tests
on the updated head
e7d0c3d72(RTX 3090):Ruff check and format checks passed for the changed Python files.
Checklist
mainand contains one commit.AI assistance: OpenAI Codex investigated, implemented, and validated this change under human direction.