Skip to content

refactor(pyramid): modify default value of pyramid thread pool#1595

Merged
inabao merged 2 commits intomainfrom
thread-count-pyramid
Feb 27, 2026
Merged

refactor(pyramid): modify default value of pyramid thread pool#1595
inabao merged 2 commits intomainfrom
thread-count-pyramid

Conversation

@inabao
Copy link
Copy Markdown
Collaborator

@inabao inabao commented Feb 13, 2026

No description provided.

@inabao inabao self-assigned this Feb 13, 2026
@inabao inabao requested a review from wxyucs as a code owner February 13, 2026 07:01
@inabao inabao added kind/improvement Code improvements (variable/function renaming, refactoring, etc. ) version/1.0 needs-cherry-pick-release-0.18 labels Feb 13, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @inabao, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the pyramid algorithm's parameter handling by adjusting the default thread pool size and improving the initialization process for pyramid parameters. The primary impact is a change in the default concurrency for pyramid building and a more robust parameter loading mechanism, ensuring all necessary parameters are correctly parsed from JSON.

Highlights

  • Default Thread Pool Size Adjustment: The default value for the pyramid build thread pool (BUILD_THREAD_COUNT_KEY) in src/algorithm/pyramid.cpp has been reduced from 16 to 1. This change impacts the default concurrency level for pyramid construction.
  • Parameter Initialization Refinement: The PyramidParameters::FromJson method in src/algorithm/pyramid_zparameters.cpp now explicitly calls InnerIndexParameter::FromJson(json). This ensures that inner index parameters are correctly initialized when loading from a JSON configuration.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/algorithm/pyramid.cpp
    • Reduced the default BUILD_THREAD_COUNT_KEY from 16 to 1 within the HGRAPH_PARAMS_TEMPLATE.
  • src/algorithm/pyramid_zparameters.cpp
    • Added a call to InnerIndexParameter::FromJson(json) within the PyramidParameters::FromJson method to ensure proper initialization.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 introduces two beneficial changes to the Pyramid index. It adjusts the default build thread count from 16 to 1, which is a more sensible and safer default, consistent with other index types. More importantly, it rectifies a significant bug in PyramidParameters::FromJson by ensuring the base class's FromJson method is called. This fix is crucial for correctness, as it enables user-defined parameters from InnerIndexParameter (such as build_thread_count) to be properly configured via JSON. I've added one comment regarding an opportunity to further improve parameter propagation. Overall, these changes enhance the robustness and configurability of the Pyramid index.

}
},
"{BUILD_THREAD_COUNT_KEY}": 16,
"{BUILD_THREAD_COUNT_KEY}": 1,
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.

high

While changing this default to 1 is a good step for a safer default, this change highlights a more significant issue. The build_thread_count value is hardcoded here. This means that any user-configured build_thread_count (which is now correctly parsed thanks to the other change in this PR) will be ignored for the internal HGraph index used by Pyramid. The index will always be built with 1 thread, regardless of configuration.

To properly respect user settings, the build_thread_count from PyramidParameters should be propagated here. This likely involves changing this template to use a placeholder for the value (e.g., {BUILD_THREAD_COUNT_VALUE}) and updating Pyramid::CheckAndMappingExternalParam to substitute it with the configured value.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

@@            Coverage Diff             @@
##             main    #1595      +/-   ##
==========================================
+ Coverage   90.46%   91.05%   +0.58%     
==========================================
  Files         329      329              
  Lines       19469    19475       +6     
==========================================
+ Hits        17613    17732     +119     
+ Misses       1856     1743     -113     
Flag Coverage Δ
cpp 91.05% <93.33%> (+0.58%) ⬆️

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

Components Coverage Δ
common 85.81% <ø> (ø)
datacell 92.38% <ø> (+0.06%) ⬆️
index 90.58% <93.33%> (+0.78%) ⬆️
simd 100.00% <ø> (ø)

Continue to review full report in Codecov by Sentry.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
@inabao inabao force-pushed the thread-count-pyramid branch from 4337431 to 8faa1b4 Compare February 26, 2026 07:30
Copy link
Copy Markdown
Collaborator

@wxyucs wxyucs left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Collaborator

@LHT129 LHT129 left a comment

Choose a reason for hiding this comment

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

LGTM

@inabao inabao merged commit 95f6976 into main Feb 27, 2026
30 checks passed
@inabao inabao deleted the thread-count-pyramid branch February 27, 2026 06:48
wxyucs pushed a commit that referenced this pull request Mar 2, 2026
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants