Repository navigation
Add configurable IVF centroid routing with persisted initializer types - #134
Merged
Merged
Conversation
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
IVF centroid routing was inferred solely from cluster count. Add explicit
auto,flat,flat_rabitq, andhnswselection in C++ and Python, and persist the resolved initializer in the v2 index header. Flat RaBitQ scans one-bit centroid codes before exact refinement of retained candidates and supports L2/IP. It remains an approximate router.autoselects Flat below 5,000 clusters, Flat RaBitQ below 60,000, and HNSW otherwise. Existing constructor call syntax remains valid, but new builds can produce different results. C++ consumers must rebuild against matching headers and the core library.Old indexes retain their historical routing, padding, and rotation state when loaded. Newly saved v2 files require the updated reader. HNSW sidecar writes now report open, write, and close failures; the dependency version and sidecar layout are unchanged.
Testing
RABITQ_ENABLE_NATIVE_OPTIMIZATION=OFF): 318 C++ tests passed, one placement-specific case skipped; its separate OpenMP-bound test passed.5a3ae78generated 12 real v1 indexes covering Flat/HNSW, L2/IP, 1/5/32 bits and padded dimension 96. Updated reader preserved query IDs/distances bit-for-bit. Resaving preserved payloads and six sidecars. Old reader rejected all new v2 files explicitly.