Refactor: name task lifecycle flags accurately - #1415
Conversation
Rename the shared slot bitmask and consolidate its flag enums. Keep both A2A3 runtime variants aligned without changing layout, ordering, or atomic behavior.
There was a problem hiding this comment.
Code Review
This pull request refactors the task lifecycle state management in the runtime. It consolidates several individual enums (PTO2ReadyState, PTO2CompletionFlag, PTO2DeferredCompletionFlag, and PTO2DispatchPropagationFlag) into a single unified enum PTO2TaskLifecycleFlag using bitwise flags. Additionally, the atomic member variable ready_state in PTO2TaskSlotState has been renamed to lifecycle_flags to better reflect its consolidated purpose. All corresponding references, documentation, and unit tests have been updated accordingly. There are no review comments to address, and we have no further feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
📝 WalkthroughWalkthroughThe change replaces ChangesLifecycle Flag Consolidation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/a2a3/runtime/host_build_graph/runtime/pto_runtime2_types.h (1)
469-474: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAlign
PTO2TaskLifecycleFlagbits with the parent runtime.To fully satisfy the PR objective of aligning both A2A3 runtime variants, consider adding
PTO2_DISPATCH_PROPAGATED = 1U << 3to this enum. Even if it's currently unused in thehost_build_graphfork, explicitly reserving this bit guarantees exact layout parity withtensormap_and_ringbufferand prevents accidental reuse of the1U << 3bit for a different flag in the future.💡 Proposed change
enum PTO2TaskLifecycleFlag : uint8_t { PTO2_LIFECYCLE_FLAGS_NONE = 0, PTO2_READY_CLAIMED = 1U << 0, PTO2_COMPLETION_DONE = 1U << 1, PTO2_SUBTASK_DEFERRED = 1U << 2, + PTO2_DISPATCH_PROPAGATED = 1U << 3, };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/a2a3/runtime/host_build_graph/runtime/pto_runtime2_types.h` around lines 469 - 474, Add PTO2_DISPATCH_PROPAGATED with value 1U << 3 to PTO2TaskLifecycleFlag, preserving the existing flag values and reserving the bit for layout parity with the parent runtime.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/a2a3/runtime/host_build_graph/runtime/pto_runtime2_types.h`:
- Around line 469-474: Add PTO2_DISPATCH_PROPAGATED with value 1U << 3 to
PTO2TaskLifecycleFlag, preserving the existing flag values and reserving the bit
for layout parity with the parent runtime.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 214314ba-1761-436e-ae2e-b751bfd9611e
📒 Files selected for processing (6)
src/a2a3/runtime/host_build_graph/runtime/pto_runtime2_types.hsrc/a2a3/runtime/host_build_graph/runtime/scheduler/pto_scheduler.hsrc/a2a3/runtime/tensormap_and_ringbuffer/docs/RUNTIME_LOGIC.mdsrc/a2a3/runtime/tensormap_and_ringbuffer/runtime/pto_runtime2_types.hsrc/a2a3/runtime/tensormap_and_ringbuffer/runtime/scheduler/pto_scheduler.htests/ut/cpp/a2a3/test_wiring.cpp
Summary
Related Issues