Skip to content

fix: forward + default-enable search_buffer_visited_set_ in concurrent MutableVamanaIndex - #390

Open
yuejiaointel wants to merge 2 commits into
intel:dev/eglaser-finegrain-dmitry-copyfrom
yuejiaointel:fix/concurrent-visited-set-not-forwarded
Open

yuejiaointel wants to merge 2 commits into
intel:dev/eglaser-finegrain-dmitry-copyfrom
yuejiaointel:fix/concurrent-visited-set-not-forwarded

Conversation

@yuejiaointel

Copy link
Copy Markdown
Contributor

What

Two changes, both against PR #369's new svs::index::vamana::concurrent::MutableVamanaIndex:

  1. Fix: include/svs/concurrent/dynamic_index.h's batch-search path constructed search_buffer_type with only 2 args (buffer_config_, comparator), silently dropping the 3rd arg (enable_visited) — so search_parameters.search_buffer_visited_set_ never took effect for batch search. Mirrors the already-merged fix for the non-concurrent index (commit 8052bd9, PR [C API] Implement memory estimation functions for index build and search #364).
  2. Default flip: include/svs/index/vamana/search_params.h's search_buffer_visited_set_ default changed from false to true. This struct (VamanaSearchParameters) is shared/unforked by PR separate seqlock fine grain into separate index #369 (concurrent::MutableVamanaIndex::search_parameters_type is a direct alias to it), so this one edit affects both the concurrent and non-concurrent index identically.

Why

The visited-set feature has been validated in a large regression campaign (2 datasets x 2 modes x 3 metrics x 4 variants = 48 configs, k=100, recall 0.90-0.95): a consistent 1.2x-1.4x QPS gain, zero recall cost, zero regressions. Flipping the default means callers get the benefit without needing to know the flag exists.

Note on duplication with #389

#389 ("Change search_buffer_visited_set_ default from false to true") already proposes the identical default-flip change against main, opened separately today. The diff text here is copied verbatim from #389 for consistency — if #389 merges to main before this PR's base branch does, rebasing this branch will make that commit a no-op (identical resulting text), not a conflict.

Verification

  • Confirmed via source read that the same missing-3rd-arg bug pattern exists in the concurrent copy (not assumed from the PR title's "98% identical" claim).
  • tests/svs/concurrent/dynamic_index.cpp, dynamic_index_2.cpp, tests/svs/index/vamana/dynamic_index.cpp, and search_parameters.cpp all recompile cleanly with g++-11 after both changes (confirmed via fresh object-file timestamps).
  • Full test-suite link/run not performed — flagging this scope limitation explicitly.

🤖 Generated with Claude Code

…dex batch search

The batch search() in svs::index::vamana::concurrent::MutableVamanaIndex
constructed search_buffer_type with only 2 args (buffer_config_,
comparator), dropping the 3rd constructor arg (enable_visited). As a
result sp.search_buffer_visited_set_ never took effect on this index's
batch search path, identical to a bug already fixed upstream in the
non-concurrent MutableVamanaIndex::search (intel/ScalableVectorSearch
commit 8052bd9, PR intel#364, merged 2026-09-11).

This file (include/svs/concurrent/dynamic_index.h) is a near-verbatim
copy carried into a new namespace by PR intel#369, branched 2026-08-20 --
before 8052bd9 landed -- so it did not inherit the fix. The single-query
search path (scratchspace()) in this same file already forwards the
flag correctly; only the batch path was missing it.

Verified: razdoburdin/ScalableVectorSearch's seqlock branch (the source
PR intel#369 ports from) also lacks 8052bd9 and has the identical unfixed
2-arg construction in its own dynamic_index.h, confirming this bug was
never independently fixed upstream and a rebase would not resolve it
(the fix in main touches a different file than this copy).

Verification done: tests/svs/concurrent/dynamic_index.cpp and
dynamic_index_2.cpp (the tests covering this class) both compile
cleanly with g++-11 after this change. Full test-suite link/run was
not performed (out of scope for this pass).
Mirrors the already-open (unmerged) intel/ScalableVectorSearch PR intel#389
(feature/visited-set-default-on) against main, same evidence: with the
forwarding bug fixed (previous commit here, and upstream commit
8052bd9 / PR intel#364 for the non-concurrent index), a 48-config regression
campaign (2 datasets x 2 modes x 3 metrics x 4 variants, k=100, recall
0.90-0.95) showed a consistent 1.2x-1.4x QPS gain with zero recall cost
and zero regressions. Flipping the default means callers -- including
this PR's new concurrent::MutableVamanaIndex -- get the benefit without
needing to know the flag exists.

Note: svs::index::vamana::concurrent::MutableVamanaIndex does not have
its own search-parameters type -- it reuses VamanaSearchParameters from
include/svs/index/vamana/search_params.h directly (see
svs::index::vamana::concurrent::MutableVamanaIndex::search_parameters_type
alias). That file is untouched/unforked by this PR (intel#369), and is
byte-identical here to current intel/ScalableVectorSearch main. So this
one edit is not concurrent-specific: it flips the default for the
existing (non-concurrent) index too, identically to what PR intel#389
already proposes on main. The two changes are currently on unrelated
branches/bases; if intel#389 merges to main before this PR does, rebasing
this branch onto main will make this commit a no-op (already applied
upstream) rather than a conflict, since the resulting text is
identical.

Verified: tests/svs/concurrent/dynamic_index.cpp,
tests/svs/concurrent/dynamic_index_2.cpp,
tests/svs/index/vamana/dynamic_index.cpp, and
tests/svs/index/vamana/search_parameters.cpp all recompile cleanly
with g++-11 after this change (confirmed via fresh object-file
timestamps, not stale artifacts). Full test-suite link/run not
performed.
@mergify

mergify Bot commented Sep 17, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants