Fix: Avoid duplicate neighbor slots in HNSW reverse links#699
Fix: Avoid duplicate neighbor slots in HNSW reverse links#699ashvardanian merged 3 commits intounum-cloud:main-devfrom
Conversation
52bbcee to
d1f4061
Compare
|
I understand this problem may not be a critical issue, but I think it could be considered a bug. I would appreciate it if you could review whether it might be possible to address this in next release. If this PR is merged, it would benefit our product. Thank you for your consideration. :) |
|
Hi @yoonseok-kim! Shouldn't we instead use |
|
Good point. thanks! I’ll apply it. |
…k in index_gt::form_reverse_links_
| // then no need to modify any connections or run the heuristics. | ||
| if (close_header.size() < connectivity_max) { | ||
| close_header.push_back(new_slot); | ||
| if (std::find_if(close_header.begin(), close_header.end(), |
There was a problem hiding this comment.
close_header's iterator returns misaligned_ref_gt, not compressed_slot_t, so the internal *it == value comparison in std::find fails. I tried changing to std::find_if so that the predicate(lambda) receives a value. when the lambda is called with compressed_slot_t slot, the misaligned_ref_gt is converted to a value and slot == new_slot compiles.
|
I would appreciate it if you could review this. |
This PR fixes #698.