Skip to content

simd: eq_u32_via_lane_to_mask (lane-valued twin of eq_u32_via_to_mask) - #364

Closed
AdaWorldAPI wants to merge 2 commits into
masterfrom
ccr-9f3b8075-74u47l-eq-via-lane
Closed

AdaWorldAPI wants to merge 2 commits into
masterfrom
ccr-9f3b8075-74u47l-eq-via-lane

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

ndarray::simd::eq_u32_via_lane_to_mask(index, table, local, out_words) packs index[i] < table.len() && table[index[i]] == local[i] into a bitmask. It is the lane-valued twin of eq_u32_via_to_mask: each row compares against its own lane value instead of one constant.

Why

lance-graph D-ASM-11A (.claude/plans/wcoj-closing-atoms-v1.md §2, spec ratified by a 5+3 council). The closing atom of a cyclic join compares a row's own lane with a foreign lane read through an address lane. With today's constant-valued compare it can only be written as one disjunct per value, which grows by about 4 ops per value (66 ops at |D| = 16, 1,026 at 256). Consumer site (W1a criterion 7): lance-graph-mask-risc exec.rs run_pred, the new Pred::EqU32ViaLane arm.

Contract

  • Out-of-range index[i] never matches, as with the sibling kernel.
  • Every output word is overwritten; bits past index.len() and surplus words are cleared.
  • Panics if local.len() != index.len() or if out_words is too short.
  • Scalar on every target, and the doc says why. The sibling's note claimed "no vector gather on any backend". That is corrected: an unsafe, unbounded f32 gather exists, but no bounds-masked u32 gather-and-compare wrapper, which the zero-fallback contract needs. Whether such a wrapper pays is unmeasured (lance-graph TD-NO-BOUNDED-U32-GATHER-1).

Verified

  • 5 unit tests and a doctest. One test gives every row a different local value, so a kernel that compared every row against one constant cannot pass it.
  • Disable run: comparing every row against local[0] turned 2 of the tests red; the change was reverted.
  • simd-masking-parity OK on the v4 arm (avx512f=true), new group 0xD41. With one scalar body this only shows portability, not agreement between backends.
  • cargo clippy --lib -- -D warnings clean; touched files rustfmt-clean. The parity crate's existing import block is not rustfmt-clean, so the new function is imported on its own line to keep the diff small.

🤖 Generated with Claude Code

https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh


Generated by Claude Code

…mask

Row i matches when table[index[i]] == local[i]. Closes a cyclic join in
one pass where a constant compare needs one disjunct per value. Scalar;
sibling's vectorisation note corrected (an unbounded f32 gather exists,
a bounds-masked u32 gather-and-compare does not). Parity code 0xD41.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants