Docs: state the launched invariant in simpler_finalize_run - #1745
Conversation
Fixes #1742 `launched` decides whether the run is drained, whether its rc is the run's result, whether its runtime keeps its GM/SM pointer, and what the function returns — but nothing said what it means, so each reader had to re-derive it from the launch path. State it where it is defined: the launch transaction hands back an ActiveExecution only once it has reached the device, and returns the PreparedExecution instead when it never started, so a null one is exactly a run that never touched a stream. Both the onboard and sim copies carry the same comment because both hold the same invariant. Comment only; no behavior change. Verified: 91/91 cpp UT (ctest -LE requires_hardware); 1277 passed / 13 skipped py UT; a2a3 onboard sweep 54 passed plus 24 passed / 2 skipped in the resource phase.
|
Warning Review limit reached
Next review available in: 24 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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 |
Fixes #1742.
What the issue asked for
launchedinsimpler_finalize_runwas redefined fromphase != NativeRunPhase::Preparedtostate->active_execution != nullptrby #1694, and the invariant behind it was never written down — not in a comment, not in either #1694's or #1725's commit message. The new definition is correct; the problem is that a future regression on this path has nothing togit bisectback to, and the next reader has to re-derive it.What the invariant actually is
I traced it rather than paraphrasing the issue.
launch_executionpopulatesactiveonly when the transaction reached the device:So a null
active_executionis exactly a run that never touched a stream — which is why it should take the-1/set_gm_sm_ptr(nullptr)path rather than being treated as launched. The sim runner has the same rule (device_runner.cpp:494-496), so both copies get the same comment.The change
A comment at the definition in both
c_api_shared.cppvariants, stating the present-tense fact percomments.md— no reference to #1694 or to the edit that produced it, since that belongs in the commit message and not the code.Comment only. No behavior change; the diff is 12 added lines, zero modified.
Validation
Comment-only, so this is really just proving nothing else moved:
ctest -LE requires_hardware)tests/ut/pygit diff --statis+12 / -0across the two files — pure addition, no reformatting churn