Repository navigation
fix(index): name the differing field when IVF_RQ segments cannot be merged - #11462
Merged
Merged
Conversation
…erged The distributed RQ merge rejected shards whose query_estimator or fast_rotation_signs differed but printed only code_dim, num_bits and rotation_type, so segments trained independently (each with its own random rotation) failed with identical values on both sides. The error now names the source shard and each differing field, and when the rotation differs it points to building every segment with one shared rotation model. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Xuanwo
approved these changes
Nov 25, 2026
Xuanwo
pushed a commit
that referenced
this pull request
Nov 30, 2026
…rges (#11467) ## What - `guide/vector_search.md`: new **Batch Queries** section with Python (2-D `q`), Rust (list-array query) and Java (`Query.Builder.setKeys`) examples. It covers the `query_index` column, how `limit`/`offset` apply, and the cases that search each query separately. The list follows `batch_index_search_supported` in `dataset/scanner/vector.rs`. - `quickstart/vector-search.md`: the batch paragraph said adaptive probes use per-query execution. Since #10443 they share partition scans, except on IVF_RQ. The paragraph now points to the guide for the remaining cases. - `guide/distributed_indexing.md`: mergeable IVF-RQ segments need one shared rotation model (`rabitq_model` from `build_rq_model`, or `RQBuildParams.Builder.setModel` in Java); the merge error has named this since #11462. The section also adds the measured query cost of unmerged segments, from the #11462 benchmark. ## Validation - Python example run against a local build: `query_index` is the first column (int32, no nulls), 10 rows per query, and `limit=5` returns 5 rows in total. - Rust example compiled and run as a temporary example: `query_index` is the first column, 20 rows for 2 queries. - The Java example uses the same calls as the batch tests in `VectorSearchTest`. - `./clean-full-website.sh && uv run mkdocs build --strict` passes, and the `#batch-queries` link resolves. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Problem
merge_existing_index_segmentsrejects IVF_RQ segments built without a shared rotation model, but its error does not say why. Each build draws a random rotation unless one is supplied, so segments trained independently differ only infast_rotation_signs. That field is checked but not printed, so the error shows identical values on both sides:query_estimatoris also checked without being printed. A matrix rotation that differs fails withRQ rotation matrix mismatch across shards, also without a pointer to the fix.Change
RQBuildParams::rotationin Rust,rabitq_modelin Python,RQBuildParams.Builder.setModelin Java.Why it matters
Merging is what makes a segment-per-fragment build as fast to query as one index, and this error is where users learn that the segments need a shared rotation.
Batched search (one call with all query vectors), k = 10, nprobes = 16, medians of 5 runs after a warmup. Two runs on an 18-core laptop with 1M × 128-d clustered synthetic vectors in 10 fragments, IVF_RQ 5-bit with 256 partitions. Every arm uses the same IVF centroids and the same
rabitq_model:Tests
test_merge_ivf_rq_names_mismatched_shard_metadatacovers fast rotation signs, a matrix rotation, andnum_bits. It asserts the field named in the message and whether the rotation hint is present. All three cases fail on the old messages. The test helper now stores a matrix rotation in a global buffer, as the index writer does.Validation:
cargo test -p lance-index --lib vector::distributed(21 pass), the Python RQ and distributed index tests (45 pass), fmt, andcargo clippy -p lance-index --tests --benches -- -D warnings -A unreachable_code -A dead_code. The two allows only silence aarch64-only warnings inlance-encodingandlance-io, which stop a full local clippy run on Apple Silicon; CI lints on x86.🤖 Generated with Claude Code