Conversation
This reverts commit 7b90bca.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
d7d630a to
d5b82ce
Compare
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/batteries/adaptor_stack.cxx (1)
1-28:⚠️ Potential issue | 🟡 MinorRemove the fully commented
adaptor_stack.cxxfile entirely.The file is completely dead code with no references in the codebase and no build configuration. Keeping it serves no purpose and introduces unnecessary maintenance overhead. Delete the file.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/batteries/adaptor_stack.cxx` around lines 1 - 28, Delete the dead, fully commented source file src/batteries/adaptor_stack.cxx from the repo (it only contains a commented-out adaptor struct in namespace lf::stacks and no active code such as the template struct adaptor, ckpt, or related functions push/pop/checkpoint), and ensure no remaining references to the adaptor, ckpt type, or lf::stacks namespace exist in the codebase or build configuration; if any incidental references are found, remove or update them accordingly so the deletion is safe.
🧹 Nitpick comments (3)
src/core/handles.cxx (1)
41-42: Track the inheritance TODO explicitly.This TODO sits in a public-facing module unit; consider linking it to an issue (or resolving it) to avoid long-lived ambiguity in API shape.
If you want, I can draft a small issue template text for this TODO.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/core/handles.cxx` around lines 41 - 42, Replace the ambiguous inline TODO "can we private inherit?" with an explicit tracked action: either (A) resolve it by changing the public-facing type declared in the same compilation unit to use private inheritance (adjusting the class declaration, any affected methods, and public API/tests accordingly) or (B) add a link to a created issue and replace the TODO with a clear comment referencing that issue (e.g., "TODO: see issue `#NN` - consider private inheritance and API implications"), plus a one-line rationale; ensure the chosen change updates any related tests/docs and the commit message.src/core/task.cxx (1)
19-22: Consider documenting the purpose of the unused template parameter.The
envstruct template takes aworker_contextbut doesn't use it in the body. This appears intentional as a tag type for context-aware invocation dispatching, but a brief doc comment would clarify this design choice.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/core/task.cxx` around lines 19 - 22, Add a brief doc comment above the template struct env explaining that the template parameter worker_context is intentionally unused and serves as a tag/type-discriminator for context-aware invocation/dispatch; mention that the explicit constexpr env(key_t) noexcept constructor exists to accept a key but the template parameter is only for compile-time tagging (e.g., reference symbols env, worker_context, and the env(key_t) ctor) so future readers understand the design choice.src/batteries/contexts.cxx (1)
81-86:dummy_contextmembers are declared but not defined.This struct declares
post,push,pop, andstackbut provides no definitions. If this is intentional for compile-time-only concept checking, consider adding a comment. Otherwise, link errors will occur if these are ODR-used.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/batteries/contexts.cxx` around lines 81 - 86, The declarations in dummy_context (methods post, push, pop, stack) lack definitions and will cause link errors if ODR-used; either provide appropriate definitions (e.g., inline no-op implementations or meaningful bodies) for dummy_context::post(lf::sched_handle<dummy_context>), dummy_context::push(lf::steal_handle<dummy_context>), dummy_context::pop() noexcept -> lf::steal_handle<dummy_context>, and dummy_context::stack() noexcept -> dummy_allocator& so they link, or if they are only for concept checking mark them explicitly (add a clear comment explaining they are intentionally undefined) or change them to deleted/defaulted stubs to avoid accidental ODR-use. Ensure the chosen fix is applied in the same translation unit (make them inline if in a header) so consumers won’t get linker errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@AGENTS.md`:
- Line 144: The doc line describing "utils/ # libfork.utils —
internal utilities (not public API)" is inconsistent because src/libfork.cxx
publicly re-exports libfork.utils; update the description to reflect that
libfork.utils is publicly available (for example: "utils/ #
libfork.utils — shared utility APIs (publicly re-exported)") so the docs match
the actual export behavior from src/libfork.cxx.
In `@docs/structure.md`:
- Line 7: Replace the bare abbreviation "etc" with the punctuated American
English form "etc." wherever it appears (e.g., the occurrence shown in the
diff), updating the docs/structure.md content to include the trailing period;
ensure any instances in the file follow this same change for consistency.
In `@src/batteries/contexts.cxx`:
- Line 63: The pop() method currently declares noexcept unconditionally; change
it to conditionally noexcept by using noexcept(m_container.pop()) so the
exception specification matches the underlying Adaptor's pop() behavior—update
the pop() declaration in the class that defines constexpr auto pop() ->
steal_handle<context_type> to use noexcept(noexcept(m_container.pop())) and
ensure it still returns m_container.pop().
In `@src/core/concepts/context.cxx`:
- Around line 24-30: The worker_context concept declares an unused parameter
sched_handle<T> await; either remove that parameter from the requires clause or
add the missing constraint that uses it—i.e., add a requirement like {
context.post(await) } -> std::same_as<void>; (or noexcept if intended) so the
concept actually constrains post(), or simply drop "sched_handle<T> await" from
the requires parameter list to eliminate the unused symbol; update the concept
worker_context accordingly while keeping existing constraints for
context.push(frame), context.pop(), and context.stack().
In `@src/core/concepts/invocable.cxx`:
- Around line 15-25: The comment on ctx_invoke_t is truncated; update the
comment above the constrained operator() overload to read a complete sentence
such as "Explicitly constrained so overload resolution prefers the constrained
overload," referencing ctx_invoke_t and the template operator()(Fn &&fn, Args
&&...args) that uses requires std::invocable<...>; ensure the explanatory
comment clearly states that the constraint guides overload resolution to select
the constrained operator() when applicable.
In `@src/core/thread_locals.cxx`:
- Line 15: Fix the typo in the top-of-file TODO comment in
src/core/thread_locals.cxx by changing "implictaions" to "implications" in the
TODO ("// TODO: implictaions of thread local on constexpr") so the comment reads
"// TODO: implications of thread local on constexpr"; no code changes beyond
correcting the misspelled word in that comment.
In `@src/utils/utility.cxx`:
- Around line 66-76: The comment says is_sufficiently_aligned supports "fancy
pointers" but the signature uses T* so it only accepts raw pointers; change the
template to accept the pointer type itself (e.g., template<std::size_t Align,
typename Ptr>) and use std::to_address(ptr) or
std::bit_cast<std::uintptr_t>(std::to_address(ptr)) as currently done, keeping
the requires clause on Align; update any uses of T inside the function
accordingly so is_sufficiently_aligned works with fancy pointer types and still
enforces std::has_single_bit(Align).
---
Outside diff comments:
In `@src/batteries/adaptor_stack.cxx`:
- Around line 1-28: Delete the dead, fully commented source file
src/batteries/adaptor_stack.cxx from the repo (it only contains a commented-out
adaptor struct in namespace lf::stacks and no active code such as the template
struct adaptor, ckpt, or related functions push/pop/checkpoint), and ensure no
remaining references to the adaptor, ckpt type, or lf::stacks namespace exist in
the codebase or build configuration; if any incidental references are found,
remove or update them accordingly so the deletion is safe.
---
Nitpick comments:
In `@src/batteries/contexts.cxx`:
- Around line 81-86: The declarations in dummy_context (methods post, push, pop,
stack) lack definitions and will cause link errors if ODR-used; either provide
appropriate definitions (e.g., inline no-op implementations or meaningful
bodies) for dummy_context::post(lf::sched_handle<dummy_context>),
dummy_context::push(lf::steal_handle<dummy_context>), dummy_context::pop()
noexcept -> lf::steal_handle<dummy_context>, and dummy_context::stack() noexcept
-> dummy_allocator& so they link, or if they are only for concept checking mark
them explicitly (add a clear comment explaining they are intentionally
undefined) or change them to deleted/defaulted stubs to avoid accidental
ODR-use. Ensure the chosen fix is applied in the same translation unit (make
them inline if in a header) so consumers won’t get linker errors.
In `@src/core/handles.cxx`:
- Around line 41-42: Replace the ambiguous inline TODO "can we private inherit?"
with an explicit tracked action: either (A) resolve it by changing the
public-facing type declared in the same compilation unit to use private
inheritance (adjusting the class declaration, any affected methods, and public
API/tests accordingly) or (B) add a link to a created issue and replace the TODO
with a clear comment referencing that issue (e.g., "TODO: see issue `#NN` -
consider private inheritance and API implications"), plus a one-line rationale;
ensure the chosen change updates any related tests/docs and the commit message.
In `@src/core/task.cxx`:
- Around line 19-22: Add a brief doc comment above the template struct env
explaining that the template parameter worker_context is intentionally unused
and serves as a tag/type-discriminator for context-aware invocation/dispatch;
mention that the explicit constexpr env(key_t) noexcept constructor exists to
accept a key but the template parameter is only for compile-time tagging (e.g.,
reference symbols env, worker_context, and the env(key_t) ctor) so future
readers understand the design choice.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 50f2ce86-ad46-4b21-8a4c-f1cfcab767c6
📒 Files selected for processing (52)
AGENTS.mdCLAUDE.mdCMakeLists.txtbenchmark/src/libfork_benchmark/fib/baremetal.cppbenchmark/src/libfork_benchmark/fib/fib.hppbenchmark/src/libfork_benchmark/fib/libfork.cppdocs/structure.mdsrc/batteries/adaptor_stack.cxxsrc/batteries/adaptors.cxxsrc/batteries/batteries.cxxsrc/batteries/contexts.cxxsrc/batteries/deque.cxxsrc/batteries/dummy_stack.cxxsrc/batteries/geometric_stack.cxxsrc/core/concepts.cxxsrc/core/concepts/context.cxxsrc/core/concepts/invocable.cxxsrc/core/concepts/scheduler.cxxsrc/core/concepts/stack.cxxsrc/core/core.cxxsrc/core/execute.cxxsrc/core/frame.cxxsrc/core/handles.cxxsrc/core/mono_context.cxxsrc/core/ops.cxxsrc/core/poly_context.cxxsrc/core/promise.cxxsrc/core/receiver.cxxsrc/core/root.cxxsrc/core/schedule.cxxsrc/core/task.cxxsrc/core/thread_locals.cxxsrc/core/utility.cxxsrc/libfork.cxxsrc/schedule/dummy.cxxsrc/schedule/schedule.cxxsrc/schedulers/inline.cxxsrc/schedulers/schedulers.cxxsrc/utils/concepts.cxxsrc/utils/constants.cxxsrc/utils/defer.cxxsrc/utils/exception.cxxsrc/utils/tuple.cxxsrc/utils/utility.cxxsrc/utils/utils.cxxtest/src/concepts.cpptest/src/deque.cpptest/src/promise.cpptest/src/schedule.cpptest/src/stack.cpptest/src/tuple.cpptest/src/utility.cpp
💤 Files with no reviewable changes (6)
- src/schedule/schedule.cxx
- benchmark/src/libfork_benchmark/fib/fib.hpp
- src/schedule/dummy.cxx
- src/core/mono_context.cxx
- src/core/concepts.cxx
- src/core/utility.cxx
Large layout refactor
Summary by CodeRabbit
New Features
libfork.utilsmodule with deferred execution utilities and refined exception handling.libfork.batteriesmodule consolidating adaptors, contexts, and stack implementations.libfork.schedulersfor scheduler types.Documentation
Refactor
geometrictogeometric_stackfor consistency.libfork_exceptionbase class.