Skip to content

run_loop: advertise sync_wait_domain via get_completion_domain on env_t#7276

Merged
hkaiser merged 2 commits into
TheHPXProject:masterfrom
guptapratykshh:feat/run-loop-sync-wait-domain-integration
May 19, 2026
Merged

run_loop: advertise sync_wait_domain via get_completion_domain on env_t#7276
hkaiser merged 2 commits into
TheHPXProject:masterfrom
guptapratykshh:feat/run-loop-sync-wait-domain-integration

Conversation

@guptapratykshh
Copy link
Copy Markdown
Contributor

@guptapratykshh guptapratykshh commented May 18, 2026

Proposed Changes

  • Complete the previously-commented query(get_completion_domain_t<CPO>) overload on run_loop::env_t so that stdexec::sync_wait on a sender whose set_value completion scheduler is run_loop_scheduler resolves the completion domain to HPX's detail::sync_wait_domain (cooperative HPX-synchronization wait) instead of falling through to default_domain (OS-blocking wait).
  • Declare the query as a templated member with trailing return type -> detail::sync_wait_domain inside env_t, and define the body in detail/sync_wait_domain.hpp after sync_wait_domain is complete -- same deferred-definition pattern already used by sync_wait_rcv_env::query in the same file. Avoids the circular include between run_loop.hpp and sync_wait_domain.hpp.
  • run_loop_scheduler inherits the query via the existing using env_t::query;, so the resolution path sender env -> get_completion_scheduler<set_value_t> -> scheduler -> get_completion_domain<set_value_t> reaches sync_wait_domain without a separate scheduler-level overload.

Any background context you want to provide?

Checklist

Not all points below apply to all pull requests.

  • I have added a new feature and have added tests to go along with it.
  • I have fixed a bug and have added a regression test.
  • I have added a test using random numbers; I have made sure it uses a seed, and that random numbers generated are valid inputs for the tests.

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 18, 2026

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.

@guptapratykshh guptapratykshh force-pushed the feat/run-loop-sync-wait-domain-integration branch from 5de7399 to acc4e28 Compare May 18, 2026 18:29
@StellarBot
Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@guptapratykshh guptapratykshh marked this pull request as ready for review May 18, 2026 18:31
@guptapratykshh guptapratykshh requested a review from hkaiser as a code owner May 18, 2026 18:31
Copilot AI review requested due to automatic review settings May 18, 2026 18:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR completes run_loop::env_t’s completion-domain query so that stdexec::sync_wait on senders completing on run_loop_scheduler resolves to HPX’s cooperative detail::sync_wait_domain instead of default_domain’s OS-blocking wait.

Changes:

  • Add run_loop::env_t::query(get_completion_domain_t<CPO>) -> detail::sync_wait_domain declaration (templated to defer instantiation).
  • Provide the out-of-class definition of that query in detail/sync_wait_domain.hpp after sync_wait_domain is fully defined.
  • Remove the previously commented-out get_completion_domain overload stubs and replace them with a note pointing to the deferred definition.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
libs/core/execution/include/hpx/execution/algorithms/run_loop.hpp Declares a templated get_completion_domain query on run_loop::env_t to advertise HPX’s sync_wait_domain.
libs/core/execution/include/hpx/execution/algorithms/detail/sync_wait_domain.hpp Defines the deferred run_loop::env_t::query(get_completion_domain_t<CPO>) after sync_wait_domain is complete.

Comment thread libs/core/execution/include/hpx/execution/algorithms/run_loop.hpp Outdated
Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
@guptapratykshh guptapratykshh force-pushed the feat/run-loop-sync-wait-domain-integration branch from acc4e28 to a9fd843 Compare May 18, 2026 18:40
Copilot AI review requested due to automatic review settings May 19, 2026 03:27
@guptapratykshh guptapratykshh force-pushed the feat/run-loop-sync-wait-domain-integration branch from 6eb0f3c to 9004b8d Compare May 19, 2026 03:29
Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
@guptapratykshh guptapratykshh force-pushed the feat/run-loop-sync-wait-domain-integration branch from 9004b8d to c45f038 Compare May 19, 2026 03:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

@hkaiser hkaiser left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@hkaiser hkaiser added this to the 2.0.0 milestone May 19, 2026
@hkaiser hkaiser merged commit 3a14ccf into TheHPXProject:master May 19, 2026
69 checks passed
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.

4 participants