Skip to content

[POP-4099] seed extended searches - #2268

Open
sdwoodbury wants to merge 3 commits into
mainfrom
sw/seed_supermatcher
Open

[POP-4099] seed extended searches#2268
sdwoodbury wants to merge 3 commits into
mainfrom
sw/seed_supermatcher

Conversation

@sdwoodbury

Copy link
Copy Markdown
Collaborator

No need to do a full second search for supermatchers. Starting with the edges passed to classify_and_extend(), create a SortedNeighborhood and use it to search layer 0 via search_layer().

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the “supermatcher” extended search path in the CPU HNSW implementation by reusing the layer-0 neighborhood from the initial search as a seed frontier, avoiding a full second HNSW descent through upper layers.

Changes:

  • Added HnswSearcher::search_layer_0_seeded() to run a layer-0-only search starting from an existing SortedNeighborhood.
  • Updated supermatcher handling in classify_and_extend() to call the new seeded search instead of repeating a full search().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
iris-mpc-cpu/src/hnsw/searcher.rs Adds a seeded layer-0 search helper and duration metric for the seeded path.
iris-mpc-cpu/src/execution/hawk_main/search.rs Seeds extended supermatcher searches from the initial edges neighborhood to avoid redoing upper layers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread iris-mpc-cpu/src/hnsw/searcher.rs
Comment thread iris-mpc-cpu/src/hnsw/searcher.rs Outdated
Comment thread iris-mpc-cpu/src/hnsw/searcher.rs
@sdwoodbury
sdwoodbury marked this pull request as ready for review July 8, 2026 18:58
@sdwoodbury
sdwoodbury requested review from bgillesp and mcalancea July 8, 2026 18:58

@mcalancea mcalancea left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether it's safer to include the layer 1 search results together with the seed, so as to allow the search to branch out at a higher level too (i.e not risk the seeds to localize it too much).

Did we manage to test the effects of this change on dev?

 Changes to be committed:
	modified:   iris-mpc-cpu/src/execution/hawk_main/search.rs
	modified:   iris-mpc-cpu/src/hnsw/searcher.rs
@sdwoodbury
sdwoodbury force-pushed the sw/seed_supermatcher branch 2 times, most recently from 65fec27 to 3640ffa Compare July 15, 2026 19:53
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.

3 participants