-
Couldn't load subscription status.
- Fork 140
CNDB-15703: Fix ScoreTracker impl init and reset methods #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Before you submit for review:
If you did not complete any of these, then please explain below. |
|
which unit tests cover this change ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good catch. Thanks for the contribution!
jvector-base/src/main/java/io/github/jbellis/jvector/graph/ScoreTracker.java
Outdated
Show resolved
Hide resolved
|
@eolivelli - I am adding tests this morning. I found the fix at the very end of my day yesterday and wanted to push something up, though as we can see, it wasn't a global fix since I used the wrong value for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Added a unit test in JV that revealed the bug |
|
Thanks for adding the test @marianotepper! |
This PR returns the behavior of the
ScoreTrackerto before #501. There are two issues:RelaxedMonotonicityTrackerhad a fixed sizebestScoresatnew BoundedLongHeap(100). The previous behavio used a size that varied based on thererankKfor the query. Further, when the reset method is called, we do not update the size, and as such, we end up with a mismatchedbestScoresheap, which can result in an incorrect understanding of theworstBestScorein theshouldStopmethod. In cases where thererankKis lower than 100, we will search deeper into the graph while in cases where it is above 100, we may return early.ScoreTrackerFactory#getScoreTrackerhas enough information to initialize more correct versions of the trackers, so I do that.