fix: handle FlatBin quantization in optimize_vector_indices_v2#6488
Merged
jackye1995 merged 3 commits intolance-format:mainfrom Apr 11, 2026
Merged
fix: handle FlatBin quantization in optimize_vector_indices_v2#6488jackye1995 merged 3 commits intolance-format:mainfrom
jackye1995 merged 3 commits intolance-format:mainfrom
Conversation
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.
Verifies that optimize_vector_indices_v2 handles the FlatBin quantization type without panicking when optimizing IVF_FLAT indices on binary (UInt8) vector columns.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
LuQQiu
approved these changes
Apr 11, 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.
Summary
(SubIndexType::Flat, QuantizationType::FlatBin)match arm inoptimize_vector_indices_v2The 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.