[POP-4099] seed extended searches - #2268
Conversation
There was a problem hiding this comment.
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 existingSortedNeighborhood. - Updated supermatcher handling in
classify_and_extend()to call the new seeded search instead of repeating a fullsearch().
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.
mcalancea
left a comment
There was a problem hiding this comment.
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
65fec27 to
3640ffa
Compare
No need to do a full second search for supermatchers. Starting with the
edgespassed toclassify_and_extend(), create aSortedNeighborhoodand use it to search layer 0 viasearch_layer().