Skip to content

fix: HGraph dirty-vector search returns fewer results than top-k - #2734

Open
vsag-bot wants to merge 2 commits into
antgroup:0.18from
vsag-bot:codex/ai-fix-2732-c9691dda
Open

fix: HGraph dirty-vector search returns fewer results than top-k#2734
vsag-bot wants to merge 2 commits into
antgroup:0.18from
vsag-bot:codex/ai-fix-2732-c9691dda

Conversation

@vsag-bot

Copy link
Copy Markdown
Collaborator

Summary

HGraph search now traverses NaN/Inf bridge nodes deterministically while excluding NaN distances from results, preventing incomplete top-k responses.

Root Cause

Non-finite distances were inserted directly into candidate heaps using negation. NaN violates heap ordering and candidate admission comparisons, causing traversal to stop before enough finite neighbors were collected.

Changes

  • Added shared result-eligibility and traversal-priority helpers for non-finite distances.
  • Updated basic, iterative, and parallel graph search paths to traverse non-finite bridge nodes without returning NaN results.
  • Added focused BasicSearcher and ParallelSearcher regressions covering NaN and overflow-to-Inf bridges.

Validation

  • cmake --build build-ai-fix --target unittests functests --parallel 4: passed - Debug unit and functional test binaries built successfully.
  • build-ai-fix/tests/unittests '*Searcher traverses through a non-finite-distance bridge' --reporter compact: passed - 12 assertions passed across both focused regressions; the BasicSearcher regression failed before the fix.
  • build-ai-fix/tests/unittests '[ut][BasicSearcher]' --reporter compact && build-ai-fix/tests/unittests '[ut][ParallelSearcher]' --reporter compact: passed - 243422 assertions passed across the relevant searcher suites.
  • for run in 1 2 3 4 5; do build-ai-fix/tests/functests '(PR) HGraph Search with Dirty Vector' --reporter compact --rng-seed "$run"; done: passed - All five runs passed with 283 assertions each.
  • git diff --check: passed - No whitespace errors found.

Residual Risks

  • The sanitizer workflow was not reproduced locally; validation used a debug build because CMake 3.22 could not directly consume the provided local archive fallback lists.

Base branch: 0.18

Fixes #2732

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:codex-default
@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 Aug 20, 2026
@vsag-bot vsag-bot added the version/0.18 1. Major pyramid upgrade 2. HGraph 3. Observability 1. pyramid大升级 2. HGraph增强 3. 可观测性增强 label Aug 20, 2026
@vsag-bot

Copy link
Copy Markdown
Collaborator Author

/label status/waiting-for-review
/waiting-on reviewer
/request-review @inabao
/request-review @ShawnShawnYou
/request-review @LHT129

@vsag-bot vsag-bot added the status/waiting-for-ci Waiting for CI; the AI agent handles failures label Aug 20, 2026
@vsag-bot vsag-bot self-assigned this Aug 20, 2026
@vsag-bot

vsag-bot commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator Author

AI PR state: status/ai-working
Current owner: @vsag-bot
Reason: checks concluded failure
Head: fd7e661

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

@mergify

mergify Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 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+)

@vsag-bot vsag-bot added status/ai-working The AI agent owns the next action and removed status/waiting-for-ci Waiting for CI; the AI agent handles failures labels Aug 20, 2026
@vsag-bot

vsag-bot commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator Author

AI PR CI recovery

Item Value
Status branch-updated
Head c51b1be
Workflow Asan Build & Test Parallel
Classification change_related
Confidence 99%
Action Pushed corrective commit fd7e661; CI will run for the new head

Fixed the ParallelSearcher worker lifetime race reported by ASan.

Reasoning:
Both architectures failed in the newly added ParallelSearcher regression. Worker tasks captured stack-owned queues, but Search returned without waiting for workers to consume shutdown markers. Retaining and waiting on their futures ensures all workers exit before local state is destroyed.

@vsag-bot vsag-bot added status/waiting-for-ci Waiting for CI; the AI agent handles failures status/ai-working The AI agent owns the next action and removed status/ai-working The AI agent owns the next action status/waiting-for-ci Waiting for CI; the AI agent handles failures labels Aug 20, 2026
Signed-off-by: vsag-bot <276218163+vsag-bot@users.noreply.github.com>
Assisted-by: Codex:gpt-5.6-sol
@vsag-bot vsag-bot added status/waiting-for-ci Waiting for CI; the AI agent handles failures status/ai-working The AI agent owns the next action and removed status/ai-working The AI agent owns the next action status/waiting-for-ci Waiting for CI; the AI agent handles failures labels Aug 20, 2026
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.69767% with 4 lines in your changes missing coverage. Please review.

@@            Coverage Diff             @@
##             0.18    #2734      +/-   ##
==========================================
- Coverage   91.39%   91.30%   -0.10%     
==========================================
  Files         331      332       +1     
  Lines       19714    19733      +19     
==========================================
- Hits        18018    18017       -1     
- Misses       1696     1716      +20     
Flag Coverage Δ
cpp 91.30% <90.69%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
common 86.00% <ø> (ø)
datacell 91.66% <ø> (-1.30%) ⬇️
index 91.72% <ø> (+0.01%) ⬆️
simd 100.00% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89188a9...fd7e661. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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/L status/ai-working The AI agent owns the next action version/0.18 1. Major pyramid upgrade 2. HGraph 3. Observability 1. pyramid大升级 2. HGraph增强 3. 可观测性增强

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant