Repository navigation
JVector Release Notes
Version: 4.0.2 - 4.1.0-rc.1
New Features
Native Int8 (Byte) Vector Support
PR: #709
Description
JVector can now build, store and search signed int8 vectors natively, without converting them to float32.
This is useful when an embedding model already emits int8 vectors, or when vectors have been scaled to
int8 up front: they take 4x less space on disk and in memory than float32, and all scoring is done
byte-by-byte. On 176,582 mixedbread-large int8 embeddings (1,024 dimensions), an int8 index matched the recall
of a float32 index of the same vectors, with about 3.6x the queries per second, half the build time and a
3.6x smaller file.
RandomAccessByteVectorValues(andListRandomAccessByteVectorValues) provide random access to
ByteSequencevectors. It andRandomAccessVectorValuesnow share a commonVectorValues<V>
interface, which also providesgetVectorInto(node, destination, offset)for reading a
vector into a caller-owned buffer.ByteVectorSimilarityFunctionscores two int8 vectors:EUCLIDEANis1 / (1 + squaredL2),
DOT_PRODUCTisdot < 0 ? 1 / (1 - dot) : dot + 1, andCOSINEis(1 + cosine) / 2. The scores are
not normalised by dimension, so distinct integer distances stay distinct at high dimensions.
DOT_PRODUCTscores are positive but not bounded above by 1.GraphIndexBuilder.builder(RandomAccessByteVectorValues, ByteVectorSimilarityFunction, M)builds a graph
from int8 vectors, andGraphIndexBuilder.build(VectorValues<?>)accepts either vector type.- The
InlineByteVectorson-disk feature (FeatureId.INLINE_BYTE_VECTORS) stores each vector asdimension
raw bytes.OnDiskGraphIndex.View.byteVectorRerankerFor(...)scores candidates directly from disk, and
getByteVectorInto(...)reads a vector into a reusable buffer. - Int8 distance kernels (squared L2, dot product, cosine) are available in the default, Panama and native
SIMD implementations, and accumulate in integers so all execution paths return identical results. BenchYAMLandAutoBenchYAMLsupport int8 datasets: mark a dataset withis_int8: truein
dataset-metadata.yml, and configure it withconstruction.type: onDisk, compressionNone,
reranking.type: NoneandfusedGraph: [No], as the int8 configs inindex-parametersdo.
A runnable example is inInt8Example(-Dtutorial=int8).
How to Enable
No configuration is required; the float32 APIs are unchanged. To use int8 vectors, build with the byte-vector
builder and write the index with the InlineByteVectors feature:
RandomAccessByteVectorValues vectors = new ListRandomAccessByteVectorValues(byteVectors, dimension);
try (var builder = GraphIndexBuilder.builder(vectors, ByteVectorSimilarityFunction.EUCLIDEAN, 32).build()) {
var graph = builder.build(vectors);
try (var writer = GraphIndexWriter.getBuilderFor(GraphIndexWriterTypes.RANDOM_ACCESS_PARALLEL, graph, path)
.with(new InlineByteVectors(dimension)).build()) {
writer.write(Map.of(FeatureId.INLINE_BYTE_VECTORS, n -> new InlineByteVectors.State(vectors.getVector(n))));
}
}Notes
- The new interfaces and classes are marked
@Experimentaland the API may change in later releases. - Only signed int8 (-128..127) is supported. Unsigned uint8 data, such as conventional SIFT1B/BIGANN
.bvecs
files, must be converted first; it is not detected, and reading it as signed silently changes distances. - Quantization and compression (ASH, PQ, BQ, NVQ, fused graphs) are not supported for int8 vectors. Traversal
already scores exactly, so a separate reranking step is not needed.rerankKstill controls how much of the
graph is searched. - Zero vectors are not supported with
COSINE, as with ASH: adding one to a graph or searching with one
throwsIllegalArgumentException. OnDiskGraphIndexCompactordoes not compact int8 indexes;AutoBenchYAMLskips its compaction benchmark for them.- Existing float32 callers keep working:
RandomAccessVectorValues.getVectorkeeps itsVectorFloat<?>
signature andGraphIndexBuilder.build(RandomAccessVectorValues)is retained as a forwarding overload. - Int8 indexes require on-disk format version 7 or later. JVector 4.0.x reads formats up to 6 and rejects
version 7 files; a version 6 writer rejectsINLINE_BYTE_VECTORS.
Asymmetric Scalar Hashing (ASH) quantization
PR: #796
Description
JVector adds ASH, from
ASH: Asymmetric Scalar Hashing With Learned Dimensionality Reduction for High-Fidelity Vector Quantization
(Tepper and Willke, CIKM 2026). ASH projects database vectors with a learned orthonormal
matrix and stores each projected dimension in 1 to 9 bits, while queries stay full precision.
On large datasets at matched code sizes, fused ASH builds faster than fused PQ, is more accurate,
and searches faster in nearly every case; see ASH performance.
ASH is @Experimental; PQ remains the stable default.
- Training and encoding:
AsymmetricHashing.initializeandencodeAll, producingASHVectors. - In-memory graphs:
ASHVectorsscore construction and search;BuildScoreProvider.ashBuildScoreProviderbuilds with code-to-code scoring. - Fused ASH on disk: the
FusedASHfeature stores neighbors' codes with each adjacency list, reranking with NVQ or full-precision vectors. - Streaming construction:
StreamingASHIndexbuilds and searches while vectors arrive, training its model cold if needed. - Native query projection: INT8, FP16 or FP32, chosen automatically by CPU; FP16 and some INT8 paths use the optional oneDNN add-on.
- Prepared and queued queries:
QueryPreparer,PreparedQueryandBatchingExecutorshare batched query projection. - Page-aligned records:
withPageAlignment(pageBytes)keeps base-layer records from crossing page boundaries, for indexes larger than memory.
How to Enable
ASH is opt-in. See HelloASHWorldFp16
for a complete fused ASH build and search, and ASH configuration and defaults
for settings.
Notes
- Format version 7. New files default to version 7, which JVector 4.0.x cannot read; pass
withVersion(6)to keep rollback possible. See UPGRADING.md. - Similarity. A model is trained for
DOT_PRODUCT,EUCLIDEANorCOSINEand rejects other functions; vectors need not be normalized. - Adaptive termination.
GraphSearcher.useAdaptiveTermination(true)is experimental and off by default for search. - BLAS threads. ASH training sets the native BLAS thread count;
MKL_NUM_THREADSis no longer needed. - Compaction.
OnDiskGraphIndexCompactordoes not yet compact fused ASH or page-aligned indexes. - Native build. Highway is a Meson wrap instead of a git submodule; the oneDNN add-on is a separate Meson project.
Documentation
ASH configuration,
database integration,
projection precision,
larger-than-memory indexes,
reproducing ASH versus PQ,
native build and
Hello ASH examples.
Compaction: sharded compaction sessions and a choice of output format version
PR: #798
Description
JVector 4.0.2 made OnDiskGraphIndexCompactor find level-0 neighbours by scanning cells instead of
searching (#740). This change builds on it in three ways.
- Sharded compaction sessions. A host that splits a merge into several outputs (Cassandra writes
one sstable per token range) previously ran one compaction per output. Each run trained the
codebooks again, and each lost recall: a shard keeps only a small part of every source, so a node
kept few of its same-source edges and nothing replaced them. A session trains the codebooks once,
on the live nodes of every shard, and shares them. In each shard it also searches a source with
fewer than half its nodes live for the node's own neighbours. Ordinarycompactcalls are
unchanged. withVersion(int)writes the output at any on-disk format version the writer supports instead
of onlyOnDiskGraphIndex.CURRENT_VERSION. Sources may be at different versions. A version that
cannot hold the output is rejected: fused PQ needs 6, and upper layers need 4 or above.- Faster merges larger than memory. The cell walk sizes its ranges from the heap and from what it
measures, announces source records to the page cache ahead of reading them, frees its tables
before writing the upper layers, and reads the merge store with direct I/O when the store does not
fit in memory beside the heap.
tessera-2M, two 1M-vector sources (1024 dimensions, cosine, degree 32) merged into hash shards, 8 cores. Each
cell shows total time and recall@10:
| Shards | One compaction per shard | One session | Rebuild of every shard |
|---|---|---|---|
| 4 | 454 s, 0.781 | 566 s, 0.825 | 876 s, 0.836 |
| 16 | 981 s, 0.823 | 567 s, 0.894 | 946 s, 0.903 |
| 64 | 1203 s, 0.875 | 627 s, 0.945 | 886 s, 0.947 |
How to Enable
Open a session on a compactor built with the live nodes of every shard, then merge each shard:
var compactor = new OnDiskGraphIndexCompactor(sources, liveNodes, VectorSimilarityFunction.COSINE, null);
var session = compactor.sharded();
List<OrdinalMapper> shard0 = session.compactShard(shard0LiveNodes, output0);
List<OrdinalMapper> shard1 = session.compactShard(shard1LiveNodes, output1);Sources with a compressed sidecar use compactShard(shardLiveNodes, graphPath, compressedPath).
To choose the output's format version, call compactor.withVersion(6) before compacting; a session
writes every shard at its compactor's version. The large-merge changes need no configuration.
Notes
sharded(),compactShardandwithVersionare@Experimental. A session is not thread-safe:
shards are compacted one at a time, and may become known one at a time.- At 4 shards the same-source search costs more time than shared training saves; from 16 shards
the session is faster and its recall is within a point of a rebuild. - A merge whose top levels have no live node, which a shard can produce, now ends its hierarchy at
the highest level that still has one instead of failing. - Record announce-ahead is asynchronous (
POSIX_MADV_WILLNEED) only with thejvector-native
reader. Other readers fall back to their synchronousprefetch. - See compaction for details.
Enhancements
BenchYAML: ASH defaults, explicit pipelines and one-JVM experiments
PR: #796
Description
BenchYAML's index YAML schema 3 states each pipeline explicitly: index type, construction and
search compression, construction scoring, reranking, query execution (direct or queued), and
construction and search worker counts. It can also sweep the upper layers' degree separately from
the base layer's. Schema 1 files are still accepted.
- Defaults. Without arguments, BenchYAML runs a few small public datasets and prints the key
results. Compressed dataset defaults now use fused ASH. - Results. Runs report stored-code load and write times and the codes file size. Every console
and CSV result field is defined in the BenchYAML Guide. - Measurement settings. Run configurations can measure cold queries, and a larger-than-memory
run configuration is included. - One-JVM experiments.
benchyaml-play.shbuilds the checkout and runs one experiment in one
JVM from the command line or IntelliJ.
How to Enable
Set yamlSchemaVersion: 3 to use the new fields. See the BenchYAML Guide,
the example pipelines and the
benchmark launcher.
Performance Improvements
MutablePQVectors Updates Its Vector Count Without a Capturing Lambda
PR: #639
Description
MutablePQVectors.encodeAndSet and setZero raised the vector count with
updateAndGet(current -> max(current, ordinal + 1)), a lambda that captures ordinal and so may
allocate on every call. They now use accumulateAndGet(ordinal + 1, Math::max), which passes the
value as an argument and needs no allocation. The result and its atomicity are unchanged. In JMH
runs on JDK 22 and 25, the JIT already removed the old allocation once the code was warm, so
encodeAndSet time and allocation are unchanged in steady state.
How to Enable
No configuration is required.
Bug Fixes and Issue Resolutions
GraphIndexBuilder Closes the Per-Thread Vector Copies It Creates
PR: #715
Description
For a shared RandomAccessVectorValues (one that reuses a buffer, such as a file-backed source),
threadLocalSupplier() hands each thread its own copy(), but nothing could close those copies, so AutoCloseable
copies (for example, ones holding a mapped file) stayed open. The supplier for shared sources is now AutoCloseable:
closing it closes every AutoCloseable copy it created and clears the per-thread cache. GraphIndexBuilder.build
and buildAndMergeNewNodes close their supplier when construction ends, and only after every parallel worker has
stopped, even if one fails. Copies made by RemappedRandomAccessVectorValues now close their copy of the wrapped
source, which is never closed itself. See #635.
How to Enable
No configuration is required.
Notes
Code that calls threadLocalSupplier() itself can close the returned supplier when it is an AutoCloseable to
release its copies; the supplier stays usable afterwards and makes new copies on demand. Un-shared sources still get a
supplier that returns the source itself. Copies held by the exact-scoring build score providers are not yet closed;
that is tracked in #764.
Correct Fused PQ Retained Memory Accounting
PR: #781
Description
Correct ramBytesUsed() for fused PQ sources, byte sequences, and shared on-disk
graph caches. Remove the erroneous four-times multiplier on source byte counts,
include retained buffer wrappers, native heap segment scopes, graph metadata,
cache capacity, adjacency-array overhead, and models read from the index header
(fused PQ codebooks, NVQ parameters), which only the index holds. PQ and NVQ models,
float vectors and PQ scoring tables report their full retained storage, including caches
created after loading. Sizing follows the
running JVM's reference sizes, headers, array element offsets, and alignment, including
JDK 25 compact object headers, without sun.misc.Unsafe.
Graph and built-in PQ vector memory checks use cached totals. Loading and storage
growth update these totals, including spare chunk-reference capacity; repeated checks
allocate nothing, and their cost does not grow with the number of vectors.
How to Enable
Automatic; no configuration is required.
Notes
Reported sizes can increase or decrease, affecting applications that use these
estimates for memory limits or cache sizing. Existing indexes do not require
rebuilding; the on-disk format and search results are unchanged.
Loaded graph feature metadata is read-only. Resident buffers are counted at their
allocation sites; fixed per-index metadata is a small estimate. Feature implementations
can override Feature.ramBytesUsed(); worker scratch remains excluded. See
retained memory accounting for the ownership
boundary, reporting cost, and validation details.
GraphSearcher Returns an Empty Result for topK == 0
PR: #812
Description
GraphSearcher.search with topK == 0 read the empty results queues: with a reranker it threw a
NullPointerException from NodeQueue.rerank, and with rerankK == 0 it compared against and evicted stale heap
slots, which could throw on a later resume or make the search depend on the previous query. search and resume
now return an empty result without searching when topK (or additionalK) is 0, and NodeQueue.rerank sends every
candidate to the unused pile when topK is 0. See #811.
How to Enable
No configuration is required.
Notes
Callers that short-circuit k == 0 before calling search as a workaround can keep doing so; it is no longer
necessary.
GraphIndexBuilder Searches With No Score Floor, So DOT_PRODUCT Vectors Dissimilar to Everything Get Neighbors
PR: #814
Description
GraphIndexBuilder.addGraphNode and improveConnections searched with a score threshold of 0.0f. That accepts
everything for COSINE and EUCLIDEAN, but DOT_PRODUCT scores are (1 + dot) / 2, which is negative for
non-normalized vectors. Every candidate of a vector that is dissimilar to all the others was discarded, so it was
inserted with no neighbors; if it was the entry node, the index was built without any edges and searches returned a
single result. The builder now uses Float.NEGATIVE_INFINITY, as GraphSearcher.internalSearch already does. See
#813.
How to Enable
No configuration is required. COSINE and EUCLIDEAN builds are unchanged.
Notes
On ordinary non-unit DOT_PRODUCT data recall did not change (20,000 x 128-dimension vectors, recall@10 1.0000 to
0.9993 across four scalings, the same with and without the change). Non-normalized DOT_PRODUCT graphs can still be
poorly connected for other reasons.
GraphIndexBuilder Uses No Rerank Floor in the Layer-0 Resume, and improveConnections Is Tested
PR: #820
Description
Follow-up to #814. The layer-0 resume in
GraphIndexBuilder.addGraphNode still passed a rerank floor of 0.0f. A score provider with a reranker only reranks
candidates at or above the floor, so with a custom provider and non-normalized DOT_PRODUCT vectors, a node
dissimilar to everything got only its single best candidate as a neighbor. The floor is now Float.NEGATIVE_INFINITY.
The built-in build score providers have no reranker and were not affected. A test now also covers improveConnections
on an upper-layer node whose similarities are all negative. See #817.
How to Enable
No configuration is required.
Notes
Only builds with a custom BuildScoreProvider that supplies a reranker, and DOT_PRODUCT on non-normalized
vectors, change.
neighborOverflow Values Such as 1.3 and 1.4 No Longer Trip an Assertion
PR: #823
Description
Inserting a backlink capped the neighbor list at M * neighborOverflow computed in float, while the neighbor
arrays were sized from the same product computed in double. For overflow factors such as 1.3, 1.4, 1.8 and 1.9 the
float product rounds up to the next integer for some M (for example 1.4 with M = 5, 10, 15, ...), so with
assertions enabled the build failed with "could exceed max overflow degree", and without them a neighbor list could
briefly hold one neighbor more than intended. Both now use the double product. See
#822.
A builder over an existing graph could also be given a larger neighborOverflow than the graph's arrays were sized
for; the build then failed with "Cannot copy ... nodes to a smaller size". The cap now never exceeds the arrays' size.
How to Enable
No configuration is required.
Notes
The default overflow of 1.2 is not affected.
Documentation and Tutorials
Documentation Site
PR: #825
Description
JVector's documentation in docs/ is published at datastax.github.io/jvector,
which the README and the repository's About section now link to.
How to Enable
No configuration is required.
Testing Enhancements
Modular Benchmark Harness: Grid Refactor for BenchYAML and AutoBenchYAML
PR: #776
Description
Grid, the engine behind BenchYAML and AutoBenchYAML, was refactored so that each benchmarking initiative can put its changes in its own files. Almost every core change also changed Grid.java, and with several initiatives in flight at once it had merge conflicts at nearly every release. The class is now a small orchestrator (692 lines, down from 1,395). Its extension points live in separate files in io.github.jbellis.jvector.example:
| Concern | Before | Now |
|---|---|---|
| Two pipelines | runAll and runAllAndCollectResults were near-copies |
One pipeline; AutoBenchYAML adds a result collector |
| Build parameters | 5–7 positional arguments threaded through every method | BuildConfig (one build point) and SearchConfig (the search sweep) |
| Construction sweep | Six hand-nested for loops |
GridSpec with ordered SweepDimensions; GridSpec.fromGrids(...) sets the order, and GridSpec.fromConfig(MultiConfig) maps the YAML onto it |
| Graph construction | Inline buildInMemory / buildOnDisk |
IndexBuildStrategy: InMemoryBuild, CompressedOnDiskBuild (includes the index cache) |
| Core builder/writer calls | Spread through Grid | GraphBuilderFactory only |
| On-disk features | A switch on FeatureId plus FUSED_PQ checks in five other places |
FeatureProvider per feature (InlineVectorsProvider, NVQProvider, FusedPQProvider), registered in FeatureProviders |
| Console, experiments.csv, AutoBench results | Inline in testConfiguration |
GridListeners: ConsoleReportListener, ExperimentsLogListener, BenchResultCollector |
| Reported build parameters | Listed separately by each output | BuildConfig.reportedParameters() |
Each step was checked against the previous code on lastfm-64-dot by comparing experiments.csv rows, AutoBench BenchResult output, console tables, and the builds, cache hits and skip messages logged. Output matched except for the changes listed below.
How to Enable
No configuration is required. Command lines, dataset YAML files (yaml-configs/index-parameters/), run-config.yml, and the experiments.csv schema (v1) are unchanged.
Running BenchYAML: what changes
- Unchanged: command line, YAML configs,
run-config.ymlselections, experiments.csv columns and values, console table columns. - Feature-set order is stable. Indexes are searched in the configured order. That is the
rerankinglist order, with eachfusedGraphvalue producing a full pass over it, e.g.reranking: [NVQ, FP]gives NVQ then FP. Previously the order of console blocks and experiments.csv rows changed between runs, becauseEnumSethash codes come from identity hashes. - No stale search timings on fused rows. Fused-PQ indexes skip search compression, but they could report the previous index's
Search PQ encoding (s). They no longer do. - PQ codebooks are reused within a run. The in-memory compressor cache never hit, so every lookup reloaded the codebooks from
pq_cache(onecodebooks loaded fromline each). Results are unchanged; repeat loads are gone. - NVQ compressors can be cached.
NVQParameters.idStringForno longer throws (same fix as #780), and cached compressors are now read back by theCompressorParametersthat saved them (loadCompressor) instead of always as PQ, which would have returned a corrupt PQ or failed on the second run. Files still go inpq_cache; the load message is now<compressor> loaded from <file>. - Clearer errors for incomplete configs. A missing construction sweep field fails with its name, e.g.
No values to sweep for outDegreeorconstruction.useSavedIndexIfExists must be set, instead of a bareNullPointerException. The whole sweep is validated before the first build. - Features without a provider are rejected. A feature set containing a feature Grid cannot write (e.g.
SEPARATED_VECTORS) fails when theGridSpecis built, withGrid has no FeatureProvider for <id>. Previously the index was built without that feature and the results were still labeled with it. YAML configs cannot produce such a feature set (rerankingaccepts onlyFPandNVQ), so this affects only harnesses that build feature sets in code. - Feature checks run before any file is written. "Bench looks for either NVQ_VECTORS or INLINE_VECTORS feature set for scoring compressed builds" and "FusedPQ requires PQ build compression with 256 clusters" now fail before any index writer is opened, so a failed run no longer leaves partial index files.
- Console messages. In-memory builds now print
Skipping [INLINE_VECTORS, FUSED_PQ] when building in memory: it needs a compressed build.
Running AutoBenchYAML: what changes
AutoBenchYAML now runs through the same pipeline as BenchYAML. Its command line (--output, --config, --diag, dataset patterns), output files (<output>.csv, <output>.json, checkpoint), and fixed regression benchmark set are unchanged.
- One graph per build configuration. Each feature set is still written to, and searched in, its own index file. The difference is that the old path rebuilt the graph and rewrote every feature set's file for each feature set and each search compressor, then searched only one of them. With F feature sets and S search compressors (index cache off), it did F × S graph builds and F × F × S file writes; it now does 1 and F. The graph does not depend on the feature set (compressed builds score with the PQ/BQ build vectors), and search compression is not stored in the index, so the repeats only produced more random graphs with the same parameters.
- Results to expect when comparing against an earlier run:
- CSV columns unchanged; Build Heap / Build Off-Heap values shift. The build memory snapshot is now taken right after the build, before search vectors are encoded. Expect one comparison cycle where these move.
- Index Build Time. On earlier code this was the last of the redundant builds, each doing the same work as the single build now, so values are comparable with less run-to-run noise. When every index for a build config is loaded from the index cache, no build time is reported for it; earlier code reported the previous build config's time.
- Within a build config, INLINE and NVQ rows search the same graph. Comparisons between feature sets then differ only in stored features and reranking, and
Avg Visitedmatches between them. - Total run time drops, and off-heap memory stays flat because indexes are now closed after use, including when a search fails.
- JSON (
<output>.json):- Parameter keys are unchanged.
buildCompressor/searchCompressorremain lambdatoString()values, which differ between runs; exclude them when diffing. - Existing metric keys are unchanged. Construction metrics are added when measured:
Index build time (s),Index file size (MB),Idx PQ compute (s),Idx PQ encoding (s),Idx NVQ compute (s),Search PQ compute (s),Search PQ encoding (s).BenchmarkSummarizerdoes not read these, so the CSV is unaffected. - Rows follow the configured feature-set order.
- Rows follow BenchYAML's sweep order. Construction parameters now vary as addHierarchy → refineFinalGraph → outDegree → neighborOverflow → efConstruction → build compression (first slowest), where AutoBench previously used M → efConstruction → neighborOverflow → addHierarchy → refineFinalGraph. Within each index, usePruning now varies slower than topK (previously the reverse). Parameter values per row are unchanged, so match rows by their
paramsrather than position. The CSV is unaffected:BenchmarkSummarizeraverages over rows, and the last row, whose Index Build Time it reports, is the same build config in both orders.
- Parameter keys are unchanged.
- Console. AutoBenchYAML now prints the same per-configuration tables as BenchYAML.
- Checkpoints. The
BenchResultformat is unchanged, so a checkpoint from an earlier build can be resumed. Datasets completed before the upgrade keep their earlier metrics (no construction metrics, earlier memory snapshot timing).
Updating the harnesses
Entry points (all callers in the repository have been migrated):
// BenchYAML, HelloVectorWorld
Grid.run(ds, GridSpec.fromConfig(config), artifacts);
// AutoBenchYAML
List<BenchResult> results = Grid.runAndCollectResults(ds, GridSpec.fromConfig(config));| To add | Change |
|---|---|
| A construction parameter | A field and builder setter with a default in BuildConfig; its use, usually in GraphBuilderFactory; its field in ConstructionParameters. If swept, a parameter and one sweep(...) line in GridSpec.fromGrids, and the argument at its callers (fromConfig, Bench, and a single default value in the deprecated runAllAndCollectResults). To report it, one line in BuildConfig.reportedParameters() (it then appears in the console config block and AutoBench JSON params). |
| An experiments.csv column for it | Its name in ExperimentsSchemaV1.BUILD_PARAMETER_COLUMNS. This changes the versioned CSV schema, so it is deliberate, not automatic. |
| A search parameter | A field and builder setter in SearchConfig, and its loop in Grid.testConfiguration. |
| An on-disk feature | A new FeatureProvider file and one register(...) line in FeatureProviders. |
| A report or output format | A new GridListener file and one line where the entry point builds its listener list (Grid.reportingListeners or Grid.runAndCollectResults). |
| Data for listeners | A field on SearchContext, set where Grid.runOneGraph creates it. |
Example: a new swept construction parameter myKnob:
// BuildConfig: field, constructor assignment, and a builder setter with a default
public final int myKnob;
private int myKnob = 4;
public Builder myKnob(int myKnob) { this.myKnob = myKnob; return this; }
// ConstructionParameters: the YAML field
public List<Integer> myKnob;
// GridSpec.fromGrids: a List<Integer> myKnobGrid parameter and its sweep. The position in the chain
// sets its place in the output order; SweepDimension rejects a null list, so default it if the YAML
// field is optional. Then pass construction.myKnob from fromConfig, and a grid from Bench.
.sweep("myKnob", myKnobGrid, BuildConfig.Builder::myKnob)
// BuildConfig.reportedParameters(): show it in console and JSON results
params.put("myKnob", myKnob);
// GraphBuilderFactory: pass build.myKnob to the core builderExample: a new on-disk feature:
final class MyFeatureProvider implements FeatureProvider {
public FeatureId id() { return FeatureId.MY_FEATURE; }
public void configure(FeatureWriteContext ctx) {
ctx.add(new MyFeature(ctx.vectors().dimension()));
ctx.supplyFromVector(FeatureId.MY_FEATURE, vector -> new MyFeature.State(vector));
}
// Override supportsInMemoryBuild, providesRerankVectors, providesApproximateScoring or
// checkCompressedBuild if the defaults do not fit.
}
// FeatureProviders: register(new MyFeatureProvider());Porting in-flight branches that changed Grid
Old location in Grid.java |
New location |
|---|---|
runAll(...) overloads |
Removed (package-private); use Grid.run(ds, spec, artifacts) |
Sweep loops in runAll / runAllAndCollectResults |
GridSpec.fromGrids and GridSpec.buildPoints() |
runAllAndCollectResults body |
Grid.runAndCollectResults; the old method is a @Deprecated adapter |
buildInMemory |
InMemoryBuild |
buildOnDisk, writeInlineStates, index-cache lookup in runOneGraph |
CompressedOnDiskBuild |
new GraphIndexBuilder(...), BuildScoreProvider.*, writer builder setup |
GraphBuilderFactory |
builderWithSuppliers switch cases |
InlineVectorsProvider, NVQProvider, FusedPQProvider |
FUSED_PQ / INLINE_VECTORS / NVQ_VECTORS checks |
FeatureProvider hooks |
Console table code in testConfiguration |
ConsoleReportListener |
artifacts.logRow(...) in testConfiguration |
ExperimentsLogListener |
BenchResult construction for AutoBench |
BenchResultCollector |
ConstructionMetrics, FinalWriteVectors (nested classes) |
Their own files, unchanged |
| AutoBench benchmark list | Grid.regressionBenchmarks() |
Deprecated, still working: Grid.runAllAndCollectResults(...), the positional RunArtifacts.logRow(...), and the positional ExperimentsSchemaV1.fixedValues(...). Use Grid.runAndCollectResults, and the overloads that take the build parameters as a map. Grid.runOneGraph(...) keeps its signature for the tests that call it.
Notes
- Used internally by JVector benchmarking, no client impact. No core library code changed.
TestBufferedGraphCompatibilitynow compares search scores within1e-6. Panama's float reductions round differently before and after C2 compiles them, which made the test fail intermittently on machines without the native vector library (all macOS machines). CI builds the native library, so it was not affected.- New tests:
TestGridSpec(sweep order against the old loop nest, empty and missing dimensions, YAML mapping) andTestReportedParameters(reported parameter names and order, experiments.csv columns).