#1 [high] Research summary
Correctness, Contracts & System-Level Consequences — PR #644
I read the full diff plus head code for utility.rs, service.rs, policy.rs, rounds.rs, speculation.rs, scheduler.rs (completion path), policy_tests.rs, scripts/scheduling_sim/utility.py, helios/README.md and docs/scheduling-runtime-design.md.
The arithmetic is sound. I re-derived σ_i = (K−b)T/b against service.rs:59-161, the excluded-only age cancellation in decode_within (utility.rs:101-119) against the common −T/2·Σc subtraction in ValueRate::new (utility.rs:142-152, summed at policy.rs:493), and the rewritten exact-Bellman identity (utility.rs:338-383). With σ=0, s=1, preceding=0 the score reduces to v/T + g + c·A. No arithmetic contradiction with the PR text, no ABI/proto/core-format file touched, no new allocation on the plan hot path beyond pre-existing per-round Vecs. The calibration data path is correct too: per-row row_realized ascending depths, prev_realized seeded at 1.0 and advanced outside the skip branch, and the inheritance loop prefers local over global at each shallower depth as documented.
Findings (all verified at head):
-
Blocker/Major — contract docs left contradictory, in the exact sentence another open PR fixes.
helios/README.md:446-450still reads "scaled by a request-local aged per-depth verification calibration ratio … clamped to[0, 2]", whilerounds.rs:13isCALIBRATION_FACTOR_MAX: f64 = 4.0and the priced quantity is now a cumulative product of per-step factors. The PR edits only the calibration section ofdocs/scheduling-runtime-design.md. Fix: update this sentence in the same PR. -
Major — delivery accounting is still documented as one-delivery-per-burst.
docs/scheduling-runtime-design.md:527-538still says "replaces that interval's delivery update with one served delivery" and "initializes a missing delivery history to one delivery over its measured frame duration"; at head it isprice.observe(duration_ms, duration_ms, 1.0, …)(service.rs:47-52) andServicePrice::initial(1.0)(service.rs:424). The diff hunk starts at line ~110, so this section is untouched. Fix: amend §"Completion initially records zero deliveries". -
Major — the
finishchange is under-described and reprices terminal retirement under--scheduler-policy throughputtoo.utility.rs:121-130now charges the full horizon andcompletion_msis used only by adebug_assert;PolicyConfig::throughput()(policy.rs:49) zeroes onlydelivery_fairness/decode_age_priceand leavesterminal_age_price = 1.0(policy.rs:36). PR text says only "updatedLaneValue::finish". Fix: state the semantic change and confirm the intent for the throughput policy. -
Major — global default change with no opt-in, and two config knobs silently change dimension. The age/delivery half runs for every core shape and both policies (only calibration is
gpu_confidence()-gated,rounds.rs:472-474);delivery_fairness/decode_age_pricekeep their names and defaults (policy.rs:33-34) while measuring a dimensionless served share instead of a burst rate. Anyone who tuned them viaconfigure_policy/CLI gets the same numbers with different units. Charter: "Be explicit… no magic defaults". -
Major — undocumented derivations.
CALIBRATION_FACTOR_MAX = 4.0(rounds.rs:13), the flat0.5priorvec, and the round weightclamp(sum_w / count as f64, 0.0, 1.0)(rounds.rs:701-706, divisor is the lane count, so a depth whose survival-weighted samples averagewlearnsα ≈ w/weight— depth 3 atw≈0.15learns ~7× slower than depth 0) are all unjustified in code or docs. This is the identical gap #632 was twice asked to close. -
Minor — the unweighted estimator is now test-only, and the existing bleed test no longer exercises the production path.
rounds.rs:353-356gatesobserve_calibrationbehind#[cfg(test)];policy_tests.rs:5420,5436still call it (weight 1.0), sogpu_confidence_calibration_is_per_request_and_resists_cross_workload_bleedvalidates a path production never runs. -
Minor — the documented tie-break rarely fires.
service.rs:107prefers a larger served batch only on exact float equality (cost == best[slot].0); with distinct measured durations the "breaking ties toward larger served batch" rule is effectively inert. -
Evidence gaps (charter #210). No same-core
mainbaseline for the headline 76.11 tok/s (compared tothroughputon the same new core);greedy_code70.30→75.98 is on a different core; the DFly2 "+24.2%" compares against forcedP=6, notmain. The simulator does not model GPU-confidence calibration, so the 786 pytest results cover only the age/delivery half, and the fairness tests use hand-set synthetic costs. B=4 uncontended and K>4 oversubscribed — the exact regimes the retention-fairness change targets — are acknowledged as unbenchmarked. -
For the adjudicator: issue #152 (open, filed a month earlier) is the prior field report of this defect, names the same two knobs, and its maintainer triage asked for inter-token/cadence evidence that this PR does not supply. #632 (open) is a competing fix in the same file for the same symptom, and #645 (same author, one minute later) reuses
policy.rs/service.rs/LaneValuewith the old burst-ratez_ssvariable — whichever lands second must be re-derived. No cross-reference exists in the PR body for #152, #632, or #645.
#2 [high] Docs left contradictory: helios/README.md calibration clamp [0,2] vs 4.0
FINDING (Major): helios/README.md:446-450 is NOT touched by PR #644 and still documents the superseded model:
"stored per-depth forecasts are scaled by a request-local aged per-depth verification calibration ratio (seeded scale-invariantly with prior weight 2 from a once-per-round population prior capped at weight 64, 128-token half-life, request EWMA cap 32, clamped to [0, 2])"
Head reality:
helios/src/scheduler/rounds.rs:13:const CALIBRATION_FACTOR_MAX: f64 = 4.0;helios/src/scheduler/rounds.rs:451-455inspeculative_curve:cumulative_factor *= forecast.calibration_factor(depth, &self.forecasts.calibration); let calibrated = estimate.mean() * cumulative_factor;— a cumulative PRODUCT of per-step factors, not a per-depth ratio.
So README says per-depth ratio clamped 2.0; code does per-step factors clamped 4.0 multiplied cumulatively across 0..=depth. Note #632 (open, competing) DOES update helios/README.md (+3/-2) for exactly this sentence; #644 omits it.
Fix: update this sentence in #644 (per-step conditional factors, cumulative product, clamp 4.0, unobserved-deeper inheritance).
Also: docs/scheduling-runtime-design.md sections still describing the old model and untouched by the diff (gradient g/z at :203-210, sigma_i = K*T/min(batch_capacity,K) at :233-246, terminal H-t savings at :378-383, one-delivery accounting at :527-538, delivery_fairness "value/ms" at :645). New model lives in docs/scheduling-utility.md:28-41,60-68,212-231,252-257,276-298.
#3 [high] docs/scheduling-runtime-design.md:527-538 still says one delivery per burst
FINDING (Major): docs/scheduling-runtime-design.md:527-538 verbatim at head:
"Completion initially records zero deliveries. The first successful visible publication for the same fence replaces that interval's delivery update with one served delivery; subsequent tokens in the burst do not change the count. ... A first published burst initializes a missing delivery history to one delivery over its measured frame duration."
Code at head contradicts it:
helios/src/scheduler/service.rs:43-55ServiceAccounting::publish:price.observe(observation.duration_ms, observation.duration_ms, 1.0, adaptation_ms);— delivered = duration_ms, maximum_rate = 1.0 (served-time share), NOT 1.0 against 1/T.helios/src/scheduler/service.rs:411-426observe_service:price.observe(duration_ms, 0.0, 1.0, adaptation_ms);and the init pathbefore: ServicePrice::initial(1.0)(wasServicePrice::initial(rate)withrate = 1.0 / duration_ms).
The diff's hunk for this file starts around line 110, so §"Completion initially records zero deliveries" was never revised. Fix: amend it to describe served-time share (delivered = duration_ms, normalizer 1, init share 1.0) as docs/scheduling-utility.md:87-105 now does.