Skip to content

give every algorithm's sender a pretty type name - #2602

Merged
ericniebler merged 1 commit into
NVIDIA:mainfrom
ericniebler:pretty-sender-names
Dec 5, 2026
Merged

ericniebler merged 1 commit into
NVIDIA:mainfrom
ericniebler:pretty-sender-names

Conversation

@ericniebler

Copy link
Copy Markdown
Collaborator

Summary

  • Every algorithm in stdexec, exec, and nvexec now returns a sender of its own named type, derived from __facade::__sender and defined at namespace scope with a deduction guide, instead of __facade::__sender<Tag, Data, Child...> directly. Error messages and debugger output now show __then_sender<F, S>, exec::repeat_n_sender<S>, and so on.
  • The nested just_t::__sender, then_t::__sender, upon_error_t::__sender, etc. are renamed to __just_sender, __then_sender, ... Only names in STDEXEC are uglified; exec and nvexec names have no leading underscores. __on::__sndr becomes __on_sender, and on(sndr, sch, clsur) gets __on_closure_sender.
  • A template specialization on __facade::__sender<...> does not match a derived type, so the places that took senders apart that way now go through __facade::__facade_sender_t: ensure_started's "already started" check, nvexec's _is_stream_facade_sender_v, and the facade's __retag lookup (which would otherwise have silently stopped recognizing re-tagging domains' results).
  • MAINTAINERS.md documents the convention.

Testing

  • All stdexec and exec tests pass with clang and GCC 16. Not run: the _fail compile-failure tests, the asio tests, and the three that need libdispatch, taskflow, or windows.h.
  • nvexec: all 136 test cases pass with nvcc 13.5.
  • Compile time, peak memory, and object size (-g -O0, 15 representative tests, clang and GCC 16, best of 3) are within ~1.5% of main.

🤖 Generated with Claude Code

Some algorithms (`just`, `then`, `upon_*`) returned senders with a
nested "pretty" type, like `then_t::__sender<F, S>`, while the rest
returned `__facade::__sender<Tag, Data, Child...>` directly, so error
messages and debugger output named the tag, the data, and the children
in full.

Give every algorithm in stdexec, exec, and nvexec a sender type of its
own, derived from `__facade::__sender` and defined at namespace scope
with a deduction guide: `stdexec::__then_sender<F, S>`,
`exec::repeat_n_sender<S>`, `nvexec::_strm::then_sender<F, S>`, and so
on. The nested `just_t::__sender`, `then_t::__sender`, etc. are renamed
the same way. Only the names in `STDEXEC` are uglified.

A specialization on `__facade::__sender<...>` does not match a derived
type, so the places that took senders apart that way now go through
`__facade::__facade_sender_t`: `ensure_started`'s "is already started"
check, nvexec's `_is_stream_facade_sender_v`, and the facade's `__retag`
lookup (which would otherwise have silently stopped seeing re-tagging
domains' results). `on(sndr, sch, clsur)` gets `__on_closure_sender`,
and `__on::__sndr` becomes `__on_sender`.

Compile time, memory, and object size are unchanged (within ~1.5%) on
clang and GCC 16 for 15 representative tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ericniebler
ericniebler merged commit 0ff8f43 into NVIDIA:main Dec 5, 2026
80 of 81 checks passed
@ericniebler
ericniebler deleted the pretty-sender-names branch December 5, 2026 05:15
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.

1 participant