Skip to content

Move the task size facilities to thread_support - #8029

Open
Nithurshen wants to merge 1 commit into
TheHPXProject:masterfrom
Nithurshen:thread-support-task-size
Open

Nithurshen wants to merge 1 commit into
TheHPXProject:masterfrom
Nithurshen:thread-support-task-size

Conversation

@Nithurshen

Copy link
Copy Markdown

Part of #8020

This is the first step of the updated plan in #8020, as suggested in #8020 (comment).

Proposed Changes

  • Move hpx/functional/traits/get_task_size.hpp unchanged to hpx/thread_support/task_size.hpp: task_size, task_size_duration, bulk_task_size, get_task_size, get_task_size_for and the builtin operation traits.
  • The function wrappers in functional (bind, bind_front, bind_back, deferred_call, one_shot, hpx::function, hpx::move_only_function) include hpx/modules/thread_support.hpp instead, and functional depends on thread_support directly.
  • Add the move to the V2.1.0 breaking changes. The names are unchanged; only code that included the old header directly has to include hpx/modules/thread_support.hpp instead.

Any background context you want to provide?

thread_support depends on neither functional nor coroutines, so the stack size facilities can be built there next, and thread_enums.hpp can move there later. No behavior change.

Tested with sized_function, task_size_annotations, task_size_hint, task_sizes_reduce_merge, task_size_chunk_size_configuration, executor_parameters, function_test, bind_test, launch_policy, fork_join_executor and action_task_size:

  • stellargroup/build_env:17 with clang-20, warnings as errors and thread debug info, as in the inspect job, including the header tests of functional and thread_support; clang-tidy-20 and the inspect tool report nothing
  • stellargroup/build_env:22 with clang-22, C++23 and HPX_WITH_CXX_MODULES=ON, as in the modules job
  • macOS with Apple clang 21

@Nithurshen
Nithurshen requested a review from hkaiser as a code owner November 9, 2026 15:38
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Documentation
    • Task-size facilities are now associated with the thread-support module, with their names unchanged.
    • If you include the task-size header directly, switch to the thread-support module header. The functional umbrella headers continue to provide these facilities.
  • Refactor
    • Functional utilities continue to support task-size behavior through the updated module organization; no public declarations changed.

The task-size facilities move from the functional module to thread_support without name changes. Functional headers include the thread-support module header. Release notes document the relocation and continued availability through functional umbrella headers.

Changes: Task-size facilities relocation

Layer / File(s) Summary
Register and consume task-size facilities
libs/core/thread_support/CMakeLists.txt, libs/core/functional/CMakeLists.txt, libs/core/functional/include/hpx/functional/*, libs/core/functional/include/hpx/functional/detail/*, libs/core/functional/include/hpx/functional/detail/vtable/*, docs/sphinx/releases/whats_new_2_1_0.rst
The thread-support module registers task_size.hpp. The functional module adds a thread-support dependency, and its task-size consumers switch to hpx/modules/thread_support.hpp. The release notes describe the relocation and include guidance.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Possibly related issues

Possibly related PRs

  • TheHPXProject/hpx#8028: Both PRs address module placement for related size traits.
  • TheHPXProject/hpx#7848: This PR relocates task-size facilities introduced by PR #7848 and updates functional wrappers to include them through thread_support.
  • TheHPXProject/hpx#7926: Both PRs change or use the task-size API in functional wrappers.

Suggested labels: category: API, category: CMake, type: compatibility issue

Suggested reviewers: v4xsh

Merge Risk: Minimal · up to 403c3

Direct consumers must update their include as documented. No merge-blocking issue is established.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly summarizes the main change: moving task-size facilities to thread_support.
Description check Passed The description explains the task-size move, related include and dependency changes, and the intended compatibility impact.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 9 files. (3 skipped: 3 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d8ec5a93-11a0-4b11-85f6-0d4737e186de
Commits

Reviewing files that changed from the base of the PR and between 5c77dbf and 403c315.

Files selected for processing: 13

  • docs/sphinx/releases/whats_new_2_1_0.rst
  • libs/core/functional/CMakeLists.txt
  • libs/core/functional/include/hpx/functional/bind.hpp
  • libs/core/functional/include/hpx/functional/bind_back.hpp
  • libs/core/functional/include/hpx/functional/bind_front.hpp
  • libs/core/functional/include/hpx/functional/deferred_call.hpp
  • libs/core/functional/include/hpx/functional/detail/basic_function.hpp
  • libs/core/functional/include/hpx/functional/detail/vtable/callable_vtable.hpp
  • libs/core/functional/include/hpx/functional/function.hpp
  • libs/core/functional/include/hpx/functional/move_only_function.hpp
  • libs/core/functional/include/hpx/functional/one_shot.hpp
  • libs/core/thread_support/CMakeLists.txt
  • libs/core/thread_support/include/hpx/thread_support/task_size.hpp
Files with no reviewable changes: 1

  • libs/core/thread_support/include/hpx/thread_support/task_size.hpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

hkaiser
hkaiser previously approved these changes Nov 10, 2026

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

Thanks, this is what I had in mind. The header moves unchanged, thread_support depends on neither functional nor coroutines, so the new dependency of functional on thread_support doesn't create a cycle, and the breaking change is documented in the release notes.

The failure in the C++20 Modules build is a clang crash (exit 139) that shows up on other PRs as well, it is unrelated.

@hkaiser

hkaiser commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

@Nithurshen Please rebase this onto master to resolve the conflicts.

Move hpx/functional/traits/get_task_size.hpp unchanged to
hpx/thread_support/task_size.hpp: task_size, task_size_duration,
bulk_task_size, get_task_size, get_task_size_for and the builtin
operation traits. The function wrappers in functional now include
hpx/modules/thread_support.hpp, and functional depends on
thread_support directly. thread_support depends on neither functional
nor coroutines, so the stack size facilities can be added there as
well.

The names are unchanged; code that included the old header directly
has to include hpx/modules/thread_support.hpp instead. Document this in
the V2.1.0 breaking changes.

Part of TheHPXProject#8020

Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>

This branch has not been deployed

No deployments
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.

2 participants