Helper __awaitable concept doesn't correctly handle await_transform
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Start in include/coroutine.hpp around the __awaitable concept at the linked line, then compare its checks with the stated coroutine semantics and the std::generator promise_type example. Determine how the concept should account for a declared await_transform member and whether the required compiler intrinsic is available; done means the concept no longer reports invalid co_await expressions as awaitable.
Written by the indexing model from the issue text.
Description
The coroutine semantics are such that if there is any member of the promise type declared as await_transform then the co_await expression inside a coroutine with that promise type will first call promise.await_transform().
The current concept just checks that the particular type being queried is callable with promise.await_transform(<expr>) and if that is not well-formed then it falls back to just checking if <expr> has a valid operator co_await().
This could result in incorrectly reporting that a type satisfies __awaitable<Promise> when a co_await expression with an operand of that type would be ill-formed.
e.g. The current logic would indicate that std::suspend_always satisfies the __awaitable<std::generator<int>::promise_type> concept, despite co_await expressions being ill-formed inside std::generator coroutines.
Note that it's not currently possible to exactly match the behaviour of the compiler in library alone.
There would need to be some intrinsic for asking the compiler whether a given promise type has any member named 'await_transform' declared.
- Dominant language
- C++
- Stars
- 2.4k
- Forks
- 270
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 37
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/stdexec
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 66/100
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·