HNSW Index: Link and unlink neighbours - #48
Conversation
|
I've tested the entire PR stack end to end. It produces reasonable recall numbers. Furthermore I've done 2 different Claude reviews, one with context and one standalone without context. First verdict, approve as is. Second approve as is. Detailed comments from the latter: VillageSQL Self-Review — PR #48 "HNSW Index: Link and unlink neighbours" Base: deb/index/16 (stacked PR, single commit 8729a59, clean merge-base). Reviewed the PR diff, not the local worktree (worktree HEAD ba083e3 is an unrelated branch with later graph.cc changes that are not part of this PR — I extracted the PR's graph.cc from origin/deb/index/17 to review accurately). Deletion audit — clean All removals are the intended flip side of the change: the UnlinkOrphans enum and the two-mode unlink_neighbours(..., UnlinkOrphans, ...) signature are replaced by a single-pass unlink_neighbours + incoming_neighbours(), exactly as the PR describes. The removed using UnlinkOrphans in graph_ops_impl.h, the mock's enum, and the unlink_no:/unlink_yes: call-log strings all follow. The removed graph_ops_impl.h:NN-NN line-reference comments in the tests are a genuine improvement (see below). No upstream logic, bounds check, or invariant was silently dropped. Correctness — verified, no bugs found I traced the load-bearing invariants:
Findings (all minor)
Checklist items with no issues
Verdict: No blocking issues. The lock-hierarchy documentation, the bidirectional-link protocol comment, and the per-function contracts are unusually thorough and internally consistent. The two items above are optional polish, not fixes. |
Implement bidirectional neighbour linking and unlinking using incoming link flags, including overflow handling. Document the lock hierarchy and link protocol, and add the LevelStore operation mutex. Remove UnlinkOrphans; orphaned slots are now reported by incoming_neighbours(). Add scratch buffers for link walks and update MockGraph and tests.
638c3fa to
5305abe
Compare
Implement bidirectional neighbour linking and unlinking using incoming link flags, including overflow handling.
Document the lock hierarchy and link protocol, and add the LevelStore operation mutex. Remove UnlinkOrphans; orphaned slots are now reported by incoming_neighbours().
Add scratch buffers for link walks and update MockGraph and tests.