Add int8 / byte-vector similarity support #709
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
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.368
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #709"
general
weight: 0.35
r-devulap
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
VectorValuessuper-interface that captures shared random-access behavior, then refactorsRandomAccessVectorValues(float) to extend it, and addsRandomAccessByteVectorValuesand its list-backed implementationListRandomAccessByteVectorValuesas the byte-vector counterpart. Also updatesBuildScoreProviderto use the generalized thread-local supplier.2. c55574c — Add byte-similarity methods to VectorUtilSupport / VectorUtil / DefaultVectorUtilSupport
Adds
dotProduct,squaredL2, andcosineforbyte[]/ByteSequenceto the vector utility stack.3. 9ba737a — Add ByteVectorSimilarityFunction enum
Mirrors the float
VectorSimilarityFunctionenum; wraps the three byte similarity metrics with acompare()API and score normalization.4. 5652b46 — Add BuildScoreProvider.byteVectorScoreProvider and searchProviderFor(ByteSequence)
Adds
byteVectorScoreProvider()factory andsearchProviderFor(ByteSequence)so the graph builder can score byte-vector candidates.5. 389c391 — Wire byteVectorScoreProvider into GraphIndexBuilder
GraphIndexBuildernow acceptsRandomAccessByteVectorValuesand 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
FeatureIdandInlineByteVectorsclass for serializing byte vectors into the graph index file format, plusOnDiskGraphIndexreader 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), andListRandomAccessByteVectorValues.---
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_VECTORSis 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 aQuerySetseam 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.