Skip to content

fix: handle FlatBin quantization in optimize_vector_indices_v2#6488

Merged
jackye1995 merged 3 commits intolance-format:mainfrom
jackye1995:jack/fix-flatbin-optimize
Apr 11, 2026
Merged

fix: handle FlatBin quantization in optimize_vector_indices_v2#6488
jackye1995 merged 3 commits intolance-format:mainfrom
jackye1995:jack/fix-flatbin-optimize

Conversation

@jackye1995
Copy link
Copy Markdown
Contributor

Summary

  • Add missing (SubIndexType::Flat, QuantizationType::FlatBin) match arm in optimize_vector_indices_v2

The v2 function handles all other sub-index/quantization combinations but misses the FlatBin case for binary vector IVF_FLAT indices, hitting the catch-all unimplemented! panic during incremental indexing (optimize_indices). The v1 function already handles this correctly.

The `optimize_vector_indices_v2` function was missing the
`(SubIndexType::Flat, QuantizationType::FlatBin)` match arm, causing
a panic when running `optimize_indices` on IVF_FLAT indices built on
binary vector columns (UInt8 element type).

The v1 function `optimize_vector_indices` already handles this case
at line 491 by dispatching to `IvfIndexBuilder::<FlatIndex, FlatBinQuantizer>`.
The v2 function had equivalent arms for all other combinations but
missed this one, hitting the catch-all `unimplemented!` at line 670.
@github-actions github-actions Bot added the bug Something isn't working label Apr 11, 2026
Verifies that optimize_vector_indices_v2 handles the FlatBin
quantization type without panicking when optimizing IVF_FLAT indices
on binary (UInt8) vector columns.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 11, 2026

Codecov Report

❌ Patch coverage is 92.15686% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance/src/index/vector/ivf.rs 92.15% 1 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

@jackye1995 jackye1995 merged commit 7a65e88 into lance-format:main Apr 11, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants