Add the missing highway kernels #753
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.47) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 495 lines diff across 6 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.371
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #753"
general
weight: 0.35
tlwillke
Implemented native C++ Google Highway SIMD kernels for:
min_f32, sum_f32, scale_f32, and sub_f32/sub_scalar_f32 in jvector_simd_kernels.cpp, eliminating Panama Java Vector API fallbacks for them. These kernels vectorize horizontal reductions, in-place scaling, out-of-place subtraction, and 64-bit population count across all x86-64 (SSE4.2 to AVX-512) and AArch64 (NEON, SVE, SVE2) tiers, and are wired to NativeVectorUtilSupport.java through critical Java FFM bindings with unit tests in test_elementwise.cpp and release symbol verification in verify_native_lib.sh.Kernel-level speedup using JDK 22.0.2
Measured at PR head efcf8ca8
over the pre-PR Panama baseline (598ef09e). Above 1× favors native; dimensions count floats.| Dimensions | Alignment | Minimum | Sum | Scale | Vector sub | Scalar sub |
|---:|---:|---:|---:|---:|---:|---:|
| 64 | 0 B | 2.57× | 2.36× | 1.45× | 1.74× | 1.83× |
| 64 | 16 B | 2.62× | 2.27× | 1.05× | 1.54× | 1.73× |
| 768 | 0 B | 2.33× | 1.98× | 1.17× | 1.38× | 1.37× |
| 768 | 16 B | 2.35× | 1.64× | 1.77× | 1.15× | 1.11× |
| 1536 | 0 B | 2.41× | 1.35× | 1.09× | 1.19× | 1.20× |
| 1536 | 16 B | 2.41× | 1.33× | 1.85× | 1.10× | 0.99× |
| 3072 | 0 B | 2.47× | 0.91׆ | 1.02× | 1.08× | 1.08× |
| 3072 | 16 B | 2.47× | 1.19× | 1.87× | 1.08× | 1.06× |
Xeon 6985P-C, AVX-512, JMH 1.37; two forks, three 500 ms warmup and measurement iterations, one pinned thread, preallocated buffers, zero measured collections. Measurement began after idle checks, with no background-load interference detected. Alignment denotes address offset within a 64-byte cache line.
Native timings include the critical FFM call and exclude public-wrapper allocation and validation. Baseline subtraction output allocation is also excluded.
Native has lower mean times in 38 of 40 comparisons. Scalar subtraction at 1,536 floats / 16 B is approximately 1% slower; several other gains are marginal.
† Aligned 3,072-float native sum varied substantially between forks: 106.7 versus 168.0 ns/op. Its aggregate 0.91× result needs a focused repeat before drawing a performance conclusion.
Hamming is omitted because its native kernel was removed from this PR.
Kernel-level speedup using JDK 25
| Dimensions | Alignment | Minimum | Sum | Scale | Vector sub | Scalar sub |
|---:|---:|---:|---:|---:|---:|---:|
| 64 | 0 B | 2.47× | 1.65× | 1.47× | 2.06× | 2.03× |
| 64 | 16 B | 2.45× | 1.71× | 1.52× | 1.84× | 1.88× |
| 768 | 0 B | 1.74× | 1.64× | 1.22× | 1.37× | 1.46× |
| 768 | 16 B | 1.77× | 1.39× | 1.62× | 1.18× | 1.14× |
| 1536 | 0 B | 1.80× | 1.24× | 1.08× | 1.16× | 1.20× |
| 1536 | 16 B | 1.82× | 1.23× | 1.92× | 1.06× | 1.04× |
| 3072 | 0 B | 1.83× | 1.05× | 1.01× | 1.13× | 1.09× |
| 3072 | 16 B | 1.84× | 1.05× | 1.87× | 1.05× | 1.00× |
Temurin JDK 25.0.4.1. The native library is identical to the JDK 22 run.
Native has lower mean times in 40 of 40 comparisons. Results near 1× are marginal or effectively parity. The 768-float / 16 B scale baseline and 1,536-float / 16 B native scalar subtraction showed fork variation; the latter comparison is inconclusive. Aligned 3,072-float sum was consistent across forks at 101.78 ns/op native versus 106.77 ns/op Panama (1.05×).
Commits Breakdown
and Highway SIMD implementations injvector_simd_kernels.cpp..Java FFM bindings withLinker.Option.critical(true)downcall handles inNativeSimdOps.java.inverify_native_lib.sh.to invokeNativeSimdOpsfor both off-heapMemorySegment` buffers and on-heap arrays.