Repository navigation
Conversation
HNSWFactory::NewIndex(const HNSWParams *, bool is_normalized) dropped is_normalized when forwarding to the VecSimParams overload, so a quantized Cosine index declared as pre-normalized was rejected instead of resolving to IP. Forward the flag and cover both outcomes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Closing: the only caller that needs this forwarding is a test, and the SQ4 PR (#1099) now uses the VecSimParams overload, which already forwards is_normalized. No production path calls the HNSWParams overload with is_normalized=true. |
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
HNSWFactory::NewIndex(const HNSWParams *, bool is_normalized)droppedis_normalizedwhen itforwarded to the
VecSimParamsoverload. A quantized index with metric Cosine declared aspre-normalized was therefore rejected instead of resolving to IP. This forwards the flag.
The only in-tree caller of this overload that passes
trueis test code; the tiered factory usesthe
VecSimParamsoverload directly, so production behavior through the C API is unchanged.Testing
HNSWSQ8ParamsTest.HNSWParamsOverloadForwardsIsNormalized: SQ8 + Cosine through thisoverload returns an index with
is_normalized = trueand NULL withfalse. It failed before thefix (NULL returned).
test_hnsw_sq8210/210 on ARM (Neoverse-V2); full unit suite 3371/3371 on x86_64.The SQ4 PR stacked on this branch depends on the fix for its pre-normalized Cosine test.
🤖 Generated with Claude Code