simd: fuse wrapping i32 add into masked sum - #319
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (3)
Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughThe change adds ChangesMasked wrapping reduction
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to The new masked wrapping reduction follows the repository’s slice-level API contract and preserves the documented wrapping and masking behavior. No actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
A rabbit checks each masked sum, Comment |
|
@coderabbitai review Please attack the semantic boundary rather than style:
This is intentionally scalar inside the masking facade: the existing |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== Changed files ==='
git diff --name-status HEAD^ HEAD
echo '=== Pull request diff ==='
git diff --unified=80 HEAD^ HEAD
echo '=== Candidate masking symbols ==='
rg -n -C 8 --glob '*.rs' 'masked_sum_(wrapping_add_i32|i32)\s*\(' . || trueLength of output: 42363
I found no defect in these semantic boundaries. ✅ Action performedReview finished.
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_dd39f13c-1849-4e7f-beb0-5f18e35964e8) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_6766b071-6bed-42fb-821b-084c349aba74) |
Adds one semantics-preserving reduction primitive for expression folding:
masked_sum_wrapping_add_i32(a, b, mask). For each selected row it performsi32::wrapping_addfirst, then widens the wrapped row value toi64and accumulates. This is deliberately notmasked_sum_i32(a)+masked_sum_i32(b), which changes semantics on row overflow.Why this belongs in ndarray: lance-graph's mask-risc law routes all row/mask arithmetic through
ndarray::simd; the new kernel erases a derivedi32lane without materialising it and without creating a consumer-side hand-rolled loop. Likemasked_sum_i32, the implementation walks selected bits and is intentionally scalar because exact widening semantics matter more than anI32x16::reduce_sumthat accumulates ini32.Coverage: facade re-export plus the existing cross-realization masking parity group, with the reference explicitly computing
vals[i].wrapping_add(rhs[i])before widening. Public docs include the overflow boundary examplei32::MAX + 1 -> i32::MIN.Consumer follow-up: lance-graph mask-risc terminal/lowering for fused
SUM(a+b)after this lands.Summary by CodeRabbit
New Features
Bug Fixes