Skip to content

test: add scheduler_concept regression guard for all stdexec schedulers - #2257

Merged
ericniebler merged 2 commits into
NVIDIA:mainfrom
alwaysprince05:test/scheduler-concept-guard
Sep 16, 2026
Merged

ericniebler merged 2 commits into
NVIDIA:mainfrom
alwaysprince05:test/scheduler-concept-guard

Conversation

@alwaysprince05

Copy link
Copy Markdown
Contributor

Follow-up to #2256.

While working on #2134 I noticed nothing actually stops this from coming back — a
new scheduler can forget the scheduler_concept alias and users end up with the
same confusing no viable overloaded '=' error inside exec::task again. So this
PR adds a small compile-time guard, test-only, that fails to build if any
scheduler in stdexec drops the alias.

What's here:

  • test/exec/test_scheduler_concept.cpp (new): statically checks that the
    always-built schedulers — inline, run_loop, task_scheduler, parallel,
    static_thread_pool, thread_pool_base-derived pools, timed_thread, trampoline,
    and reschedule's internal scheduler — define the alias and satisfy
    scheduler<>.
  • The gated ones (io_uring, windows_thread_pool, libdispatch, nvexec stream and
    multi-GPU stream) are asserted in their existing gated test files, so no extra
    CMake plumbing is needed on other platforms.

Verification: test.exec — 3417 assertions / 362 cases pass (Release, Apple Clang 21).

Happy to move or restructure this if there's a better home for the guard.

Per [exec.sched], scheduler types should define a nested scheduler_concept
alias derived from scheduler_tag. PR NVIDIA#2256 (issue NVIDIA#2134) added the missing
aliases; this adds compile-time guards so the requirement cannot regress.

- New test/exec/test_scheduler_concept.cpp statically asserts the alias and
  scheduler<> satisfaction for the always-available schedulers: inline,
  run_loop, task_scheduler, parallel, static_thread_pool, thread_pool_base
  (CRTP), timed_thread, trampoline, and the internal reschedule scheduler.
- Gated schedulers are asserted in their existing gated test files:
  io_uring, windows_thread_pool, libdispatch, and the nvexec stream and
  multi-GPU stream schedulers.

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

copy-pr-bot Bot commented Sep 15, 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 — small test-only follow-up to #2256: compile-time guards so the scheduler_concept alias from #2134 can't silently regress. Could you /ok to test when you get a chance? Thanks!

…ng-format

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@alwaysprince05

Copy link
Copy Markdown
Contributor Author

Pushed a one-line clang-format fix (0f216e4) — the style check should be green now, but the new workflow run is sitting in "awaiting maintainer approval". Could you approve it when you get a chance? Thanks!

@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test 0f216e4

@ericniebler
ericniebler merged commit fcd1f88 into NVIDIA:main Sep 16, 2026
38 of 39 checks passed
@alwaysprince05
alwaysprince05 deleted the test/scheduler-concept-guard branch September 16, 2026 06:49
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