Repository navigation
tests: make the PQ approximate-search tests ask for every row - #150
Merged
Merged
Conversation
TestFindNearestApproximate asserted the first name of find_nearest_approximate with k=1 and k=3 on a four-row index. The approximate path has no re-rank (it returns the PQ scores of what the walk collected), so the only run-to-run variable the test left open was how much of the four-node graph a small k collects. Both tests now ask for k = number of rows, so the answer is the PQ ranking of all four rows, and a smaller k only asserts count and order. Repetition (pytest-repeat --count 200, both tests, taskset -c 4,5, Python 3.14), before and after: JVM wheel 0 of 400 failed before, 0 of 400 after; native wheel 0 of 400 before, 0 of 400 after. The flake did not reproduce on this host, so the before numbers do not prove the cause. Ruled out: jvector's KMeansPlusPlusClusterer on the globally centered four rows gave four distinct centroids in 20000 of 20000 runs (unweighted, anisotropic 0.2 and 0.5), and 1200 fresh index builds returned the same ranking and scores. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #149
TestFindNearestApproximateasserted the first name offind_nearest_approximatewithk=1andk=3on a four-rowPRODUCTindex. The approximate path has no re-rank (rerank_oversampleapplies tofind_nearest, not here): it returns the PQ scores of whatever the walk collected. Both tests now ask fork = len(PQ_VECTORS), so the answer is the PQ ranking of all four rows, and a smallerkasserts only the count, the float distance and the order. The assertion on the first name is unchanged, not loosened, and the code path is shared by the JVM and native backends (vector.pyand_native/schema_objects.py), both checked below.Repetition with
pytest-repeat --count 200on both tests (400 test runs per cell),taskset -c 4,5 nice -n 19, Python 3.14:The flake did not reproduce on this host, so the before column does not prove the cause, and I am stating that rather than claiming a proven mechanism. What I ruled out: jvector's
KMeansPlusPlusClustereron the globally centered four rows gave four distinct centroids in 20000 of 20000 runs (unweighted, and anisotropic 0.2 and 0.5), and 1200 fresh index builds returned an identical ranking and scores. The remaining run-to-run variable is how much of the four-node graph a smallkcollects, which is what the change removes from the test. If the failure shows again after this, the issue should be reopened with the job log.🤖 Generated with Claude Code