Repository navigation
fix(index): read each shuffle offset once for a single partition - #113
Merged
zehiko merged 1 commit intoNov 16, 2026
Merged
Conversation
`TwoFileShuffleReader::partition_ranges` takes up to two rows of the offsets file per write batch: the offset that ends the previous partition and the offset that ends this one. With a single partition and more than one write batch those rows coincide between consecutive batches, so the take asked for `[0, 0, 1, 1, ...]`. The file reader requires strictly increasing take indices. It checks that with a `debug_assert!` today, so debug builds panic, and lance-format#7465 turns the check into an `InvalidInput` error in every build. Request each offset row once and resolve each batch's range by position in the result. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01Y5gh2Y1wnv7hxuU8CUFARy
zehiko
approved these changes
Nov 16, 2026
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.
Related
What
Building an IVF (inverted file) vector index with exactly one partition fails once the build writes more than one shuffle batch.
TwoFileShuffleReader::partition_rangestakes up to two rows of the shuffle offsets file per write batch. With one partition, consecutive batches share a row, so the take asks for[0, 0, 1, 1, ...]. The file reader requires strictly increasing take indices.The reader now requests each offset row once and resolves each batch's range by position in the result. Builds with more than one partition send the same request as before.
At the next rebase onto upstream: this patch does not apply; lance-format#8894 rewrote the function.
LANCE_SHUFFLE_MAX_PRELOADED_OFFSETS_BYTES.Testing
test_two_file_shuffler_single_partition_multiple_batchesfails without the fix (debug assertion panic inlance-encoding).cargo test -p lance-index --lib vector::: 323 passed.cargo fmt --allandcargo clippy --all --tests --benches -- -D warnings: clean.Compatibility
On-disk format unchanged.
This PR was written by an LLM (Claude Code) and reviewed by a human before merging.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Y5gh2Y1wnv7hxuU8CUFARy