Repository navigation
fix(recall): stabilize equal-score search ranks - #293
Merged
dacorvo merged 3 commits intoNov 12, 2026
Merged
Conversation
Lance returns each search best first, so only the order within a run of equal scores is left to settle. Sorting those runs by row id needs no score direction, so the comparator each search passed goes away. The test picked its comparator by column name, apart from the one each search passed, so a flipped comparator in fts_candidates would still have passed it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nearest and full_text project their own score column, and search_scores reads it back from either one. recall named Lance's _distance and _score columns, which belong with the Lance mechanics, like _rowid behind row_ids. So hit_cols and the two searches in recall are back to what main has. The projection is still needed. Lance 13 adds the score column on its own today, but warns that it will stop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 of 9 tasks
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.
Summary
Reciprocal rank fusion uses each hit's position in the vector and BM25 results. Equal search scores can arrive in either order and change which hit ranks first.
Sort the returned vector hits by distance and the BM25 hits by descending score, using row ID to break ties in both lists before fusion. The regression swaps tied rows across batches and checks that the top fused hit stays the same. Lance still determines which rows make it into each search's candidate set.
Fixes #292.
Verification
HF_FUNES_TEST_TOKEN.-k 30and-k 8. The parent was also stable in this local sample, so the regression controls the input order directly.Developed with Codex assistance.