Skip to content

test: pin task custom env query forwarding through let_value (#2239) - #2254

Merged
ericniebler merged 1 commit into
NVIDIA:mainfrom
alwaysprince05:test/issue-2239-task-env-let-value
Sep 13, 2026
Merged

test: pin task custom env query forwarding through let_value (#2239)#2254
ericniebler merged 1 commit into
NVIDIA:mainfrom
alwaysprince05:test/issue-2239-task-env-let-value

Conversation

@alwaysprince05

Copy link
Copy Markdown
Contributor

Adds regression tests for #2239.

What happened

Issue #2239 reported that a stdexec::task whose env_type is constructed from the enclosing environment failed to compile under starts_on + let_value, even when the consumer provides the queried value:

include/stdexec/__detail/__task.hpp:440:16: error: no matching constructor for
initialization of '__own_env_t<...>' (aka 'my_own_env')

The issue is already fixed on current main by the task reorganization in e88b131 (landed via #2252). I verified:

  • At 6842a4f (the parent of e88b131, i.e. the state the issue was filed against): the reproducer fails with exactly the reported error.
  • At e88b131 and on current main (ae89633): the reproducer compiles.
  • Runtime check: the task's custom env correctly observes the written query value (7) — not the -1 default — in every arrangement from the issue, including both previously failing ones.

This PR

The fix landed without a regression test for this arrangement, so this adds two test-only regression tests to test/stdexec/types/test_task.cpp:

  1. The reported failing arrangement: starts_on(sched, just() | let_value(task)) | write_env(prop{q, 7}) — the task's env must observe q == 7.
  2. A direct-child control: starts_on(sched, task) | write_env(...).

On pre-fix code the first test fails to compile, so CI guards this behavior at compile time. The tests use exec::single_thread_context (the existing pattern in this file) and are modules-safe (no on()).

No library changes are needed.

Fixes #2239

…A#2239)

Issue NVIDIA#2239 reported that a task whose env_type is constructed from the
enclosing environment failed to compile under starts_on + let_value when
the consumer provides the queried value. The bug was incidentally fixed
by the task reorganization in e88b131, but without a regression test.

Add two regression tests pinning the fixed behavior: the task's custom
env must observe queries written by write_env, both when a let_value
sits between starts_on and the task (the reported failing arrangement)
and when the task is a direct child of starts_on. On pre-fix code the
reported arrangement fails to compile, so these tests guard against
regressions at compile time.

Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 13, 2026

Copy link
Copy Markdown

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.

@alwaysprince05

Copy link
Copy Markdown
Contributor Author

Hi @ericniebler — could you run /ok to test 5ffbf41 when you get a chance? It's a test-only PR adding regression coverage for #2239 (details in the description). Thanks!

@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test 5ffbf41

@ericniebler
ericniebler merged commit 2173cc6 into NVIDIA:main Sep 13, 2026
38 checks passed
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.

Task env_type requiring a query fails to compile under starts_on + let_value, even when the consumer provides the query

2 participants