Skip to content

fix(hgraph): remove ef_search topk upper bound#2515

Open
wxyucs wants to merge 1 commit into
antgroup:mainfrom
wxyucs:codex/remove-hgraph-ef-search-limit
Open

fix(hgraph): remove ef_search topk upper bound#2515
wxyucs wants to merge 1 commit into
antgroup:mainfrom
wxyucs:codex/remove-hgraph-ef-search-limit

Conversation

@wxyucs

@wxyucs wxyucs commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Fixes: #2409

Rationale

HGraph currently rejects positive ef_search values above max(10 * topk, 1000), preventing larger candidate frontiers for large-limit and highly selective workloads. The search implementation already represents the frontier as int64_t/uint64_t, so the k-relative cap is unnecessary.

Behavior change

  • Accept any positive int64_t HGraph ef_search; remove only the k-relative upper bound.
  • Preserve rejection of zero/negative values and reject unsigned JSON values above INT64_MAX.
  • Make hops_limit comparison overflow-safe when ef_search exceeds uint32_t.
  • No changes to other indexes or search modes.

Test plan

  • Focused HGraph parameter tests: signed integer overflow rejection.
  • Focused HGraph functional regression: ef_search=1001 with topk=3 succeeds; zero and negative values are rejected.
  • Broader [hgraph] functional coverage: 7 cases passed; one long daily build/continue-add case was interrupted after 171.874s.
  • make release passed.
  • make lint passed with clang-tidy 15; direct clang-tidy 15 on changed implementations passed.
  • clang-format 15 and git diff --check passed.

Allow HGraph searches to use any positive int64 ef_search without a k-relative cap. Preserve signed integer range checks, lower-bound validation, and overflow-safe hops_limit handling.

Signed-off-by: Xiangyu Wang <wxy407827@antgroup.com>
Assisted-by: Codex:GPT-5
Copilot AI review requested due to automatic review settings July 23, 2026 03:46
@wxyucs
wxyucs requested a review from LHT129 as a code owner July 23, 2026 03:46
@wxyucs wxyucs added kind/bug Bug fixes, defects, or unexpected behavior 修复程序错误、缺陷或异常行为 version/1.0 labels Jul 23, 2026
@wxyucs
wxyucs requested review from inabao and jiaweizone as code owners July 23, 2026 03:46
@vsag-bot

vsag-bot commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

/label S-waiting-on-review
/waiting-on reviewer
/request-review @jiaweizone
/request-review @inabao
/request-review @LHT129

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vsag-bot
vsag-bot self-requested a review July 23, 2026 03:46
@vsag-bot

vsag-bot commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Automated pull request review completed.

Review effort: low (36 changed lines across 4 files).

No actionable inline findings were found.
Review: #2515 (review)

@mergify

mergify Bot commented Jul 23, 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+)

@vsag-bot vsag-bot left a comment

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.

Automated inline review completed.

Review effort: low (36 changed lines across 4 files).
No actionable inline findings were found.

Reviewed commit 66db30d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Bug fixes, defects, or unexpected behavior 修复程序错误、缺陷或异常行为 module/testing size/M version/1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat](hnsw/hgraph): support large limit query

3 participants