Skip to content

Conversation

@guptapratykshh
Copy link
Contributor

Fixes #6624

Proposed Changes

  • Removed the has_completion_signatures trait and the fallback logic supporting nested type aliases in get_completion_signatures.
  • Updated any_sender and unique_any_sender to expose completion signatures via tag_invoke exclusively.
  • Refactored unit tests (basic_sender, basic_schedule, coroutine_utils, etc.) to replace nested aliases with the standard tag_invoke pattern.

Any background context you want to provide?

This change aligns with the recent WG21 decision (P3164) to eliminate the option of a nested completion_signatures type alias in favor of relying solely on the get_completion_signatures customization point object.

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.

@StellarBot
Copy link

Can one of the admins verify this patch?

@guptapratykshh guptapratykshh force-pushed the remove_completion_signatures_alias branch from 7976eed to 968c14c Compare January 19, 2026 11:22
@krisha-9
Copy link

I went through the CI failures, especially clang_format. The PR modifies multiple files with tag_invoke(get_completion_signatures_t, …) blocks (e.g. any_sender.hpp and related tests), and running clang-format locally on the changed files produces formatting diffs. This seems to be the reason for the failing clang_format check. Formatting the modified files should make this check pass.

@hkaiser
Copy link
Member

hkaiser commented Jan 19, 2026

I went through the CI failures, especially clang_format. The PR modifies multiple files with tag_invoke(get_completion_signatures_t, …) blocks (e.g. any_sender.hpp and related tests), and running clang-format locally on the changed files produces formatting diffs. This seems to be the reason for the failing clang_format check. Formatting the modified files should make this check pass.

Yes, reformatting those files using clang-format v20 should fix both, the reported issues from clang-format and inspect.

@hkaiser
Copy link
Member

hkaiser commented Jan 19, 2026

There are however some build failures as reported by CirclCI, please have a look.

@hkaiser
Copy link
Member

hkaiser commented Jan 20, 2026

You can ignore the problems reported for the ci/circleci: tests.unit1.container_algorithms step. The compilation errors reported by ci/circleci: tests.unit3 seem to be caused by this PR, though.

@guptapratykshh guptapratykshh force-pushed the remove_completion_signatures_alias branch 4 times, most recently from ba53269 to 9fc5e83 Compare January 21, 2026 17:58
@codacy-production
Copy link

codacy-production bot commented Jan 21, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 18a5e6e1 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (18a5e6e) Report Missing Report Missing Report Missing
Head commit (4bbb754) 134738 51 0.04%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#6853) 9 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@hkaiser
Copy link
Member

hkaiser commented Jan 22, 2026

FWIW, the MacOS errors look like a missing #include statement.

@guptapratykshh guptapratykshh force-pushed the remove_completion_signatures_alias branch 14 times, most recently from bca150d to e4c1dc7 Compare January 24, 2026 06:52
@guptapratykshh guptapratykshh force-pushed the remove_completion_signatures_alias branch 13 times, most recently from 0a00463 to 53bda2a Compare February 2, 2026 07:59
{
private:
typedef hpx::spinlock mutex_type;
typedef std::mutex mutex_type;
Copy link
Member

Choose a reason for hiding this comment

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

Using std::mutex from HPX threads is generally not a good idea. This will stop the scheduler that runs on the thread aquiring the lock. This change 'fixes' the issue you are seeing only by coincidence as it changes the overall timing of the task executions.

{
static partition_allocator<double>* alloc =
new partition_allocator<double>();
return *alloc;
Copy link
Member

@hkaiser hkaiser Feb 3, 2026

Choose a reason for hiding this comment

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

Why did you decide to allocate the allocator on the heap (and where is it free'd)? Wouldn't a simple

static partition_allocator<double> alloc{};
return alloc;

suffice?

if constexpr (requires {
typename std::decay_t<
Sender>::completion_signatures;
})
Copy link
Member

@hkaiser hkaiser Feb 3, 2026

Choose a reason for hiding this comment

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

If detail::has_completion_signatures_v<Sender> causes issues (probably because it attempts to instantiate things that shouldn't be instantiated), wouldn't it be a better solution to fix it's implementation? For instance:

template <typename Sender>
inline constexpr bool has_completion_signatures_v = 
    requires { typename std::decay_t<Sender>::completion_signatures; };

?

if (vm.count("c-value"))
c = vm["c-value"].as<double>();
else
c = 1.0;
Copy link
Member

Choose a reason for hiding this comment

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

The default value is always 1.0, I don't think the else will be ever executed.

{
f.get();
}

Copy link
Member

Choose a reason for hiding this comment

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

This could be simplified by using void_guard (see https://github.com/STEllAR-GROUP/hpx/blob/master/libs/core/type_support/include/hpx/type_support/void_guard.hpp). However I don't see why the separate handling of void would be necessary in the first place. Did you see issues with this?

"Nt value")("c-value", value<double>()->default_value(1.0), "c value")(
"dt-value", value<double>()->default_value(1.0),
"dt value")("dx-value", value<double>()->default_value(1.0),
"dx value");
Copy link
Member

Choose a reason for hiding this comment

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

Could leave this unformatted, please?

std::conjunction<std::negation<hpx::traits::is_future<Sender>>,
is_sender<Sender>>,
std::conjunction<std::negation<hpx::traits::is_future<Senders>>,
is_sender<Senders>>...>)>
Copy link
Member

Choose a reason for hiding this comment

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

You may be able to write this as a 'real' requires() clause.

Env) noexcept -> generate_completion_signatures<Env>
{
return {};
}
Copy link
Member

Choose a reason for hiding this comment

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

The implementation shouldn't be necessary as the function will never be actually executed. It is ever only used for type computations (i.e. in unevaluated contexts).

action_move_semantics_component
)

hpx_set_lib_name(action_move_semantics_component action_move_semantics_test)
Copy link
Member

Choose a reason for hiding this comment

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

Why is this necessary?

@guptapratykshh guptapratykshh force-pushed the remove_completion_signatures_alias branch 3 times, most recently from 8923653 to b47f78c Compare February 4, 2026 14:51
@guptapratykshh guptapratykshh force-pushed the remove_completion_signatures_alias branch from b47f78c to 9306260 Compare February 4, 2026 14:53
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.

Remove type alias sender completions

4 participants