Skip to content

fix: IVF nearest-partition basic test returns an unexpected class ID - #2595

Open
vsag-bot wants to merge 1 commit into
antgroup:mainfrom
vsag-bot:codex/ai-fix-2594-71dd386f
Open

fix: IVF nearest-partition basic test returns an unexpected class ID#2595
vsag-bot wants to merge 1 commit into
antgroup:mainfrom
vsag-bot:codex/ai-fix-2594-71dd386f

Conversation

@vsag-bot

Copy link
Copy Markdown
Collaborator

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

  • Set the basic test reference search to ef_search=10.
  • Documented that the comparison validates IVF routing rather than HGraph search breadth.

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

  • The original intermittent mismatch did not reproduce in 50 local baseline runs; its mechanism is established from the differing search parameters and CI evidence.
  • The ASan daily-job profile was not rerun locally.
  • During initial dependency setup, CMake fetched a public ANTLR archive from GitHub before that build was stopped; no credentials or repository APIs were used.

Base branch: main

Fixes #2594

Prepared by vsag-bot after automatic effort ordering and AI repairability preflight.

Signed-off-by: vsag-bot <276218163+vsag-bot@users.noreply.github.com>
Assisted-by: Codex:gpt-5.6-sol
@vsag-bot vsag-bot added created-by-AI The issue is found and created by AI Agent kind/bug Bug fixes, defects, or unexpected behavior 修复程序错误、缺陷或异常行为 labels Jul 31, 2026
@vsag-bot

vsag-bot commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

/label status/waiting-for-review
/waiting-on reviewer
/request-review @jiaweizone
/request-review @wxyucs
/request-review @inabao

@vsag-bot

vsag-bot commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

AI PR state: status/waiting-for-review
Current owner: @wxyucs
Reason: 1 review thread(s) remain unresolved
Head: 70d528d

Automatic merging is disabled. A maintainer performs the final merge.

@mergify

mergify Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 3 merge protections satisfied — ready to merge.

Show 3 satisfied protections

🟢 Require kind label

  • label~=^kind/

🟢 Require version label

  • label~=^version/

🟢 Require linked issue for feature/bug PRs

  • body~=(?im)(?:^|[\s\-\*])(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s*:?\s+(?:#\d+|[\w.\-]+/[\w.\-]+#\d+|https?://github\.com/[\w.\-]+/[\w.\-]+/issues/\d+)

REQUIRE(class_result.size() == data_count);

auto index = partition->route_index_ptr_;
// Match ClassifyDatas so this checks its routing rather than HGraph search breadth.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

@vsag-bot vsag-bot added status/waiting-for-review Waiting for maintainer review and removed status/waiting-for-ci Waiting for CI; the AI agent handles failures labels Aug 1, 2026
@vsag-bot vsag-bot assigned wxyucs and unassigned vsag-bot Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by-AI The issue is found and created by AI Agent kind/bug Bug fixes, defects, or unexpected behavior 修复程序错误、缺陷或异常行为 size/XS status/waiting-for-review Waiting for maintainer review version/1.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug](ci): IVF nearest-partition basic test returns an unexpected class ID

3 participants