Skip to content

Fix allocation and affinity papers #78

Merged
dietmarkuehl merged 6 commits intomainfrom
fix-allocation-paper
Mar 28, 2026
Merged

Fix allocation and affinity papers #78
dietmarkuehl merged 6 commits intomainfrom
fix-allocation-paper

Conversation

@dietmarkuehl
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 28, 2026 08:39
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 28, 2026

Coverage Status

coverage: 94.212%. remained the same
when pulling 4e2566d on fix-allocation-paper
into 6a58aff on main.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces an “infallible scheduler” concept and uses it to constrain task_scheduler, along with accompanying test assertions and paper (docs) updates related to allocation and scheduler affinity wording.

Changes:

  • Add beman::task::detail::infallible_scheduler concept and apply it as a constraint on task_scheduler construction.
  • Update scheduler-related tests to provide get_completion_signatures and assert infallible_scheduler compliance.
  • Revise P3980/P3941 paper text to reflect updated wording and concepts (including get_start_scheduler usage).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/beman/task/task_scheduler.test.cpp Adds get_completion_signatures to a test sender and asserts infallible_scheduler for the test scheduler.
include/beman/task/detail/task_scheduler.hpp Includes and constrains task_scheduler to only accept infallible schedulers in env<>.
include/beman/task/detail/inline_scheduler.hpp Adds an include (currently unused) and an extra scheduler static_assert.
include/beman/task/detail/infallible_scheduler.hpp New header defining completes_with / infallible_scheduler concepts.
docs/P3980-allocation.md Updates paper metadata and wording around allocator/operator new requirements.
docs/P3941-affinity.md Updates paper metadata and wording, adds infallible-scheduler exposition and shifts to get_start_scheduler.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +7 to +19
#include <beman/execution/execution.hpp>
#include <concepts>
#include <type_traits>

// ----------------------------------------------------------------------------

namespace beman::task::detail {
template <class Sch, class Env, class... Comp>
concept completes_with =
::std::same_as<::beman::execution::completion_signatures<Comp...>,
::beman::execution::
completion_signatures_of_t<decltype(::beman::execution::schedule(::std::declval<Sch>())), Env>>;

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

std::declval is used in completes_with but this header doesn’t include <utility>, which is where std::declval is declared. Relying on transitive includes can break builds depending on include order; add #include <utility> (or otherwise ensure declval is available) in this header.

Copilot uses AI. Check for mistakes.
Comment on lines 176 to 181
template <typename S, typename Allocator = ::std::allocator<void>>
requires(not std::same_as<task_scheduler, std::remove_cvref_t<S>>) &&
::beman::execution::scheduler<::std::remove_cvref_t<S>>
::beman::execution::scheduler<::std::remove_cvref_t<S>> &&
::beman::task::detail::infallible_scheduler<::std::remove_cvref_t<S>, ::beman::execution::env<>>
explicit task_scheduler(S&& s, Allocator = {})
: scheduler(static_cast<concrete<std::decay_t<S>>*>(nullptr), std::forward<S>(s)) {}
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

The new infallible_scheduler constraint changes task_scheduler from “type-erase any scheduler” (per the class comment) to only accepting schedulers whose schedule completes infallibly in env<>. Please update the class documentation (and the listed completion signatures/error behavior) to match the new, stricter contract so users aren’t misled.

Copilot uses AI. Check for mistakes.
#define INCLUDED_BEMAN_TASK_DETAIL_INLINE_SCHEDULER

#include <beman/execution/execution.hpp>
#include <beman/task/detail/infallible_scheduler.hpp>
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

<beman/task/detail/infallible_scheduler.hpp> is included here but nothing in this header references infallible_scheduler (or related helpers). Consider removing this include to avoid unnecessary header coupling and reduce compile time.

Suggested change
#include <beman/task/detail/infallible_scheduler.hpp>

Copilot uses AI. Check for mistakes.
ill-formed.]{.add} Let `op` be an lvalue referring to the operation
type `Env` [such that <code>sender_in&lt;_OutSndr_, Env&gt;</code>
is `true`]{.rm}. [If <code>get_start_scheduler(get_env(out_rcvr))</code> is ill-formed
or does not satisfy `@_infallible-scheduler_@<Env>` then evaluation of the
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

This uses @_infallible-scheduler_@<Env> but earlier the paper defines @_infallible-scheduler_@ as a two-parameter concept template<class Sch, class Env>. Update this reference to pass the scheduler type as well (e.g., based on decltype(get_start_scheduler(get_env(out_rcvr)))).

Suggested change
or does not satisfy `@_infallible-scheduler_@<Env>` then evaluation of the
or does not satisfy `@_infallible-scheduler_@<decltype(get_start_scheduler(get_env(out_rcvr))), Env>` then evaluation of the

Copilot uses AI. Check for mistakes.
}
```

::: ednot
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

Typo in directive: ::: ednot should be ::: ednote (otherwise tooling that recognizes ednote blocks won’t pick this up).

Suggested change
::: ednot
::: ednote

Copilot uses AI. Check for mistakes.
@dietmarkuehl dietmarkuehl merged commit 16a5916 into main Mar 28, 2026
36 checks passed
@dietmarkuehl dietmarkuehl deleted the fix-allocation-paper branch March 28, 2026 08: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.

3 participants