Skip to content

[V4] No template-template#99

Merged
ConorWilliams merged 10 commits into
modulesfrom
v4-aa-ctx-3
Apr 24, 2026
Merged

[V4] No template-template#99
ConorWilliams merged 10 commits into
modulesfrom
v4-aa-ctx-3

Conversation

@ConorWilliams
Copy link
Copy Markdown
Owner

@ConorWilliams ConorWilliams commented Apr 24, 2026

Summary by CodeRabbit

  • Refactor
    • Reorganized internal context architecture to use policy-based design patterns for improved flexibility
    • Simplified handle model to reduce type complexity while maintaining safety semantics
    • Streamlined container integration in worker contexts for cleaner API surface

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: faa33264-f4b3-4591-81ae-40015e681b49

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v4-aa-ctx-3

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.

@ConorWilliams ConorWilliams changed the base branch from main to modules April 24, 2026 21:07
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/core/poly_context.cxx (1)

32-53: ⚠️ Potential issue | 🟡 Minor

Typo and now-dead post_error.

  • Line 52: "re-introdcue" → "re-introduce".
  • With poly_context::post commented out and post(...) also removed from derived_poly_context/mono_context (per the PR-wide refactor), nothing in the library now constructs or throws post_error. Since it's export-ed, it remains part of the public ABI/API but is orphan/dead until post() is re-introduced. Consider either removing it (and restoring it alongside post() later) or adding a short comment explaining it's retained for the TODO.
✏️ Proposed typo fix
-  // TODO: re-introdcue post API if/when we support auto/scheduling contexts.
+  // TODO: re-introduce post API if/when we support auto/scheduling contexts.
   // virtual void post([[maybe_unused]] sched_handle<poly_context> handle) { LF_THROW(post_error{}); }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/core/poly_context.cxx` around lines 32 - 53, Fix the typo in the TODO
comment by changing "re-introdcue" to "re-introduce", and address the dead
exported type post_error: either remove the exported post_error type until
poly_context::post (and related post implementations in
derived_poly_context/mono_context) are restored, or keep post_error but add a
short clarifying comment above it stating it is intentionally retained for
future post() re-introduction and currently unused; ensure references to
post_error, poly_context::post, derived_poly_context, and mono_context are
mentioned in the comment so maintainers know why it remains exported.
🧹 Nitpick comments (1)
src/batteries/contexts.cxx (1)

49-49: Optional: propagate noexcept on derived_poly_context::push for consistency with mono_context::push.

mono_context::push (line 71) is noexcept(noexcept(m_container.push(handle))), but the final override here drops that. A virtual override is allowed to be more noexcept than the base (poly_context::push has no noexcept), and since the Deque policy's push is what actually determines throwability, mirroring mono_context avoids a false exception-edge for derived_poly_context.

♻️ Suggested tweak
-  constexpr void push(steal_handle<context_type> handle) final { m_container.push(handle); }
+  constexpr void push(steal_handle<context_type> handle) noexcept(noexcept(m_container.push(handle))) final {
+    m_container.push(handle);
+  }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/batteries/contexts.cxx` at line 49, The override
derived_poly_context::push currently lacks a noexcept specifier and should
mirror mono_context::push's conditional noexcept to avoid weakening exception
guarantees; change derived_poly_context::push to be
noexcept(noexcept(m_container.push(handle))) so its exception specification is
determined by the underlying Deque's m_container.push, matching
mono_context::push and preventing a spurious exception edge.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/core/poly_context.cxx`:
- Around line 32-53: Fix the typo in the TODO comment by changing "re-introdcue"
to "re-introduce", and address the dead exported type post_error: either remove
the exported post_error type until poly_context::post (and related post
implementations in derived_poly_context/mono_context) are restored, or keep
post_error but add a short clarifying comment above it stating it is
intentionally retained for future post() re-introduction and currently unused;
ensure references to post_error, poly_context::post, derived_poly_context, and
mono_context are mentioned in the comment so maintainers know why it remains
exported.

---

Nitpick comments:
In `@src/batteries/contexts.cxx`:
- Line 49: The override derived_poly_context::push currently lacks a noexcept
specifier and should mirror mono_context::push's conditional noexcept to avoid
weakening exception guarantees; change derived_poly_context::push to be
noexcept(noexcept(m_container.push(handle))) so its exception specification is
determined by the underlying Deque's m_container.push, matching
mono_context::push and preventing a spurious exception edge.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48df51f3-df4d-41c1-a914-5dbb4e50e63f

📥 Commits

Reviewing files that changed from the base of the PR and between 143ba78 and 9b05b25.

📒 Files selected for processing (7)
  • benchmark/src/libfork/fib.cpp
  • src/batteries/adaptors.cxx
  • src/batteries/contexts.cxx
  • src/core/concepts/context.cxx
  • src/core/handles.cxx
  • src/core/poly_context.cxx
  • src/schedulers/busy.cxx

@ConorWilliams ConorWilliams merged commit efb7468 into modules Apr 24, 2026
7 of 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.

1 participant