#1 [high] PR 571 core diff summary
PR 571 (helios: force a wide round after persistent width-one selection), 3 files, +78 -3, no docs.
- helios/src/scheduler/refresh.rs: adds
width1_streak: AtomicU64to RefreshState,force_wide_due()= streak>=2, and incommit()(origin Ordinary) increments streak when step.kind==Speculative && draft_tokens==0, else stores 0 (refresh.rs:33-74). - helios/src/scheduler/policy.rs:1281-1309: after discovery/refresh-funded/acceptance-probe paths, if
self.refresh.force_wide_due()pick fromcandidatesmax by draft_tokens/capacity/packed_token_capacity where kind==Speculative && draft_tokens>0 && batch==ordinary.batch && mask==ordinary.mask; set host_lengths=None; return available_plan(... PlanOrigin::Ordinary). - policy_tests.rs: new test
two_ordinary_width_one_plans_force_a_wide_round(+ helper change completion_records offered_drafts: plan.token_capacity-1 -> lane.tokens-1 at policy_tests.rs:239). Charter: read (Goals/Non-Goals/How We Work) — no flag/model-specific issue; relevant clauses: "#210 performance PRs need benchmarks showing actual speedup over main on a served workload", "#397 bug fixes need root cause not swallow/skip/retry", "smallest footprint / solve without new code", docs maintained as specs. Author admits: not a recovery fix; no A/B; forced plans measured 64.9-66.6ms vs ~5.3ms normal width-8; 30 forced selections in 3 seconds; can fire again; must not merge before #540.
#2 [high] PR 571 concrete code defects
- Forced picker searches ALL candidates (incl. prune_padding's dominated tail) and maximizes draft_tokens, then capacity, then packed_token_capacity (policy.rs:1281-1296). prune_padding (policy.rs:169-202) exists so redundant padding loses; docs/scheduling-runtime-design.md:252-257 "Timing estimates cannot make redundant padding preferable". So for the widest (D,W) it deliberately picks the LARGEST packed P — the most padded, most expensive shape. Author lists this as a "Limit" but it reverses a documented invariant.
- No duration/measured check: packed_round_shapes yields nanos=0 for unmeasured shapes (cost.rs:226-232; 0 ns is the "unmeasured" sentinel per cost.rs:7). Forced path can execute an unmeasured wide graph; commit then relabels it PlanOrigin::Discovery (scheduler.rs:2321-2324), so it is an unbounded-cost discovery round, contradicting "costs at most one normal wide round".
- Bypasses the value metric entirely — contradicts docs/scheduling-theory.md:195 (argmax E[useful]/T) and the project's "one metric for graph selection" section (:78-195).
- Trigger = 2 committed ordinary width-one plans (refresh.rs:53-55, 65-74). No derivation for "2"; fires in healthy cadence-driven width-one selection (#152 shows balanced policy legitimately prefers W1 at B4), 30 firings in 3 s in the author's own trace.
- State placement: width1_streak as AtomicU64 inside RefreshState (refresh.rs:34-39) — no concurrency (scheduler takes &mut self at scheduler.rs:2424), and RefreshState is documented as "timing-refresh and acceptance-learning credit" (docs/scheduling-runtime-design.md:9-12). Wrong module; needless atomic.
- Forced plan returned as PlanOrigin::Ordinary (policy.rs:1304) → prometheus
flare_scheduler_executions_totalcannot distinguish forced rounds, and the round silently earns refresh/acceptance credit (refresh.rs:86-91). docs/scheduling-runtime-design.md:488-490 requires origins to be exposed separately; no new origin/metric. - Claimed "Log the selection as
Forced wide:" is NOT in the diff — search_code for "Forced wide", "Plan diag" returns nothing in helios/src. The evidence trace lines came from a separate prototype image (...argdiag-20261128), so the numbers are not reproducible from this branch. - Streak is only updated on PlanOrigin::Ordinary (refresh.rs:67); probe commits leave it >=2, so a forced round can immediately re-arm after an intervening probe.
- Test coverage: one test (policy_tests.rs:52-82); nothing for no-wide-sibling fallthrough, streak reset, narrower drafter (W2/W4 claim untested), or funded-refresh precedence. Test needed a shared-fixture semantic change: policy_tests.rs:239 offered_drafts (plan.token_capacity-1) -> (lane.tokens-1), which alters inputs of many existing tests (validation requires offered < lane.tokens, scheduler.rs:2539). Positive: only 3 files, +78/-3, no core format/prepared graph changes; generic across widths; leaves prefill/refresh/probe/discovery untouched; degrades to ordinary when no wider sibling exists.
#3 [high] Charter and process requirements PR 571 misses
Charter (read_charter):
- "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210). Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)."
- "Solve the right problem in the right place... smallest footprint in shared code, or solve without new code at all."
- "Be explicit and pin everything. No magic defaults."
- Vision: "keeping generation snappy" for long conversations / coding agents — cadence matters. Repo rules:
- docs/design-review.md:195-208: changes to graph selection, service pricing, timing estimation, refresh/exploration budgets MUST be evaluated against scripts/scheduling_sim/ + 64-seed validation catalog; "Do not diverge Helios from the simulator's qualified policy without updating and validating the rule across that catalog."
- docs/design-review.md:234-240: "Never touch covered code without running and updating its simulator and formal checks... is a blocking design failure, regardless of whether CPU unit tests pass."
- docs/design-review.md:106-115 (principle 12) + :150-160 (PR description four parts, disclose limits).
- docs/scheduling-runtime-design.md:434-490 (funded refresh and acceptance learning) and :467-477 documents the acceptance probe — an existing mechanism that already picks a WIDER-than-ordinary candidate for the same cohort when it beats ordinary optimistically (learning.rs:15-60, gated at policy.rs:1276).
- docs/scheduling-theory.md:539-588 documents a bounded periodic-alternative exploration rule (every sixteenth opportunity) as the sanctioned anti-starvation device. Evidence in PR body: forced rounds 64.9-66.6 ms vs ~5.3 ms normal width-8, 30 forced selections between 18:00:09-18:00:12, no control run, no A/B, self-declared "not a recovery fix", "Do not merge before #540 is resolved", "correct default may be to merge #540 first and re-measure". Related repo evidence that width-one is not established as a bug: #152 (balanced policy prefers W1 at B4; throughput 8% higher without; maintainers asked for cadence measurement, triage:design-review), #503 (v0.3.2 W1 selection 0->36->66% at B8; cause unknown; author asks for scheduler diagnostics). #540 = root-cause prevention (retain bounded refresh credit across idle, exclude readiness wait), open, with simulator 64-seed + TLA+ evidence.
#5 [high] PR 571 update review (c64343b2) — what the revision fixed and what remains
Head c64343b2 ("probe measured wide candidates with bounded backoff"), 7 files, +148/-9: scheduler.rs (+2), scheduler/policy.rs (+31), scheduler/policy_tests.rs (+67/-1), scheduler/refresh.rs (+41/-4), server/dashboard/scheduler.rs (+1), server/metrics.rs (+1/-1), server/metrics/scheduler.rs (+5/-3).
FIXED vs earlier review:
- Picker now scans
candidates[..ordinary_count]= after prune_padding (policy.rs:1283), so the dominated padding tail is excluded; sorts by (capacity, packed_token_capacity) ascending and takes the smallestcapacity >= target(policy.rs:1294-1299) — no longer "widest + most padded". - Requires a positive measured duration:
self.costs.duration_key(...).is_some_and(|d| d > 0)(policy.rs:1289) — unmeasured discovery-cost bypass closed (0 is the unmeasured sentinel, cost.rs:7,226-232). - Own origin:
PlanOrigin::WidthOneProbe->TimingOrigin::WidthOneProbe(scheduler.rs:500,2395), 5th metric bucketwidth_one_probe(metrics.rs:939), array sizes 4->5 (metrics/scheduler.rs:96-97,176-178), dashboard label (dashboard/scheduler.rs:268). So it IS visible in flare_scheduler_executions_total now (docs/scheduling-runtime-design.md:488-490). - No ordinary refresh/acceptance credit:
PlanOrigin::Discovery | PlanOrigin::WidthOneProbe => {}in complete (refresh.rs:116); excluded from is_probe so it never setsactiveand cannot block a refresh/acceptance episode (refresh.rs:25-27,84). - Backoff: force_wide_due = streak >= max(next,2) (refresh.rs:57-60); note_width1_probe sets next=streak+interval, interval=min(2x,64), width=min(2x,8) (refresh.rs:66-73); reset on any ordinary non-width-one plan (refresh.rs:90-95). Probes at streak 2,4,8,16,32,64,... => asymptote one probe per 64 width-one plans.
- Two tests now: two_ordinary_width_one_plans_force_a_wide_round asserts (D=1,W=2) with a measured width-2; width_one_probe_backs_off_after_each_attempt asserts force_at == [2,4,8] (policy_tests.rs:52-118).
STILL OPEN:
- No served A/B vs main (#210), no control run; author states A/B "not practical" and the 64-seed simulator "cannot synthesize" the state. docs/design-review.md:195-206 requires graph-selection changes be validated in scripts/scheduling_sim/ and says "Do not diverge Helios from the simulator's qualified policy without updating and validating the rule across that catalog"; :234-240 calls skipping it a blocking design failure. No simulator run, no TLA+/conformance run reported; only "146 tests with 2 ignored" suite count.
- Duplicates the funded acceptance probe (learning.rs:15-60, gated policy.rs:1276, documented docs/scheduling-runtime-design.md:467-490). The new probe's distinguishing feature is that it fires without credit — i.e. exactly the credit-starvation symptom #540 fixes (idle discards positive credit; docs/scheduling-runtime-design.md:439-440,463-465).
- Unfunded exploration channel: no ledger is charged, so the documented aggregate bounds P <= alpha/(1-alpha)*O + D (runtime-design.md:455-460, 484-485; theory.md:569-574) do not cover it. Amortized cost is bounded (~one wide round per 64 width-one plans, ~1.8% at the captured 5.3ms vs 4.63ms), so risk is small — but the rule is invisible to the budget model the project uses to argue safety.
- Still overrides the value metric: unlike the acceptance probe (learning.rs:41 requires candidate.rate.compare(ordinary.rate).is_gt()), the probe does not require the wider candidate to score above the ordinary winner (policy.rs:1281-1311). Deliberate, but it is the one place selection ignores E[useful]/T (runtime-design.md:3, theory.md:195).
- Magic constants: 2, 64, and
.min(8)hardcode the escalation ceiling/target to width 8 at refresh.rs:70-72 in a model-agnostic runtime; no derivation stated (charter "No magic defaults"; #540 review asked for derivations of 0.88/4.0/2.0/6). - Placement: four AtomicU64 (streak/next/interval/width) live in RefreshState, documented as the credit module (runtime-design.md:9-12); commit is reached with &mut self (scheduler.rs:2426) and note_width1_probe takes &self just to store through atomics.
- Stale (not fresh) measurements are accepted — only duration>0 is checked, not costs.is_fresh(); also the streak survives refresh/discovery probes (
_ => {}, refresh.rs:96). - Tests: no coverage of fall-through when no measured wider sibling exists, reset after a wide round (only implicitly), precedence vs refresh/acceptance, fixed-width mode, or interaction with the ordinary credit ledgers. The shared fixture still changes offered_drafts from plan.token_capacity-1 to lane.tokens-1 (policy_tests.rs:272), altering completion inputs for many existing tests.
- Author's own earlier disposition (comment 2026-11-28 20:21) was to park until #540 lands with a same-base control measurement; the 20:59 revision unparked without #540 landing.
Verdict: not worth merging now — park. Path back: after #540, demonstrate the residual stuck state with a control; then express the escape as a credited, value-priced rule (or reuse the acceptance probe with retained credit), record it in the simulator as the qualified policy and run the 64-seed catalog + TLA+ conformance, and cover point 8. Process: PR discussion holds only automated case-file posts and the author's own comments; no attempt to direct the reviewer.