Skip to content

refactor: clean up sendability naming and flush-gate count typing - #813

Open
knoepfel wants to merge 2 commits into
Framework-R-D:mainfrom
knoepfel:minor-cleanups
Open

refactor: clean up sendability naming and flush-gate count typing#813
knoepfel wants to merge 2 commits into
Framework-R-D:mainfrom
knoepfel:minor-cleanups

Conversation

@knoepfel

@knoepfel knoepfel commented Aug 6, 2026

Copy link
Copy Markdown
Member
  • Code

    • Rename move_constructible_only to sendable_by_move.
    • Store flush_gate::committed_counts_ by value instead of through a shared pointer.
    • Update committed_counts() and roll_up_child() to use references.
    • Remove pointer dereferencing, null handling, and unused includes.
  • Tests

    • Update flush-gate tests to construct data_cell_counts by value.
    • Preserve spill-count accumulation and child-to-parent propagation coverage.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 319f8c80-bb3b-4607-920a-16133e98a09b

📥 Commits

Reviewing files that changed from the base of the PR and between 448de24 and c392c6a.

📒 Files selected for processing (4)
  • phlex/core/fold/send.hpp
  • phlex/model/flush_gate.cpp
  • phlex/model/flush_gate.hpp
  • test/flush_gate_test.cpp
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{cpp,cc,cxx,h,hpp}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{cpp,cc,cxx,h,hpp}: Use clang-format tool for all C++ code formatting (VS Code auto-formats on save); configuration defined in .clang-format with 100-character line limit and 2-space indentation
Follow clang-tidy recommendations defined in .clang-tidy

Files:

  • phlex/model/flush_gate.hpp
  • test/flush_gate_test.cpp
  • phlex/core/fold/send.hpp
  • phlex/model/flush_gate.cpp
**/*.{hpp,cpp}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{hpp,cpp}: Use .hpp for header files, .cpp for implementation, and *_test.cpp for test files in C++
Enforce 100-character line limit and 2-space indentation in C++ code via .clang-format
Use QualifierAlignment: Right (east-const) style: int const x not const int x in C++
Use PointerAlignment: Left in C++ (pointer * attached to type, not variable name)
All C++ identifiers must use lower_case naming: namespaces, classes, structs, enums, functions, variables, parameters, members, and constants
Exception to C++ naming: template parameters use CamelCase
Exception to C++ naming: macros use UPPER_CASE
Private, protected, and constant members in C++ must have a trailing underscore (_), no trailing underscore on anything else
Use enum class preferred over plain enum in C++
Use std::shared_ptr for shared ownership, std::unique_ptr for exclusive ownership, raw pointers for non-owning references only in C++
Use functors with agent-noun pattern: ModelEvaluator evaluate_model(...) in C++
Apply .clang-tidy checks for bugprone, cert, clang-analyzer, concurrency, cppcoreguidelines, misc, modernize, performance, portability, and readability as defined in the .clang-tidy configuration file
Use phlex:: namespace for core code, phlex::experimental:: for experimental features in C++

Files:

  • phlex/model/flush_gate.hpp
  • test/flush_gate_test.cpp
  • phlex/core/fold/send.hpp
  • phlex/model/flush_gate.cpp
**/*.hpp

📄 CodeRabbit inference engine (AGENTS.md)

Avoid boolean parameters in C++ interfaces; prefer enumerations instead

Files:

  • phlex/model/flush_gate.hpp
  • phlex/core/fold/send.hpp
🔇 Additional comments (5)
phlex/core/fold/send.hpp (1)

33-33: 🎯 Functional Correctness

No remaining repository references to the old concept.

phlex/model/flush_gate.hpp (2)

43-43: LGTM!

Also applies to: 70-70, 88-88


61-61: 🩺 Stability & Availability

No change needed.

Current committed_counts() callers consume the returned reference immediately in roll_up_child(), so there is no dangling-reference path here for this PR.

phlex/model/flush_gate.cpp (1)

3-11: LGTM!

Also applies to: 22-28, 38-41, 86-86

test/flush_gate_test.cpp (1)

29-29: LGTM!

Also applies to: 225-231


📝 Walkthrough

Walkthrough

The PR renames a sendability concept and updates its specialization. It also changes flush_gate committed-count storage and roll-up APIs from shared pointers to direct values and references, with corresponding test updates.

Changes

Sendability concept rename

Layer / File(s) Summary
Rename sendability concept
phlex/core/fold/send.hpp
move_constructible_only is renamed to sendable_by_move, and sendable_type_impl uses the new concept name.

Flush gate count ownership

Layer / File(s) Summary
Use direct flush count values
phlex/model/flush_gate.hpp, phlex/model/flush_gate.cpp, test/flush_gate_test.cpp
flush_gate stores committed_counts_ by value, returns it by const reference, accepts child counts by const reference, and updates tests to construct counts by value.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

  • Framework-R-D/phlex#796 — This PR overlaps with the flush_gate::roll_up_child API change to data_cell_counts const&.

Suggested reviewers: aolivier23

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes both main refactoring changes: sendability naming and flush-gate count typing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@knoepfel knoepfel linked an issue Aug 6, 2026 that may be closed by this pull request
Comment on lines -87 to -90
// FIXME: We express committed_counts_ as a shared pointer so that we can copy the committed
// counts (this is done for determining the flush values for folds). Once the fold
// flushes are incorporated as part of the multi-layer join node infrastructure, it
// should be possible for committed_counts_ to no longer be a pointer, but a value.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It might be helpful to add to the commit log a summary of why the shared_ptr is no longer needed (eg. could include the PR number(s) that render this moot).

@pcanal pcanal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM (although the commit log commit enhance with more detail on the 'why' of the changes).

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.

Rename move_constructible_only to clarify sendability semantics

2 participants