NVIDIA / NVIDIA/stdexec

Parallel scheduler namespace problems

Open
#2,071 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.4k
Forks
270
Avg merge
3d 6h
Merged PRs (30d)
39

Description

The STDEXEC namespace is dependent on the definition of STDEXEC_NAMESPACE, which may be std::execution.

In __config.hpp there exists an unconditional definition of namespace std::execution::parallel_scheduler_replacement. It's unclear to me if this is intended.

In sudoku.cpp STDEXEC_NAMESPACE is locally defined as std::execution. However, this breaks when using STDEXEC_BUILD_PARALLEL_SCHEDULER , because parallel_scheduler_replacement is now built in a separate TU, which is unaware of the local namespace override. This nested namespace ends up in namespace STDEXEC in on TU and in namespace std::execution in another.

I also noticed that STDEXEC_BUILD_PARALLEL_SCHEDULER is not tested in CI, which is probably why this problem has gone unnoticed thus far.

I think the simplest solution here would be to:

  1. Use STDEXEC instead of std and nested namespace in sudoku.cpp.
  2. Define STDEXEC_BUILD_PARALLEL_SCHEDULER in the CI builds.
  3. Either remove or document the unconditional std::execution namespace in __config.hpp.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the namespace handling in __config.hpp and sudoku.cpp, then inspect CI configurations for STDEXEC_BUILD_PARALLEL_SCHEDULER. Reproduce the separate translation-unit build and verify that parallel_scheduler_replacement uses a consistent namespace. Done means the scheduler build succeeds and CI covers the option, with the unconditional namespace documented or removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.