Skip to content

[Backport 0.18] fix(hgraph): tune from available fp32 codes#2476

Merged
wxyucs merged 7 commits into
antgroup:0.18from
jac0626:codex/backport-2466-to-0.18
Jul 21, 2026
Merged

[Backport 0.18] fix(hgraph): tune from available fp32 codes#2476
wxyucs merged 7 commits into
antgroup:0.18from
jac0626:codex/backport-2466-to-0.18

Conversation

@jac0626

@jac0626 jac0626 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Backport #2466 to the 0.18 branch.

  • Let HGraph Tune select an available lossless source from raw vectors, precise FP32 codes,
    or base FP32 codes instead of relying only on store_raw_vector.
  • Require the selected codes to cover the current internal ID range.
  • Rebuild precise codes whose payload was omitted by ignore_reorder serialization.
  • Keep Tune state publication atomic and add source-selection and serialization regression
    coverage.

Fixes: #2465

Backport adaptation

  • Ported the implementation to the 0.18 single-file HGraph layout.
  • Omitted reorder_source handling because that API does not exist in 0.18.
  • Omitted the ForceRemove regression because RemoveMode::FORCE_REMOVE is not available in
    0.18.

Validation

/opt/homebrew/opt/llvm@15/bin/clang-format --dry-run --Werror \
  src/algorithm/hgraph.cpp tests/test_hgraph.cpp
git diff --check upstream/0.18..HEAD

The 0.18 test binary was not run locally: its legacy build configuration is incompatible with
the current macOS toolchain before reaching the changed code. CI is expected to provide the
target-platform validation.

Compatibility

  • API/ABI impact: none.

jac0626 added 2 commits July 20, 2026 14:44
Select raw, precise FP32, or base FP32 codes as the Tune rebuild source,
while allowing no-rebuild transitions without a source.

Signed-off-by: jac0626 <jac0626@users.noreply.github.com>
Assisted-by: Codex:gpt-5
Require Tune sources to cover the current internal ID range and rebuild precise codes whose serialized payload was omitted.

Signed-off-by: jac0626 <jac0626@users.noreply.github.com>
Assisted-by: Codex:gpt-5
@vsag-bot

vsag-bot commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

/label S-ready-to-merge
/waiting-on maintainer
/request-review @jiaweizone
/request-review @inabao

@vsag-bot
vsag-bot self-requested a review July 20, 2026 06:59
@vsag-bot

vsag-bot commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Automated pull request review completed.

Review effort: medium (186 changed lines across 2 files).

Submitted 1 inline comment.
Review: #2476 (review)

@jac0626 jac0626 added kind/bug Bug fixes, defects, or unexpected behavior 修复程序错误、缺陷或异常行为 version/0.18 1. Major pyramid upgrade 2. HGraph 3. Observability 1. pyramid大升级 2. HGraph增强 3. 可观测性增强 labels Jul 20, 2026
@mergify

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

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors the HGraph::Tune method to optimize how source vector data is selected and decoded during tuning, introducing helper lambdas and checking for active IDs. It also moves updates to create_param_ptr_ inside the global_mutex_ lock and adds comprehensive unit tests for various tuning scenarios. The reviewer identified two critical concurrency issues: a potential data race when reading immutable_ under add_mutex_ while it is modified under global_mutex_, and another data race when modifying create_param_ptr_ fields while concurrent readers like ExportModel and Fork access them without locking.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/algorithm/hgraph.cpp
Comment thread src/algorithm/hgraph.cpp
@jac0626
jac0626 marked this pull request as ready for review July 20, 2026 07:14
Signed-off-by: jac0626 <jac0626@users.noreply.github.com>
Assisted-by: Codex:gpt-5

@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: medium (185 changed lines across 2 files).
No actionable inline findings were found.

Reviewed commit 89f854f.

Signed-off-by: jac0626 <jac0626@users.noreply.github.com>
Assisted-by: Codex:gpt-5
@vsag-bot
vsag-bot self-requested a review July 20, 2026 09:33
Signed-off-by: jac0626 <jac0626@users.noreply.github.com>
Assisted-by: Codex:gpt-5

@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: medium (186 changed lines across 2 files).
No actionable inline findings were found.

Reviewed commit 504828c.

Signed-off-by: jac0626 <jac0626@users.noreply.github.com>
Assisted-by: Codex:gpt-5
@vsag-bot
vsag-bot self-requested a review July 20, 2026 11:10

@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: medium (186 changed lines across 2 files).
No actionable inline findings were found.

Reviewed commit f7ef7b9.

Signed-off-by: jac0626 <jac0626@users.noreply.github.com>
Assisted-by: Codex:gpt-5
@vsag-bot
vsag-bot self-requested a review July 20, 2026 11:18

@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: medium (186 changed lines across 2 files).
Submitted 1 inline comment.

Reviewed commit 130f284.

Comment thread src/algorithm/hgraph.cpp
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.95652% with 6 lines in your changes missing coverage. Please review.

@@            Coverage Diff             @@
##             0.18    #2476      +/-   ##
==========================================
+ Coverage   91.29%   91.33%   +0.03%     
==========================================
  Files         330      330              
  Lines       19657    19678      +21     
==========================================
+ Hits        17946    17972      +26     
+ Misses       1711     1706       -5     
Flag Coverage Δ
cpp 91.33% <86.95%> (+0.03%) ⬆️

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

Components Coverage Δ
common 85.94% <ø> (ø)
datacell 93.25% <ø> (+0.46%) ⬆️
index 91.51% <86.95%> (-0.04%) ⬇️
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 feb5e4a...130f284. 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.

@wxyucs wxyucs 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.

lgtm

@wxyucs
wxyucs merged commit 39afdfa into antgroup:0.18 Jul 21, 2026
38 of 40 checks passed
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/L 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.

4 participants