GH-50026: [C++][Parquet] SIMD-accelerate SBBF probe via branchless autovec #50030
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 458 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.367
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #50030"
general
weight: 0.35
dmatth1
Rationale for this change
BlockSplitBloomFilter::FindHashships the scalar reference probe — an 8-iteration short-circuit loop. The short-circuit blocks autovectorization, and on miss-heavy workloads (Parquet row-group skipping) the per-lane branch-mispredict dominates probe latency.Closes #50026. Dev list discussion: https://lists.apache.org/thread/omof0fq47tndfd80g5hwp2bvjmzvpb40. Sibling change in Rust: apache/arrow-rs#10011.
### What changes are included in this PR?
- Rewrite
FindHashas a branchless OR-accumulator reduction. The new shape autovectorizes to SSE on x86 and NEON on aarch64 at the baseline.- Add
bloom_filter_avx2.cc(xsimd kernel built with-mavx2) behindCpuInfo-basedDynamicDispatch, mirroring the existinglevel_comparison_avx2pattern. xsimd was a requirement from the dev thread; the AVX2 target spells the reduction explicitly withxsimd::batch<uint32_t, xsimd::avx2>(pinned so an AVX-512 baseline build can't widen the batch to 16 lanes and over-read the 32-byte block) because gcc/MSVC don't lower the autovec body to a singlevptest.- No on-disk format change, no public API change, and bit-identical to the scalar reference.
- Insert path uses the same loop shape and will land in a follow-up PR.
### Performance
End-to-end
FindHashviaparquet/benches/bloom_filter_benchmark.cc.M1 (Apple clang -O3, NEON via autovec, 10 reps, CV ≤ 0.4%):
| Bench | upstream/main | this PR | Speedup |
|---|---:|---:|---:|
|
BM_FindExistingHash(hit-heavy) | 3.85 ns/probe | 2.41 ns/probe | 1.60× ||
BM_FindNonExistingHash(miss-heavy) | 9.04 ns/probe | 2.41 ns/probe | 3.75× |x86-64 (gcc 13.3, -O2 -mavx2 via AVX2 dispatch TU, 5 reps, CV ≤ 0.6%):
| Bench | upstream/main | this PR | Speedup |
|---|---:|---:|---:|
|
BM_FindExistingHash(hit-heavy) | 8.62 ns/probe | 4.32 ns/probe | 2.00× ||
BM_FindNonExistingHash(miss-heavy) | 15.29 ns/probe | 4.33 ns/probe | 3.53× |The scalar miss path stalls on the data-dependent early-exit (slower than its own hit path on both archs); the branchless reduction is constant-time across hit/miss.
InsertHash,BatchInsertHash,ComputeHash,BatchComputeHashall unchanged (16 benches within ±0.6%, inside CV).Cache regime sweep: scalar vs xsimd, post-hash probe latency:
| Regime | scalar | xsimd | Speedup |
|---|---:|---:|---:|
| Small in-cache (0.5 MiB) | 12.35 ns | 2.48 ns | 5.0× |
| Medium out-of-L3 (128 MiB) | 18.40 ns | 7.41 ns | 2.5× |
| Large deep DRAM (1 GiB) | 31.05 ns | 22.10 ns | 1.4× |
Branchless body alone (no xsimd kernel) on AVX2:
- on clang
-mavx2it's within noise of the hand-written xsimd kernel in every regime- on gcc it matches except ~0.79× of xsimd in the out-of-L3 regime.
- That gap is why this PR ships a separate xsimd kernel for the AVX2 TU rather than relying on autovec alone — on clang-only builds the xsimd kernel is essentially a no-op but on gcc/MSVC it pins the
vptestlowering.### Are these changes tested?
Yes. New
BloomFilterProbeKerneltest calls both dispatch targets directly across 20K random blocks + 200 production-populated blocks per CI run, asserting bit-identical output.DynamicDispatchresolves once at static init, so without thistest the un-picked target would never be exercised in CI.
Existing
BasicTest,FPPTest, andCompatibilityTestcontinue to pass on both the scalar baseline and the AVX2 dispatch path.### Are there any user-facing changes?
No. Read-path implementation change only.