Skip to content

exec(fork_join): don't use __rcvr_ref if it will create env issues#1824

Closed
romintomasetti wants to merge 1 commit intoNVIDIA:mainfrom
romintomasetti:continues-on-fork-join
Closed

exec(fork_join): don't use __rcvr_ref if it will create env issues#1824
romintomasetti wants to merge 1 commit intoNVIDIA:mainfrom
romintomasetti:continues-on-fork-join

Conversation

@romintomasetti
Copy link
Contributor

This PR is an attempt for fixing:

As I understand it, __rcvr_ref::get_env will be instantiated before the compiler sees the definition of _opstate_t::get_env. The relevant compiler error is:

In file included from /workspaces/stdexec/include/exec/fork_join.hpp:18:
/workspaces/stdexec/include/exec/../stdexec/__detail/__receiver_ref.hpp:55:9: error: static assertion failed: get_env() must return the same type as env_of_t<_Rcvr>
   55 |         __same_as<_Env, env_of_t<_Rcvr>>, "get_env() must return the same type as env_of_t<_Rcvr>");
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

...

/workspaces/stdexec/include/exec/../stdexec/__detail/__receiver_ref.hpp:55:9: note: because '__same_as<std::execution::__env::__fwd<std::execution::__sync_wait::__env>, env_of_t<exec::fork_join_impl_t::_opstate_t<std::execution::(anonymous namespace)::__sexpr<std::execution::(lambda at /workspaces/stdexec/include/exec/../stdexec/__detail/__basic_sender.hpp:56:53){}>, std::execution::__tup::__tuple<std::execution::__clsur::__closure<std::execution::__then::then_t, (lambda at /workspaces/stdexec/test/exec/test_fork.cpp:155:30)>, std::execution::__clsur::__closure<std::execution::__then::then_t, (lambda at /workspaces/stdexec/test/exec/test_fork.cpp:155:30)>>, std::execution::__sync_wait::__receiver<>>>>' evaluated to false
   55 |         __same_as<_Env, env_of_t<_Rcvr>>, "get_env() must return the same type as env_of_t<_Rcvr>");
      |         ^
/workspaces/stdexec/include/exec/../stdexec/__detail/__concepts.hpp:64:23: note: because '__is_same(std::execution::__env::__fwd<std::execution::__sync_wait::__env>, std::execution::__env::env<>)' evaluated to false
   64 |   concept __same_as = STDEXEC_IS_SAME(_Ap, _Bp);

meaning that somehow the env_of_t got evaluated to env<>...

Signed-off-by: romintomasetti <romin.tomasetti@gmail.com>
@copy-pr-bot
Copy link

copy-pr-bot bot commented Feb 10, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@romintomasetti
Copy link
Contributor Author

@ericniebler Could you please have a look ?

@romintomasetti romintomasetti changed the title exec(fork_join): don't use __rcvr_ref if it will create env issues exec(fork_join): don't use __rcvr_ref if it will create env issues Feb 10, 2026
@ericniebler
Copy link
Collaborator

this works, but i have made a separate pr (#1827) with a more targeted fix for the root issue: type deduction in continues_on.

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.

2 participants