Skip to content

Revert "Add O(1) indexed service slots to execution_context"#252

Merged
sgerbino merged 1 commit intocppalliance:developfrom
sgerbino:pr/revert-service
Apr 2, 2026
Merged

Revert "Add O(1) indexed service slots to execution_context"#252
sgerbino merged 1 commit intocppalliance:developfrom
sgerbino:pr/revert-service

Conversation

@sgerbino
Copy link
Copy Markdown
Collaborator

@sgerbino sgerbino commented Apr 2, 2026

This reverts commit d6a8e0c.

Summary by CodeRabbit

  • Refactor
    • Simplified internal service discovery mechanism by removing specialized fast-path caching and consolidating to a unified type-identifier-based lookup approach. No changes to public API or user-facing functionality.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 36641043-94bf-4f7a-9d1c-fce246b01b4d

📥 Commits

Reviewing files that changed from the base of the PR and between 5903c8a and 3cdd56c.

⛔ Files ignored due to path filters (2)
  • doc/unlisted/execution-contexts.adoc is excluded by !**/doc/**
  • test/unit/ex/execution_context.cpp is excluded by !**/test/**
📒 Files selected for processing (3)
  • include/boost/capy/detail/service_slot.hpp
  • include/boost/capy/ex/execution_context.hpp
  • src/ex/execution_context.cpp
💤 Files with no reviewable changes (2)
  • include/boost/capy/detail/service_slot.hpp
  • src/ex/execution_context.cpp

📝 Walkthrough

Walkthrough

This pull request removes the O(1) service slot fast-path caching mechanism from the boost::capy execution context library. The service_slot.hpp header is deleted entirely, and all atomic slot-based indexing and storage optimizations are removed from execution_context, reverting to purely type_id/type_index-based service lookups.

Changes

Cohort / File(s) Summary
Service Slot Infrastructure Removal
include/boost/capy/detail/service_slot.hpp
Entire file removed. Previously contained the service_slot<T>() function template and global next_service_slot atomic counter that provided O(1) type-to-slot indexing.
Execution Context Fast-Path Removal
include/boost/capy/ex/execution_context.hpp, src/ex/execution_context.cpp
Removed all O(1) slot caching logic: eliminated max_service_slots, slots_[] member storage, slot parameter from factory constructors, atomic slot writes/reads with memory ordering semantics, and post-deletion slot cleanup. Service lookups now rely exclusively on type_id/type_index mechanisms. Also removed #include <atomic> and service_slot.hpp headers.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 Fast slots fade to time's great race,
Type indices take their place,
No atomic dance, no speedy cache—
Just lookups clean, no memory clash!

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: reverting a previous commit that added O(1) indexed service slots to execution_context.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://252.capy.prtest3.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-04-02 17:41:50 UTC

@cppalliance-bot
Copy link
Copy Markdown

GCOVR code coverage report https://252.capy.prtest3.cppalliance.org/gcovr/index.html
LCOV code coverage report https://252.capy.prtest3.cppalliance.org/genhtml/index.html
Coverage Diff Report https://252.capy.prtest3.cppalliance.org/diff-report/index.html

Build time: 2026-04-02 17:57:47 UTC

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.51%. Comparing base (5903c8a) to head (3cdd56c).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #252      +/-   ##
===========================================
+ Coverage    92.42%   92.51%   +0.08%     
===========================================
  Files          172      170       -2     
  Lines         9414     9348      -66     
===========================================
- Hits          8701     8648      -53     
+ Misses         713      700      -13     
Flag Coverage Δ
linux 92.48% <ø> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
include/boost/capy/ex/execution_context.hpp 98.07% <100.00%> (-0.34%) ⬇️
src/ex/execution_context.cpp 94.28% <ø> (+5.64%) ⬆️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5903c8a...3cdd56c. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sgerbino sgerbino merged commit 37d9790 into cppalliance:develop Apr 2, 2026
40 checks passed
@sgerbino sgerbino deleted the pr/revert-service branch April 2, 2026 19:30
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