Stream BenchYAML builds with PQ or full precision as well as ASH #852
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 · 463 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.367
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #852"
general
weight: 0.35
MarkWolters
Stream BenchYAML builds with PQ or full precision as well as ASH
Stacked on #856. Review that first; GitHub moves this PR's base to
mainwhen #856 merges.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 refine keeps the model's anisotropic threshold, and once it's done, inserts no longer take the lock.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:
construction.workersset, PQ training and the streaming refine run on the construction pool, as ASH training already does. Default runs keep the library's pools, so earlier results are unchanged.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:- PQ codes built on arrival match one-pass encoding.
- After a refinement, every code comes from the refined model and nodes added before it stay reachable.
- A refined anisotropic model keeps its threshold.
- PQ and None stream, then search, in memory and on disk; on disk, PQ is searched with the reloaded codes.
- PQ codes round-trip through the codes file, and only for indexes that built them.
- Cold starts outside ASH,
refineAfteroutside PQ or belowk, and BQ are rejected.- The examples parse.
- The existing ASH streaming tests are unchanged.
io.github.jbellis.jvector.exampletests (56) pass on Ice Lake (8 cores) with JDK 22 and JDK 25.