gap-ratio: gate demand inflation to the bootstrap window - #38
gap-ratio: gate demand inflation to the bootstrap window#38TianyeGGBond wants to merge 1 commit into
Conversation
The has_pending inflation double-counted demand for a rollout that was still open but already reporting progress, since the rollout_open_pipelines entry survives until release/clear_progress. Gate it on the no-progress (bootstrap) condition so actively-progressing rollouts are not double-counted and gap-ratio fairness holds (rlops#36). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
JunzheJoe
left a comment
There was a problem hiding this comment.
Verified against the semantics confirmed in #36 — capture-before-overwrite is correct, bootstrap path unchanged, double-count on actively-progressing rollouts removed. LGTM (filed the original finding as S12-INFLATE-WINDOW in the F1-F12 review).
|
This gate starves a pipeline whose progress reports are already complete but which has just enqueued a new generation request. With That state is reachable: Gating on |
Context
Fixes #36 (S12-INFLATE-WINDOW from the F1-F12 scheduler review).
In
plan_generation_gap_ratio, the demand-inflation branch:was meant to fire only during the bootstrap window ("request sent, no
progress yet"). But its condition only checks
rollout_open_pipelinesmembership, and that entry survives until release /
clear_progress. Sowhile a rollout is actively progressing (
step_target > 0), the branchstill fires and demand is double-counted (
remaining = actual_remaining + step_target,percent_remaining > 1), skewing gap-ratio toward whicheverpipeline happens to hold an entry when the other doesn't.
Not a hang — allocation-fairness drift.
Change
scheduler/planner.py:in_bootstrap_window = step_target <= 0.0before the estimatebranch overwrites
step_target.has_pending and in_bootstrap_windowso it onlyapplies when no progress has been reported yet.
The bootstrap path is byte-for-byte unchanged; only the erroneous
firing on an actively-progressing rollout is removed.
Net: +5 / -3 lines.
🤖 Generated with Claude Code