Skip to content

Add missing - #362

Open
dietmarkuehl wants to merge 7 commits into
mainfrom
add-missing
Open

dietmarkuehl wants to merge 7 commits into
mainfrom
add-missing

Conversation

@dietmarkuehl

Copy link
Copy Markdown
Member

No description provided.

@dietmarkuehl
dietmarkuehl requested a review from camio as a code owner November 30, 2026 23:32
Copilot AI balanced review requested due to automatic review settings November 30, 2026 23:32
Comment thread examples/bulk.cpp Outdated
Comment on lines +23 to +25
struct backend: ex::parallel_scheduler_replacement::parallel_scheduler_backend {
using receiver_proxy = ex::parallel_scheduler_replacement::receiver_proxy;
using bulk_item_receiver_proxy = ex::parallel_scheduler_replacement::bulk_item_receiver_proxy;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pre-commit] reported by reviewdog 🐶

Suggested change
struct backend: ex::parallel_scheduler_replacement::parallel_scheduler_backend {
using receiver_proxy = ex::parallel_scheduler_replacement::receiver_proxy;
using bulk_item_receiver_proxy = ex::parallel_scheduler_replacement::bulk_item_receiver_proxy;
struct backend : ex::parallel_scheduler_replacement::parallel_scheduler_backend {
using receiver_proxy = ex::parallel_scheduler_replacement::receiver_proxy;
using bulk_item_receiver_proxy = ex::parallel_scheduler_replacement::bulk_item_receiver_proxy;

Comment thread examples/bulk.cpp Outdated
using receiver_proxy = ex::parallel_scheduler_replacement::receiver_proxy;
using bulk_item_receiver_proxy = ex::parallel_scheduler_replacement::bulk_item_receiver_proxy;

~backend() override = default;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pre-commit] reported by reviewdog 🐶

Suggested change
~backend() override = default;
~backend() override = default;

Comment thread examples/bulk.cpp Outdated
Comment on lines +29 to +43
auto schedule(receiver_proxy& rcvr, ::std::span<::std::byte>) noexcept -> void override {
rcvr.set_value();
}
auto schedule_bulk_chunked(::std::size_t shape, bulk_item_receiver_proxy& rcvr, ::std::span<::std::byte>) noexcept -> void override
{
rcvr.execute(0, shape);
rcvr.set_value();
}
auto schedule_bulk_unchunked(::std::size_t shape, bulk_item_receiver_proxy& rcvr, ::std::span<::std::byte>) noexcept -> void override {
for (std::size_t i{}; i != shape; ++i)
rcvr.execute(i, i + 1u);
rcvr.set_value();
}
};
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pre-commit] reported by reviewdog 🐶

Suggested change
auto schedule(receiver_proxy& rcvr, ::std::span<::std::byte>) noexcept -> void override {
rcvr.set_value();
}
auto schedule_bulk_chunked(::std::size_t shape, bulk_item_receiver_proxy& rcvr, ::std::span<::std::byte>) noexcept -> void override
{
rcvr.execute(0, shape);
rcvr.set_value();
}
auto schedule_bulk_unchunked(::std::size_t shape, bulk_item_receiver_proxy& rcvr, ::std::span<::std::byte>) noexcept -> void override {
for (std::size_t i{}; i != shape; ++i)
rcvr.execute(i, i + 1u);
rcvr.set_value();
}
};
}
auto schedule(receiver_proxy& rcvr, ::std::span<::std::byte>) noexcept -> void override { rcvr.set_value(); }
auto schedule_bulk_chunked(::std::size_t shape, bulk_item_receiver_proxy& rcvr, ::std::span<::std::byte>) noexcept
-> void override {
rcvr.execute(0, shape);
rcvr.set_value();
}
auto schedule_bulk_unchunked(::std::size_t shape,
bulk_item_receiver_proxy& rcvr,
::std::span<::std::byte>) noexcept -> void override {
for (std::size_t i{}; i != shape; ++i)
rcvr.execute(i, i + 1u);
rcvr.set_value();
}
};
} // namespace

Comment thread examples/bulk.cpp Outdated
}

namespace beman::execution::parallel_scheduler_replacement {
auto query_parallel_scheduler_backend()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pre-commit] reported by reviewdog 🐶

Suggested change
auto query_parallel_scheduler_backend()
auto query_parallel_scheduler_backend()

Comment thread examples/bulk.cpp Outdated
static auto rc = ::std::make_shared<backend>();
return rc;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pre-commit] reported by reviewdog 🐶

Suggested change
}
} // namespace beman::execution::parallel_scheduler_replacement

Comment thread examples/bulk.cpp Outdated
Comment on lines +55 to +78
int main()
{
ex::sync_wait(
ex::starts_on(ex::get_parallel_scheduler(), ex::just("arg"sv, 2, 3))
| ex::bulk(
ex::par,
10,
[](auto... values) {
((std::cout << values << " "), ...) << "\n";
}
)
| ex::then([](auto&&... values) { ((std::cout << values << " "), ...) << ": done\n"; })
);
ex::sync_wait(
ex::starts_on(ex::get_parallel_scheduler(), ex::just("arg"sv, 2, 3))
| ex::bulk_chunked(
ex::par,
10,
[](auto... values) {
((std::cout << values << " "), ...) << "\n";
}
)
| ex::then([](auto&&... values) { ((std::cout << values << " "), ...) << ": done\n"; })
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pre-commit] reported by reviewdog 🐶

Suggested change
int main()
{
ex::sync_wait(
ex::starts_on(ex::get_parallel_scheduler(), ex::just("arg"sv, 2, 3))
| ex::bulk(
ex::par,
10,
[](auto... values) {
((std::cout << values << " "), ...) << "\n";
}
)
| ex::then([](auto&&... values) { ((std::cout << values << " "), ...) << ": done\n"; })
);
ex::sync_wait(
ex::starts_on(ex::get_parallel_scheduler(), ex::just("arg"sv, 2, 3))
| ex::bulk_chunked(
ex::par,
10,
[](auto... values) {
((std::cout << values << " "), ...) << "\n";
}
)
| ex::then([](auto&&... values) { ((std::cout << values << " "), ...) << ": done\n"; })
);
int main() {
ex::sync_wait(ex::starts_on(ex::get_parallel_scheduler(), ex::just("arg"sv, 2, 3)) |
ex::bulk(ex::par, 10, [](auto... values) { ((std::cout << values << " "), ...) << "\n"; }) |
ex::then([](auto&&... values) { ((std::cout << values << " "), ...) << ": done\n"; }));
ex::sync_wait(ex::starts_on(ex::get_parallel_scheduler(), ex::just("arg"sv, 2, 3)) |
ex::bulk_chunked(ex::par, 10, [](auto... values) { ((std::cout << values << " "), ...) << "\n"; }) |
ex::then([](auto&&... values) { ((std::cout << values << " "), ...) << ": done\n"; }));

Comment thread examples/bulk.cpp Outdated
Comment on lines +80 to +89
ex::starts_on(ex::get_parallel_scheduler(), ex::just("arg"sv, 2, 3))
| ex::bulk_unchunked(
ex::par,
10,
[](auto... values) {
((std::cout << values << " "), ...) << "\n";
}
)
| ex::then([](auto&&... values) { ((std::cout << values << " "), ...) << ": done\n"; })
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pre-commit] reported by reviewdog 🐶

Suggested change
ex::starts_on(ex::get_parallel_scheduler(), ex::just("arg"sv, 2, 3))
| ex::bulk_unchunked(
ex::par,
10,
[](auto... values) {
((std::cout << values << " "), ...) << "\n";
}
)
| ex::then([](auto&&... values) { ((std::cout << values << " "), ...) << ": done\n"; })
);
ex::starts_on(ex::get_parallel_scheduler(), ex::just("arg"sv, 2, 3)) |
ex::bulk_unchunked(ex::par, 10, [](auto... values) { ((std::cout << values << " "), ...) << "\n"; }) |
ex::then([](auto&&... values) { ((std::cout << values << " "), ...) << ": done\n"; }));

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Multiple critical issues remain, including a missing example source that will break the build and removal of the publicly documented query_parallel_scheduler_backend declaration/export (plus related CMake macro propagation problems), so the change is not in a shippable state yet.

7 open issues
What changed in this PR

Moves the default parallel_scheduler_replacement::query_parallel_scheduler_backend() from an inline/header implementation to a conditionally compiled .cpp, and updates build wiring, module/header exposure, tests, examples, and docs accordingly.

Changes:

  • Add a compiled default backend implementation and hook it into the library build behind a CMake option.
  • Adjust module re-exports and header includes around parallel_scheduler_replacement/backend querying.
  • Update tests, examples configuration, and documentation to reflect the new scheduler/backend structure.
File Description
tests/​beman/​execution/​exec-parallel-scheduler.test.cpp Updates the parallel scheduler test to include the default backend header so the backend query symbol is visible during testing.
src/​beman/​execution/​parallel_scheduler_replacement.cppm Adjusts the beman.execution.detail.parallel_scheduler_replacement module’s exported surface related to the backend query function.
src/​beman/​execution/​execution.cppm Updates the top-level beman.execution module interface exports for the parallel scheduler replacement/backend query API.
src/​beman/​execution/​default_parallel_scheduler_backend.cpp Adds a new translation unit providing the default implementation of query_parallel_scheduler_backend() backed by the thread-pool backend.
src/​beman/​execution/​CMakeLists.txt Converts the execution target into a compiled library and conditionally adds the new default-backend source while managing related build options.
include/​beman/​execution/​detail/​parallel_scheduler.hpp Ensures the default backend query declaration is available by including the default-backend header from the parallel scheduler header.
include/​beman/​execution/​detail/​parallel_scheduler_replacement.hpp Updates the replacement header’s declarations, including removing the backend query declaration from this header.
include/​beman/​execution/​detail/​default_parallel_scheduler_backend.hpp Refactors the default-backend header to be declaration-only for query_parallel_scheduler_backend() rather than providing an inline definition.
examples/​CMakeLists.txt Updates the examples build configuration by adding bulk to the list of example targets.
docs/​overview.md Extends the overview documentation with scheduler-related content and updates sections referencing bulk/scheduler features.

Review effort: Balanced
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

Comment thread examples/CMakeLists.txt

set(EXAMPLES
allocator
bulk
Comment on lines 266 to 270
namespace parallel_scheduler_replacement {
export using ::beman::execution::parallel_scheduler_replacement::receiver_proxy;
export using ::beman::execution::parallel_scheduler_replacement::bulk_item_receiver_proxy;
export using ::beman::execution::parallel_scheduler_replacement::parallel_scheduler_backend;
export using ::beman::execution::parallel_scheduler_replacement::query_parallel_scheduler_backend;
} // namespace parallel_scheduler_replacement
Comment on lines 9 to 13
namespace beman::execution::parallel_scheduler_replacement {
export using beman::execution::parallel_scheduler_replacement::receiver_proxy;
export using beman::execution::parallel_scheduler_replacement::bulk_item_receiver_proxy;
export using beman::execution::parallel_scheduler_replacement::parallel_scheduler_backend;
export using beman::execution::parallel_scheduler_replacement::query_parallel_scheduler_backend;
} // namespace beman::execution::parallel_scheduler_replacement
Comment on lines 68 to 70
};

auto query_parallel_scheduler_backend() -> ::std::shared_ptr<parallel_scheduler_backend>;

} // namespace beman::execution::parallel_scheduler_replacement
Comment on lines 262 to 267
target_compile_definitions(
${BEMAN_EXECUTION_TARGET_NAME}
INTERFACE
BEMAN_EXECUTION_WITH_DEFAULT_PARALLEL_SCHEDULER_BACKEND=$<BOOL:${BEMAN_EXECUTION_WITH_DEFAULT_PARALLEL_SCHEDULER_BACKEND}>
BEMAN_EXECUTION_WITH_GCD_SUPPORT=$<BOOL:${BEMAN_EXECUTION_WITH_GCD_SUPPORT}>
)
Comment thread docs/overview.md
<details>
<summary><code>bulk(<i>sndr</i>, <i>policy</i>, <i>shape</i>, <i>fun</i>) -&gt; <i>sender</i></code></summary>
<a id='bulk'></a>
The algorithm <code>bulk</code> is used to execute <code>fun</code>
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <beman/execution/detail/default_parallel_scheduler_backend.hpp>
#include <iostream>
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 92.391% (+0.06%) from 92.336% — add-missing into main

This branch has not been deployed

No deployments
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.

3 participants