Batch native Highway operations to reduce Java/native overhead #761
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.50) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 634 lines diff across 7 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.386
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #761"
general
weight: 0.35
tlwillke
Goal and changes
Reduce Java/native call overhead and temporary allocation in the Google Highway backend, especially during PQ training and encoding. Builds on the native kernels and provider selection already merged in #753 and #751.
Performance results
Both arms use native Highway AVX-512. Each cell shows main → this PR; bold marks the winning measurement.
PQ training is approximately 1.9–3.2× faster, and encoding 2.3–3.5× faster. Total construction is lower in every comparison. Single-thread query throughput improves in seven of eight dataset/JDK combinations. I confirmed that recall@10 is essentially unchanged.
Construction — seconds, lower is better
| Dataset | JDK | PQ training | PQ encoding | Graph/write | Total process |
|---|---:|---:|---:|---:|---:|
| MPNet | 22 | 4.76 → 2.56 | 3.27 → 0.94 | 53.01 → 29.89 | 65.42 → 37.74 |
| MPNet | 25 | 6.93 → 2.41 | 3.15 → 0.94 | 32.05 → 32.60 | 46.52 → 40.15 |
| Ada002 | 22 | 12.29 → 4.29 | 6.20 → 1.93 | 53.92 → 55.74 | 79.46 → 69.19 |
| Ada002‡ | 25 | 10.24 → 3.47 | 5.99 → 1.84 | 47.11 → 45.29 | 69.56 → 57.18 |
| Cohere† | 22 | 9.31 → 2.87 | 4.28 → 1.42 | 40.76 → 43.84 | 59.82 → 53.78 |
| Cohere | 25 | 7.87 → 2.68 | 4.07 → 1.22 | 37.10 → 41.29 | 54.20 → 50.32 |
| OpenAI3072 | 22 | 23.68 → 7.55 | 13.53 → 5.80 | 106.51 → 116.92 | 156.09 → 142.88 |
| OpenAI3072 | 25 | 20.42 → 6.85 | 13.62 → 5.45 | 119.61 → 118.11 | 165.65 → 143.05 |
Queries — QPS, higher is better
| Dataset | JDK | 1 thread, 1× | 1 thread, 2× | 8 threads, 1× | 8 threads, 2× |
|---|---:|---:|---:|---:|---:|
| MPNet | 22 | 12,180 → 13,136 | 9,324 → 10,021 | 97,973 → 108,674 | 68,327 → 82,580 |
| MPNet | 25 | 12,114 → 13,682 | 9,393 → 10,480 | 89,620 → 92,609§ | 72,653 → 70,871§ |
| Ada002 | 22 | 7,020 → 7,186 | 5,492 → 5,666 | 54,180 → 60,928 | 43,811 → 48,857 |
| Ada002 | 25 | 6,903 → 7,365 | 5,443 → 5,812 | 60,556 → 58,350§ | 46,388 → 50,278 |
| Cohere | 22 | 10,423 → 9,958 | 7,905 → 7,723 | 82,282 → 80,848 | 61,963 → 62,848 |
| Cohere | 25 | 8,420 → 10,661 | 6,530 → 8,080 | 81,661 → 84,463§ | 61,133 → 66,717 |
| OpenAI3072 | 22 | 3,295 → 3,652 | 2,752 → 2,994 | 20,433 → 23,676 | 18,080 → 23,245 |
| OpenAI3072 | 25 | 3,295 → 3,768 | 2,712 → 2,996 | 25,044 → 24,760 | 22,230 → 23,384 |
Graph/write remains slower in several cases. The fresh Cohere/JDK22 repeat shows 7.6% higher graph/write time, with 10.1% lower total construction time; its cause is not established. Cohere/JDK22 single-thread QPS is 2.3–4.5% lower.
Method: BenchYAML, JDK22/25, four nominal-1M datasets, 128 GiB heap, 48 construction workers, deferred batch writer, FusedPQ width8/K256 uncentered/unweighted, NVQ with two 8-bit subvectors, V6 M32/ef100, hierarchy/refinement enabled, pruning and assertions disabled. Every construction uses a fresh codebook and graph. Queries use resident graphs, pinned 1-/8-thread execution, top10 at 1×/2× overquery, and three warmup/measurement rounds.
† Fresh A-B-B-A medians for main
eba7bd4eversus latest PR headcebb94f8, replacing the earlier Cohere/JDK22 construction row.Other rows compare historical main
eba7bd4emeasurements with thef65c91f8rerun on the same server. The latest scalar fix received separate correctness/microbenchmark validation and the Cohere construction repeat; the full query sweep was not repeated after it.Test and methodology