Repository navigation
simd: mask_scatter_or_u16 — scatter-or over u16 ordinals, no widening - #377
Conversation
…ls in place Sealed 64x64 focus maps hold canonical addresses as u16 (the 65,536 universe is exactly the u16 domain). mask_scatter_or_u32 forced a widened u32 copy of every map (16 KiB per 4,096-slot map, 1 MiB per 64 maps) just to scatter. Both widths now share one private set-bit walker (scatter_or_walk): same clamp of the final partial src word, same OR-accumulate (never zeroes the destination), same union of repeated targets, same silent drop of out-of-range targets, same panic messages per name. Scalar on every backend, as before: no backend has a bit-level scatter. Tests: u16 equals u32 and a naive reference across the tail (n up to 4,096, out_rows 50 / 4,096 / 65,536, dirty tail bits); top-of-domain 65,535 kept at out_rows 65,536 and dropped at 65,535; union + accumulation + preset bit; short src / out panics. Disable runs (domain ceiling, tail clamp) both red. simd-masking-parity gains check 0xD12 (u16 vs the u32 reference). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Adds
ndarray::simd::mask_scatter_or_u16, the u16-index twin ofmask_scatter_or_u32.Why. Sealed 64×64 focus maps in lance-graph store canonical addresses as
u16, because the 65,536-address universe is exactly the u16 domain. Scattering them through the u32 primitive first needs a widened copy of every map: 16 KiB per 4,096-slot map, 1 MiB per 64 maps. In the lance-graph lab that widening dominated small selections: 9 µs with u16 against 46 µs with u32, for 4,096 selected addresses.What.
scatter_or_walk.index.len();Tests.
out_rows∈ {50, 4,096, 65,536}, with dirty tail bits.out_rows = 65,536and dropped at 65,535.simd-masking-paritygains check0xD12(u16 against the u32 reference); native AVX-512 run: 19 groups OK.cargo test --lib mask_scatter13/13, doctests 2/2,cargo clippy -- -D warningsclean,cargo fmt --checkclean.Not in scope. mask-risc exposure (a
LaneRef::U16read by the existing scatter terminal) is designed in lance-graph but waits for this PR.Generated by Claude Code