PS-11266: Basic HNSW class (phase 1 - basic modification and read operations support). - #6124
Open
dlenev wants to merge 3 commits into
Open
PS-11266: Basic HNSW class (phase 1 - basic modification and read operations support).#6124dlenev wants to merge 3 commits into
dlenev wants to merge 3 commits into
Conversation
catalinbp
requested changes
Aug 11, 2026
There was a problem hiding this comment.
Pull request overview
Adds an arena-backed, in-memory HNSW index with approximate nearest-neighbor search.
Changes:
- Implements insertion, k-NN, streaming search, and validation.
- Adds unit and recall tests.
- Registers the new test target.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
vector-common/hnsw.h |
Implements HNSW indexing and search. |
unittest/gunit/hnsw-t.cc |
Tests index and streaming behavior. |
unittest/gunit/CMakeLists.txt |
Registers HNSW tests. |
Suppressed comments (1)
vector-common/hnsw.h:553
- The allocator contract permits
nullptr, andMEM_ROOT::Alloc()does return it on OOM. WithNDEBUG, this assertion vanishes and placement-new at address zero is undefined behavior. Propagate allocation failure before constructing the node.
assert(raw_mem != nullptr);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
dlenev
force-pushed
the
ps-11266
branch
2 times, most recently
from
August 12, 2026 15:42
fb1df5c to
376ec06
Compare
catalinbp
reviewed
Aug 13, 2026
dlenev
force-pushed
the
ps-11266
branch
2 times, most recently
from
August 13, 2026 10:48
9b5b8c6 to
6b6082b
Compare
catalinbp
approved these changes
Aug 13, 2026
catalinbp
left a comment
Contributor
There was a problem hiding this comment.
lgtm with the exception of the m_visited which needs to be properly released in reset()
…rations support) [part 1]. https://perconadev.atlassian.net/browse/PS-11266 Added basic implementation of in-memory HNSW index. It supports insert and approximate k-NN search per the HNSW paper (https://arxiv.org/abs/1603.09320) and uses arena allocator for nodes. Added unit tests.
…rations support) [part 2]. https://perconadev.atlassian.net/browse/PS-11266 Added streaming NN-search support for in-memory HNSW index. Extended unit tests.
…rations support) [part 3]. https://perconadev.atlassian.net/browse/PS-11266 Added recall / memory / throughput benchmarks for our HNSW implementation on a synthetic data-set.
catalinbp
approved these changes
Aug 13, 2026
catalinbp
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://perconadev.atlassian.net/browse/PS-11266
Added basic implementation of in-memory HNSW index.
It supports insert and approximate k-NN search per the HNSW paper
(https://arxiv.org/abs/1603.09320) and uses arena allocator for nodes.
Streaming approximate NN search is also supported.
Added unit tests.