← Back to Pull requests

Add int8 / byte-vector similarity support #709

Closed
unknown closed this pull request without merging on Nov 23, 2026 06:10 UTC
View on GitHub
unknown unknown commented on Aug 11, 2026 08:26 UTC
Author

INT8 (Byte-Vector) Support for JVector

Overview


This branch adds full INT8 (byte-vector) support to JVector — from the math primitives all the way through graph building, on-disk storage, SIMD acceleration, and end-to-end tests.

---

Commits

1. fd131a7 — Add random-access int8 vector value support


Introduces a new VectorValues super-interface that captures shared random-access behavior, then refactors RandomAccessVectorValues (float) to extend it, and adds RandomAccessByteVectorValues and its list-backed implementation ListRandomAccessByteVectorValues as the byte-vector counterpart. Also updates BuildScoreProvider to use the generalized thread-local supplier.

2. c55574c — Add byte-similarity methods to VectorUtilSupport / VectorUtil / DefaultVectorUtilSupport


Adds dotProduct, squaredL2, and cosine for byte[] / ByteSequence to the vector utility stack.

3. 9ba737a — Add ByteVectorSimilarityFunction enum


Mirrors the float VectorSimilarityFunction enum; wraps the three byte similarity metrics with a compare() API and score normalization.

4. 5652b46 — Add BuildScoreProvider.byteVectorScoreProvider and searchProviderFor(ByteSequence)


Adds byteVectorScoreProvider() factory and searchProviderFor(ByteSequence) so the graph builder can score byte-vector candidates.

5. 389c391 — Wire byteVectorScoreProvider into GraphIndexBuilder


GraphIndexBuilder now accepts RandomAccessByteVectorValues and routes to the byte score provider, enabling full graph construction over int8 data.

6. c6dfea0 — Vectorize ByteSequence similarity metrics with SIMD


Panama SIMD and AVX-512 native kernels for int8 dot-product, L2, and cosine; adds native benchmarks and C++ unit tests.

7. 3d4dada — Add InlineByteVectors feature for native int8 on-disk storage


New FeatureId and InlineByteVectors class for serializing byte vectors into the graph index file format, plus OnDiskGraphIndex reader support.

8. 974f508 — Add INT8 end-to-end tutorial (Int8Example)


End-to-end walkthrough showing how to build, serialize, and query a byte-vector graph index; registered in TutorialRunner.

9. b0ad5cd — Add int8 test coverage for byte-vector similarity, RABVV, BSP, SIMD, graph build, and disk round-trip


Unit tests for ByteVectorSimilarityFunction, BuildScoreProvider, TestVectorizationProvider (SIMD), TestVectorGraph (build), TestOnDiskGraphIndex (round-trip), and ListRandomAccessByteVectorValues.

---

Merge with main (on-disk format v7) and follow-ups

10. Merge main into int8-support


Int8 vectors join fused ASH and page alignment in on-disk format v7; INLINE_BYTE_VECTORS is feature 7, and version 6 writers reject it. The int8 header stores the largest vector length, reserved for int8 adaptive stopping. The benchmark harness gains a QuerySet seam so float and int8 queries share one execution path; float query behavior is unchanged.

11. 2a825ea — Reject zero int8 COSINE vectors as ASH does; define int8 max norm


Under COSINE, a zero vector added to a graph or used as a query throws IllegalArgumentException, through one per-vector hook (ByteVectorSimilarityFunction.similarityInput) that future int8 normalization can reuse.

12. a017c52 — Strip trailing whitespace in int8 native kernels; document int8 support


Int8 entries in the native README and the user guides.

Testing: Java tests pass on JDK 22 and 25, and native C++ tests pass on every dispatch tier (SSE4.2 to AVX3_SPR). On 177k mixedbread-large int8 embeddings, int8 matches an FP32 index of the same vectors in recall (0.86 @10, 0.96 @100), with 3.4–3.8× the QPS, a 1.9× faster build and a 3.6× smaller index.

Diff: 471 lines (+353 / -118) across 5 files Reviewer: r-devulap Review duration: 149623m
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 · 471 lines diff across 5 files
0.46
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.368
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #709"
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: 45.7% (MEDIUM) · Higher = larger blast radius
45.7%
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: 18.1% · Safe to merge
18.1%