Repository navigation
Add NEON and AVX2 decode SIMD kernels for PIVCO - #12355
lwwmanning wants to merge 1 commit into
Conversation
Adds NEON and AVX2+POPCNT SIMD decode merges, popcount, and flat-subtree unpack kernels (D in 2..=6) behind the scalar fallbacks in vortex-pivco, deduplicating NEON 64-byte merge bodies and dropping shadowed SSSE3/SSE4.1 x86 tiers, plus bit-exact SIMD-vs-scalar parity tests. Co-Authored-By: Antigravity <noreply@google.com> Signed-off-by: Will Manning <will@willmanning.io>
Codex Review Summary: ✅ CompletedThis 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. |
lwwmanning
left a comment
There was a problem hiding this comment.
Posted by Claude Opus 5.5 on Will's behalf.
I read the NEON and AVX2 kernels against the scalar code. I found no bug. The in-place merges are safe. Each 16-byte store holds 16 merged symbols, so a store never overwrites a byte that a later load needs. Every vector load stays inside the l_len, r_len or packed.len() guard, and the unpack tails read only the bytes the scalar path reads.
The AVX2 code has not run in CI. On pull requests, the workspace tests run only on Rust tests (linux-arm64). The nightly x86 musl job runs them only after merge. The nightly rust-test-cpu-features avx2 job tests only vortex-buffer, vortex-mask and vortex-array. So before merge, merge_vec_vec_avx2, merge_cst_side_avx2, merge_cst_cst_avx2 and the five unpack_flat_d*_avx2 kernels have no CI coverage. Please add -p vortex-pivco to the cpu-features job, or run the pivco tests once on an AVX2 host and say so in the description.
The NEON shuffle tables have no exhaustive check, but the x86 tables do (test_x86_merge_pshufb_tables_exhaustive_16bit). One test can cover both. Call merge_vec_vec, merge_cst_vec and merge_vec_cst with k = 16 and 16-byte inputs for all 65,536 masks, and compare with the scalar merge. That runs the real dispatch on each target. It can replace the table-only x86 test.
The parity tests use seeded loops over fixed lengths and patterns. A Hegel property that draws the bitmap bytes, k, the slack and the depth would cover the same cases with less code. This is optional.
The PR adds about 1,560 lines of unsafe SIMD with no measured result. Please add one line with the decode speedup over scalar, on NEON and on AVX2. The pivco_compress decode benches in #12358 can give it.
Stacked on #12103
Replaces the scalar decode fallbacks in
vortex-pivcowith NEON and AVX2+POPCNT merge, popcount, and flat-subtree unpack kernels (forDin2..=6). NEON shares a single 64-byte merge helper across the variable-vector and constant-side paths, and x86 targets AVX2+POPCNT plus scalar without redundant SSSE3/SSE4.1 tiers, verified against scalar with bit-exact parity tests.Authored with AI assistance.