Cut native call overhead on small vectors #836
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 334 lines diff across 4 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.348
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #836"
general
weight: 0.35
MarkWolters
The native provider made billions of tiny native calls on small vectors and PQ subspaces, where each call costs more than the math. In 4.1.0-rc.1 that made a 128 dim case using PQ with 2-float subspaces about 2x slower on native than on Panama. This fixes the causes instead of sending small vectors to Panama, so no dimension threshold is needed. It supersedes #791 and depends on #834.
PQ train, encode and graph build time, 100k vectors (50k at 768–1024d, 30k at 1536d, 20k at 3072d), GNR (48 cores), main vs this PR, both with #834:
| Dims, subspace width, similarity | native JDK 22 | native JDK 25 | Panama JDK 22 | Panama JDK 25 |
|---|---|---|---|---|
| 1, 1 float, Euclidean | 3.5 → 3.1 s | 3.1 → 3.1 s | 3.1 → 3.3 s | 3.5 → 3.2 s |
| 8, 1 float, Euclidean | 2.5 → 2.2 s | 2.5 → 2.2 s | 2.1 → 2.1 s | 2.1 → 2.1 s |
| 128, 1 float, Euclidean | 16.0 → 6.2 s | 15.1 → 6.2 s | 9.6 → 7.9 s | 8.8 → 5.8 s |
| 128, 2 floats, Euclidean | 9.4 → 4.5 s | 8.7 → 5.6 s | 6.6 → 5.8 s | 5.1 → 4.7 s |
| 128, 2 floats, cosine | 13.5 → 5.1 s | 12.6 → 6.3 s | 7.6 → 5.3 s | 6.2 → 4.5 s |
| 128, 8 floats, Euclidean | 4.1 → 3.3 s | 3.6 → 3.2 s | 3.5 → 3.1 s | 3.1 → 2.7 s |
| 768, 4 floats, dot product | 12.2 → 5.6 s | 11.6 → 5.9 s | 8.2 → 7.2 s | 5.4 → 4.9 s |
| 1024, 8 floats, dot product | 9.8 → 4.5 s | 9.4 → 4.6 s | 7.0 → 7.1 s | 4.2 → 4.1 s |
| 1536, 8 floats, dot product | 8.3 → 3.9 s | 8.1 → 4.1 s | 6.5 → 5.5 s | 4.2 → 3.8 s |
| 3072, 8 floats, dot product | 11.1 → 5.0 s | 10.5 → 4.9 s | 7.8 → 5.9 s | 4.7 → 4.3 s |
Data: SIFT for 1–128d, Cohere for 768–1024d, OpenAI for 1536–3072d. Across all 39 shapes tested (1–3072 dims, 1- to 32-float subspaces, all three similarity functions), this PR / main averages 0.70 on native and 0.89 on Panama; the cells near 1.0 are 1–16 dim builds of 2–3 s, within run-to-run noise.
Ice Lake (8 cores) cells run so far agree (128d with 1-float subspaces: 123 s → 19 s native). Ice Lake (32 cores) results for the full set to follow.