Skip to content

make_future: isolate __loop_ private-member access in single detail helper#7247

Open
guptapratykshh wants to merge 3 commits intoTheHPXProject:masterfrom
guptapratykshh:feat/make_future-remove-loop-hack
Open

make_future: isolate __loop_ private-member access in single detail helper#7247
guptapratykshh wants to merge 3 commits intoTheHPXProject:masterfrom
guptapratykshh:feat/make_future-remove-loop-hack

Conversation

@guptapratykshh
Copy link
Copy Markdown
Contributor

@guptapratykshh guptapratykshh commented May 4, 2026

post-cleanup follow-up to #7123

Proposed Changes

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.

…elper

Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
Copilot AI review requested due to automatic review settings May 4, 2026 10:02
@guptapratykshh guptapratykshh requested a review from hkaiser as a code owner May 4, 2026 10:02
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 4, 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.

@StellarBot
Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

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 refactors make_future’s run loop integration by isolating the internal stdexec::run_loop recovery logic (via the scheduler environment’s .__loop_ member) into a single helper, reducing the spread of reliance on that internal detail.

Changes:

  • Added a detail::get_run_loop_from_scheduler helper that centralizes access to the scheduler environment’s .__loop_ member.
  • Updated future_data_with_run_loop construction to use the new helper instead of inlining the .__loop_ access.

Comment on lines +44 to +50
template <typename Scheduler>
constexpr hpx::execution::experimental::run_loop&
get_run_loop_from_scheduler(Scheduler const& sched) noexcept
{
return static_cast<hpx::execution::experimental::run_loop&>(
*hpx::execution::experimental::get_env(schedule(sched))
.__loop_);
Comment on lines +42 to +43
// See https://github.com/STEllAR-GROUP/hpx for context on this
// post-cleanup follow-up of #7123.
Comment on lines +32 to +33
// Recover the parent `run_loop&` from a `run_loop::scheduler`.
//
Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
…O is not constexpr (fixes GCC strict mode CI failure)
Copilot AI review requested due to automatic review settings May 4, 2026 10:44
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 1 out of 1 changed files in this pull request and generated no new comments.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants