fix(index): use writer-side IVF shuffle offsets instead of re-decoding - #8941
Open
XuQianJin-Stars wants to merge 6 commits into
Open
fix(index): use writer-side IVF shuffle offsets instead of re-decoding#8941XuQianJin-Stars wants to merge 6 commits into
XuQianJin-Stars wants to merge 6 commits into
Conversation
Avoid treating null partition IDs as partition 0, and keep flush-time prefix sums so create_index cannot fail when the offsets sidecar round-trip disagrees with in-memory partition counts.
Drop writer-side prefix sums once they would exceed the resident-memory cap and fall back to the sidecar on-demand path instead of always preloading.
Session construction was eagerly calling tempfile::tempdir(), which panics on Windows CI with PermissionDenied under parallel test load.
Vec::extend doubles allocation, so a length check can still grow past the 256 MiB resident-memory cap. Reserve exactly and drop the in-memory copy if allocated bytes would exceed the ceiling.
…ader Writer-side capacity drops were treated as a generic sidecar reopen, so reader construction could retry Vec::with_capacity from logical length and exceed the 256 MiB cap. Carry ForcedOnDemand explicitly and make sidecar preload fallible and capacity-checked.
A single k=10 query sat on the 0.5 bar and failed at 0.4 on Windows CI. Average recall over 10 queries, match the search metric to ground truth, and raise 4-bit refine so mean recall stays above the contract.
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The test-only follow-up preserves the accepted shuffle fix and strengthens the ANN regression coverage: indexed and exact searches use the same metric, recall is averaged across multiple fixed queries without lowering the 0.5 contract, and the affected cases remain lightweight.
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.
Summary
shuffle_offsets.lance, which could disagree with in-memory counts (127vs126) and failcreate_index.__ivf_part_idvalues instead of treating Arrow's dummy0as partition 0.Fixes
dataset::scanner::test::test_ann_with_deletionwithLanceFileVersion::Stableandstable_row_ids=true.Test plan
cargo test -p lance-index --lib vector::v3::shuffler::testscargo test -p lance --lib dataset::scanner::test::test_ann_with_deletionlancetests includingtest_ann_with_deletion::...::stable_row_ids_2_true