Skip to content

fix(index): read each shuffle offset once for a single partition - #113

Merged
zehiko merged 1 commit into
release-10.0.0from
adam/shuffler-single-partition-offsets-r10
Nov 16, 2026
Merged

zehiko merged 1 commit into
release-10.0.0from
adam/shuffler-single-partition-offsets-r10

Conversation

@amunra

@amunra amunra commented Nov 16, 2026 •

Copy link
Copy Markdown

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_ranges takes 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.

Testing

  • New test_two_file_shuffler_single_partition_multiple_batches fails without the fix (debug assertion panic in lance-encoding).
  • cargo test -p lance-index --lib vector::: 323 passed.
  • cargo fmt --all and cargo 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

`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
@amunra amunra added bug Something isn't working A-index lance fork 10.0.0 Landed on the release-10.0.0 fork line permanent fork change No upstream path; Rerun-specific by construction labels Nov 16, 2026
@zehiko
zehiko merged commit 5ccb721 into release-10.0.0 Nov 16, 2026
40 of 42 checks passed
@amunra amunra added superseded upstream Upstream solved this another way, or the need went away; drop when rebasing past it and removed permanent fork change No upstream path; Rerun-specific by construction labels Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-index bug Something isn't working lance fork 10.0.0 Landed on the release-10.0.0 fork line superseded upstream Upstream solved this another way, or the need went away; drop when rebasing past it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants