Repository navigation
Conversation
Each codec defines how a streaming index starts and what an insert does; PQ encodes into mutable codes on arrival.
Streaming PQ indexes keep their codes beside the index; refineAfter fine-tunes the codebook once and rescores the graph.
Contributor
|
Before you submit for review:
If you did not complete any of these, then please explain below. |
tlwillke
marked this pull request as ready for review
November 28, 2026 07:18
tlwillke
requested review from
MarkWolters,
ashkrisk,
dian-lun-lin,
jshook,
r-devulap and
vasimuddinmd
as code owners
November 28, 2026 07:18
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stream BenchYAML builds with PQ or full precision as well as ASH
BenchYAML's
construction.streaming: Yesbuilt only ASH indexes. In-progress PQ codes, which a database uses while it builds an index, could be timed only with a JMH benchmark. This change lets any streaming case use ASH, PQ or no compression. In-progress PQ builds can then be benchmarked from a YAML file, and PQ and ASH compared for live graph builds that might one day replace full-precision ones. One use is checking a fix for #845 on both PQ paths.Each construction compression defines how a streaming index starts and what an insert does:
StreamingASHIndexstarts warm (coldStartSize: [0]) or cold, and may train while vectors arrive.MutablePQVectorsand then added to the graph, which scores with those codes. WithrefineAfter: [N], once N vectors have arrived, inserts wait while the codebook is fine-tuned on them (ProductQuantization.refine), the codes so far are re-encoded, and the graph's edges are rescored (GraphIndexBuilder.rescore). This is what a compaction that inherits a codebook does.The rest is shared: one insert thread per construction worker in file order, the timings, the memory report, and the
onDiskwrite and reload. Searches use the codes the index built. For ASH and PQ, those codes are stored beside the index, both on disk and in the saved-index cache, and reloaded with it. The codes file gains a PQ format for this, and batch builds still store only ASH codes, as before.onDiskNone indexes are searched withsearch.compression, as other on-disk builds are.PQ and None take no cold start:
coldStartSizeandtrainWhileStreamingare rejected unless omitted,[0]orNo.refineAfterrequires PQ and is 0 or at least the PQk, so every centroid is refined from its own vectors. BQ streaming is rejected, becauseMutableBQVectorsis not safe for concurrent writes.Also:
index-parameters/streaming-pq(cohere-english-v3-1M, PQ with D/8 subspaces, with and without a refinement after 128,000 vectors) andindex-parameters/streaming-fp(the same build with exact scores).Streaming times are comparable only with other streaming runs: insert order and threads differ from batch builds.
Tests
TestGridASHIntegration:refineAfteroutside PQ or belowk, and BQ are rejected.io.github.jbellis.jvector.exampletests (56) pass on Ice Lake (8 cores) with JDK 22 and JDK 25.