Repository navigation
test: pin read_env's completion-behavior claims for get_scheduler() (#2098) - #2338
Open
alwaysprince05 wants to merge 1 commit into
Open
alwaysprince05 wants to merge 1 commit into
alwaysprince05 wants to merge 1 commit into
Conversation
…VIDIA#2098) read_env may advertise inline completion only for the completion tags it can actually send. When it advertised more than that, a task co_awaiting get_scheduler() | let_value(schedule) was classified as completing inline, so the awaiter kept the composed operation state in its own stack frame while a nested schedule() operation was still queued. Assert that get_scheduler() claims inline completion for set_value_t alone, and that the composed expression is not treated as completing inline.
alwaysprince05
force-pushed
the
test/2098-read-env-completion-behavior
branch
from
October 15, 2026 16:13
9acb47c to
ed4cb1d
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A regression guard for the co_await path in #2098.
read_envmay advertise inline completion only for the completion tags it canactually send. It advertised more than that before
9a301946, so a task thatco_awaits
was classified as completing inline. The awaiter then kept the composed
operation state in its own stack frame while a nested
schedule()operation wasstill queued, which is the lifetime bug reported in #2098.
These assertions pin the current behaviour:
get_scheduler()claims inline completion forset_value_t—read_envcompletes in its
start();set_error_torset_stopped_t, which it never sends;__as_awaitable::__completes_inline.All three hold on current main and fail at
482c2605, so a regression of thecompletion-behaviour claim is caught at compile time rather than as a crash.
Type-level rather than a runtime test, so it needs no sanitizer to be
deterministic.
Since
__completes_inlinehas to consider every tag, the single-tag form is notsufficient here — the two
read_envclaims and the composition are checkedseparately so a failure says which one moved.
Built and run with Apple clang 21,
-std=c++20, in both configurations:test.stdexecpasses 630 test cases / 50088 assertions with and withoutSTDEXEC_ENABLE_EXTRA_TYPE_CHECKINGagainst the current base, no new warnings,clang-format clean.