fix: IVF nearest-partition basic test returns an unexpected class ID - #2595
fix: IVF nearest-partition basic test returns an unexpected class ID#2595vsag-bot wants to merge 1 commit into
Conversation
Signed-off-by: vsag-bot <276218163+vsag-bot@users.noreply.github.com> Assisted-by: Codex:gpt-5.6-sol
|
/label status/waiting-for-review |
|
AI PR state: Automatic merging is disabled. A maintainer performs the final merge. |
Merge Protections🟢 All 3 merge protections satisfied — ready to merge. Show 3 satisfied protections🟢 Require kind label
🟢 Require version label
🟢 Require linked issue for feature/bug PRs
|
| REQUIRE(class_result.size() == data_count); | ||
|
|
||
| auto index = partition->route_index_ptr_; | ||
| // Match ClassifyDatas so this checks its routing rather than HGraph search breadth. |
There was a problem hiding this comment.
[note] The fix correctly aligns the test's ef_search with ClassifyDatas' internal value (max(10, buckets_per_data*1.2) = 10 when buckets_per_data=1). Different HGraph search breadths can legitimately produce different nearest neighbors, so the previous ef_search=20 was testing HGraph search quality rather than IVF routing correctness.
The Serialize Test (line 99) still uses ef_search=20, which is fine — that test validates serialization round-trip behavior, not routing equivalence.
LGTM for this change.
Summary
Corrected the flaky IVF basic test by comparing routing results produced with identical HGraph search breadth.
Root Cause
ClassifyDatas used ef_search=10 while the test's direct approximate HGraph search used ef_search=20. Different search breadths can legitimately select different partition IDs, making the assertion intermittent.
Changes
Validation
cmake --build build --parallel 4: passed - Generic-SIMD build completed with DISABLE_SSE_FORCE=1../build/tests/unittests 'IVF Nearest Partition Basic Test' --reporter compact (50 repetitions): passed - All repetitions passed, exercising threaded and serial paths../build/tests/unittests '[IVFNearestPartition]' --reporter compact: passed - 3003 assertions passed across both IVF nearest-partition tests.clang-format-15 --dry-run --Werror src/algorithm/ivf/ivf_nearest_partition_test.cpp: passed - Validated with clang-format 15.0.7.git diff --check: passed - No whitespace errors.Residual Risks
Base branch:
mainFixes #2594
Prepared by
vsag-botafter automatic effort ordering and AI repairability preflight.