Skip to content

Fix MESSI top-k returning duplicate series - #76

Merged
MChatzakis merged 1 commit into
mainfrom
fix/messi-topk-duplicate-results
Oct 10, 2026
Merged

MChatzakis merged 1 commit into
mainfrom
fix/messi-topk-duplicate-results

Conversation

@sophisid

Copy link
Copy Markdown
Collaborator

No description provided.

The approximate phase scans one leaf to seed the best-so-far queue, and the
parallel phase then scans every leaf again, including that one. The L2 and DTW
leaf scans inserted with pqueue_bsf_insert, which does not check whether a
position is already in the queue, so series from the seeded leaf entered the
k-NN list twice or more and displaced real neighbours.

Use pqueue_bsf_insert_no_dup_position (already used by Odyssey) at the four
insertion sites in Messi.cpp. On 200k clustered 128-d vectors with k=10, the
fraction of true top-10 ids returned rises from 0.81 to 0.9998 and no query
returns duplicates.

Add a regression test that fails without the change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@MChatzakis
MChatzakis merged commit f829435 into main Oct 10, 2026
7 of 8 checks passed
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.

2 participants