← Back to Pull requests

parquet: SIMD-accelerate Sbbf probe via autovectorization #10011

Closed
unknown closed this pull request without merging on Aug 10, 2026 02:18 UTC
View on GitHub
unknown unknown commented on May 23, 2026 14:16 UTC
Author

Which issue does this PR close?

No tracked issue — opening directly, following the precedent of apache/arrow-go#336 which shipped AVX2/SSE4/NEON SBBF probes in 18.3.0, and paralleling an in-progress
[[DISCUSS]](https://lists.apache.org/thread/omof0fq47tndfd80g5hwp2bvjmzvpb40) thread on dev@arrow.apache.org for the C++ port of the same kernel.

# Rationale for this change

Sbbf::check / Sbbf::insert are on the hot path of Parquet row-group skipping for every reader downstream of arrow-rs (DataFusion, Databend, InfluxDB / IOx, RisingWave, GreptimeDB). Each 256-bit Parquet block is exactly one AVX2 vector;
the K=8 lane test collapses to one vptest (_mm256_testc_si256). This PR vectorises that loop on x86_64 without changing the algorithm, hash, salts, or wire format. NEON / aarch64 SIMD support is slated for a follow-up PR.

# What changes are included in this PR?

- AVX2 kernel in simd_x86, dispatched via cached is_x86_feature_detected!("avx2") (dead-coded when -C target-cpu=native).
- Scalar Block::{check,insert} retained as the production fallback for non-AVX2 x86 / aarch64 / wasm32 / RISC-V / 32-bit / big-endian, and as the correctness reference the AVX2 kernel is diff-tested against.
- Block changed from #[repr(transparent)] to #[repr(C, align(32))]. Byte layout unchanged; alignment is asserted at compile time so the AVX2 aligned load/store contract is load-bearing.

# Are these changes tested?

Yes. The 31 pre-existing bloom_filter unit tests continue to pass on x86_64 with and without -C target-cpu=native. Two new diff tests — test_simd_{check,insert}_matches_scalar — assert bit-identical AVX2-vs-scalar output across 10K random (block, hash) pairs each. Benchmark results (Cascade Lake-class Xeon) are in the commit message. Benchmarks obtained with the changes in https://github.com/apache/arrow-rs/pull/10041.

# Are there any user-facing changes?

No. Public API, MSRV, dependencies, and wire format are all unchanged. The only observable effect is faster Sbbf::check / Sbbf::insert on x86_64 hosts with AVX2.

---

The SIMD kernel was drafted with AI assistance and reviewed line-by-line; correctness is enforced in CI by the diff tests above. cargo fmt --all -- --check and cargo clippy -p parquet --all-targets -- -D warnings both clean on this branch.

Diff: 304 lines (+228 / -76) across 3 files Reviewer: dmatth1 Review duration: 113041m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 304 lines diff across 3 files
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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.342
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #10011"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 40.1% (MEDIUM) · Higher = larger blast radius
40.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.9% · Safe to merge
15.9%