Skip to content

Reset visited set to buffer contents when a batch search resumes - #437

Open
yuejiaointel wants to merge 4 commits into
intel:mainfrom
yuejiaointel:fix/reset-visited-on-resume
Open

yuejiaointel wants to merge 4 commits into
intel:mainfrom
yuejiaointel:fix/reset-visited-on-resume

Conversation

@yuejiaointel

@yuejiaointel yuejiaointel commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem: With the visited set on, a batch iterator that resumes keeps every id it has already seen, including ids that were later dropped from the buffer. Those ids can never be added again, so filtered search at low pass rates loses recall.

Fix: On resume, reset the visited set to the ids still in the buffer (reset_visited_to_contents() in SearchBuffer and MutableBuffer, called in RestartInitializer). It does nothing when the visited set is off. The concurrent index gets the fix through its base classes.

Tests: No new tests. Existing *Dynamic*, *Concurrent*, *Iterator* tests pass (except the unrelated "Binary Reader Iterator" temp-folder failure).

🤖 Generated with Claude Code

When the visited-set filter is enabled and a batch iterator resumes with a
larger search window, nodes that were visited but later dropped from the
buffer stayed marked as visited and could never be re-inserted. With a
selective filter this collapsed recall.

Add reset_visited_to_contents() to the search buffers and call it in
RestartInitializer before sorting. Add a buffer unit test and a C API
dynamic filtered-search recall test.
…resume

# Conflicts:
#	include/svs/concurrent/dynamic_search_buffer.h
#	include/svs/concurrent/iterator.h
@yuejiaointel
yuejiaointel marked this pull request as ready for review October 28, 2026 23:00

This branch has not been deployed

No deployments
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.

1 participant