Commit b0d5929
committed
fix(svs_flat): accept all-clear bitset as unfiltered search
Before: any non-empty BitsetView passed to SvsFlatIndexNode::Search()
caused an immediate `not_implemented` return, even when every bit was
zero (i.e. no vectors filtered out). Callers that pre-allocate a bitset
for shape consistency -- e.g. the vecTool nightly harness always passes
a bitset whose size matches the base set but leaves it all-clear for
plain kNN -- would see every SVS_FLAT search fail at the first query.
After: reject only when the bitset is both non-empty AND has at least
one bit set. All-clear bitsets fall through to the non-bitset search
path, which is the correct semantic for "no filtering requested".
`BitsetView::count()` (include/knowhere/bitsetview.h:50) returns the
number of filtered-out bits / ids, so the added `&& bitset.count() > 0`
is cheap and doesn't scan the bitmap.
Also register raw `SVS_VAMANA` in the SVS registration block so the
factory can construct it, matching the existing `Type()` implementation
and the LVQ / LeanVec registrations in the same file.
No regression on the actual-filter case: when the caller does have bits
set, we still surface the same not_implemented error with the same
message string, matching the current behavior.
Fixes one of the class of failures seen when running the vecTool
newNightly L2 SVS smoke benchmark (all 6 SVS_FLAT groups across
cohere_1m + qwen3vl_200k x {fp32, fp16, bf16} previously failed
identically at search stage; HNSW siblings on the same group IDs
passed). See zilliztech/vecTool#21 for the upstream discussion.
Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>1 parent 6f4de3b commit b0d5929
2 files changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
| 522 | + | |
| 523 | + | |
522 | 524 | | |
523 | 525 | | |
524 | 526 | | |
| |||
0 commit comments