[C API] `svs_index_search_topk`: document the filtered-search contract for `filter_rate() <= 0`
メンテナーはふだん 5 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 65/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cpp
調査の方向性
Start with bindings/c/src/filtered_search.hpp and the filter_rate contract in svs_c.h; trace both early-exit sites described in the issue. Then inspect bindings/c/tests/ for the relevant search tests. Done means the tests cover both early exits and verify partial results, while the header documents the contract and the TODO is resolved.
索引モデルが issue の本文から書いたものです。
説明
Summary
Please document what svs_index_search_topk does with an ID filter whose filter_rate() is <= 0 (or NULL). valkey-search relies on this behaviour, and the header doesn't state it.
The contract text in svs_c.h (lines 1297-1303 at 8285340) only covers filter_rate > 0.0: "If the actual observed filter hit rate is less than the provided filter_rate value, the function returns an empty result set." It says nothing about 0.0.
Current behaviour for filter_rate() <= 0
Code references are to main at 8285340.
estimate_initial_batch_size(bindings/c/src/filtered_search.hpp:92-97) skips the ID sampling and returns the batch hint, so the pre-search early exit (:185-190) cannot trigger.hit_rate_sufficient(:65-69) returns true forfilter_rate <= 0, so the in-loop exit that resetsfound = 0(:218-222) cannot trigger either.- The search therefore runs until
kfilter-passing hits are found or the batch iterator is exhausted, and returns the hits found. That can be fewer thank, and is reported per query throughoffsets/total_results.
Ask
- Document the above in
svs_c.hnext to the existingfilter_rate > 0.0text, so it becomes part of the contract:- no sampling, and no early exit on the observed hit rate;
- the hits found are returned, possibly fewer than
k.
- Resolve the TODO at
filtered_search.hpp:216-217for the<= 0case. A short comment stating the guarantee is enough. - Add a test in
bindings/c/tests/asserting that, withfilter_rate()returning0.0and a selective filter, a query returns a non-zero number of hits, all of which pass the filter.
No behaviour change is requested. Whether the positive-hint path should return partial results, or drop the ID sampling, is SVS's call. If it does change, an opt-in parameter that keeps today's default would avoid surprising other integrations.
Consumer context
valkey-search (ALGORITHM SVS_VAMANA) passes an ID filter built from query predicates and returns 0.0 from filter_rate. Its query planner already knows how many keys qualify before it calls SVS:
- very selective filters (below roughly
0.001 * Nqualifying keys) go to an exact brute-force path and never reach SVS; - for the rest, valkey-search sizes the first batch itself through the per-query search window (
batch_hint = max(k, search_window_size)inbindings/c/src/index_vamana.cpp).
So valkey-search needs SVS to do no sampling or selectivity estimation, only to keep the <= 0 behaviour stable.
Scope change
This issue originally asked for partial results when the observed hit rate falls below a positive filter_rate. After the discussion below, valkey-search will handle selectivity on its own side, so the ask is narrowed to documenting the <= 0 contract. The ID sampler referenced in the original text has moved to bindings/c/src/index_vamana.cpp (around lines 78 and 140).
- 主要言語
- C++
- スター
- 241
- フォーク
- 48
- 平均マージ
- 4日 21時間
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
intel/ScalableVectorSearch のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
intel/ScalableVectorSearch#356 ·
メンテナーはふだん 5 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
intel/ScalableVectorSearch#469 ·
メンテナーはふだん 5 日以内に返信
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 32/100
intel/ScalableVectorSearch#460 ·
メンテナーはふだん 5 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
intel/ScalableVectorSearch#438 ·
メンテナーはふだん 5 日以内に返信
-
CI: tier the test matrix into PR / main / nightly to cut Actions minutes対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 32/100
intel/ScalableVectorSearch#432 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信
intel/ScalableVectorSearch の issue をすべて見る
似ている issue
-
runtime: lf_f128_mod is documented as fmodq (truncating) but implements floor-based modulo; unusedオープンinternal correctness low priority rt_lib
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 87/100
-
PriorityNotificationQueue::wakeUpAll() loses the wake-up for a thread that is not waiting yet対応中かも @matejk が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pocoproject/poco#5674 ·
メンテナーはふだん 2 日以内に返信
-
bug docs GUI
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
sonic-pi-net/sonic-pi#3609 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
SanderMertens/flecs#2395 ·
メンテナーはふだん 1 日以内に返信