Skip to content

Add co_sm utility with coroutine policies, tests, and benchmark#10

Merged
gabewillen merged 2 commits intomainfrom
codex/f570-co-sm
Feb 24, 2026
Merged

Add co_sm utility with coroutine policies, tests, and benchmark#10
gabewillen merged 2 commits intomainfrom
codex/f570-co-sm

Conversation

@gabewillen
Copy link

@gabewillen gabewillen commented Feb 24, 2026

Summary

  • add include/boost/sml/utility/co_sm.hpp with utility::co_sm, utility::bool_task, and coroutine scheduler/allocator policies
  • add functional tests in test/ft/co_sm.cpp for coroutine-enabled and disabled paths
  • add benchmark target benchmark/simple/co_sm.cpp and register it in CMake

Quality gates

Ran ./scripts/quality_gates.sh successfully:

  • format: pass
  • clang-tidy: pass
  • regression matrix: pass
  • sanitizer matrix: pass
  • coverage gate: pass (99.2% >= 90%)
  • benchmark smoke build: pass

Notes

  • this is opt-in via #include <boost/sml/utility/co_sm.hpp>
  • no changes were made to include/boost/sml.hpp
  • coroutine code is gated with BOOST_SML_UTILITY_CO_SM_ENABLED (C++20 + coroutine support)

Copilot AI review requested due to automatic review settings February 24, 2026 16:32
Copy link

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

Adds an opt-in coroutine-enabled state machine utility (co_sm) to Boost.SML, with configurable coroutine scheduler/allocator policies, plus functional tests and a benchmark target to validate and measure coroutine-enabled/disabled behavior.

Changes:

  • Introduce include/boost/sml/utility/co_sm.hpp providing co_sm, coroutine scheduler policies, coroutine allocator policies, and bool_task.
  • Add functional tests for co_sm (enabled/disabled paths) and add a regression test for issue boost-ext#171.
  • Add a new benchmark/simple/co_sm.cpp target and register it in CMake; small core mapping tweak in include/boost/sml.hpp for anonymous.

Reviewed changes

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

Show a summary per file
File Description
include/boost/sml/utility/co_sm.hpp New coroutine-enabled SM utility (co_sm), scheduler/allocator policies, and bool_task.
include/boost/sml.hpp Extend event-mapping helper to handle anonymous.
test/ft/co_sm.cpp New functional tests covering coroutine-enabled and disabled compilation paths.
test/ft/issue_171.cpp New regression test ensuring wildcard event handling isn’t duplicated.
test/ft/CMakeLists.txt Register new functional test executables (test_co_sm, test_issue_171).
benchmark/simple/co_sm.cpp New benchmark comparing co_sm (when enabled) vs sm fallback.
benchmark/simple/CMakeLists.txt Register the new simple_co_sm benchmark target.

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

@gabewillen gabewillen merged commit cb75a87 into main Feb 24, 2026
10 checks passed
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