Recommendation: Changes Requested
Revision 9110228f cleanly resolves the Round 1 code and documentation issues: helios/src/scheduler/rounds.rs de-duplicates ratio clamping into a shared calibration_ratio helper while preserving [0, 1] clamping, monotonic nonincreasing survival, and broken-drafter fallback; docs/scheduling-runtime-design.md now accurately documents the proposal_confidence sidecar contract; and all four --locked --release crate test suites were run cleanly. However, the Round 1 performance-evidence blocker remains unresolved in outcome: the newly added isolated matched A/B against origin/main (0a8c20f4) at the shipped default adaptive_verification_alpha = 1.0 (helios/src/scheduler/policy.rs:40) regresses 5 of 6 workloads (-1.9% to -5.2%) while the motivating draft_tokens = 5 / alpha = 0.75 configuration still has no paired origin/main baseline. Under the Project Charter (#210) and docs/design-review.md Principle 12, a global default-path scheduler change needs a net-positive matched A/B on the default configuration (or a tighter bound that eliminates the moderate-acceptance regression) and confirmed green CI on the final head before merge.
Merge Risk
Level: Medium
- Global default-path blast radius: Changing
calibration_factor_max(depth)from flat2.0to2.0 * 1.75^depth(helios/src/scheduler/rounds.rs:13-15, 24-34) altersDepthCalibrationandRequestCalibrationfor every GPU-confidence speculative core (PrefixAllocation::Gpu) unconditionally at defaultalpha = 1.0. Atd = 4..6, the ceiling rises from2.0to18.76,32.83, and57.45, which allows small-sample upward noise at censored deep depths—and warmed globalDepthCalibrationfactors inherited by newly admitted requests (rounds.rs:89-90, 99-103)—to select wider packed shapes (rounds.rs:765-871) on moderate-acceptance text, matching the observed8K C=32acceptance drop (65.6% -> 59.4%) and-1.9%to-5.2%regressions across 5 of 6 default-config cells. - No structural, ABI, or concurrency hazards: Pure
f64arithmetic on the single-threadedRequestSchedulercompletion/planning path; no Protobuf, manifest, CUDA-graph, lock, or hot-path allocation changes (curves[slot]cachespowered_curveonce per lane inpacked_round_candidatesatrounds.rs:735, 770), and broken-drafter (realized = 0) fallback toW = 1is preserved. - Unverified CI status on
9110228f: Local--locked --releaseCPU crate tests passed, and the branch is rebased onto8da73911(#624), but GitHub Actions CI results (includinghelios-lifecycleTLA+ and Kani jobs in.github/workflows/helios-lifecycle.yml:18-47(not opened)) must be confirmed green on the final head.
Walkthrough
helios/src/scheduler/rounds.rs:13-34, 56-58, 88-111, 286-300, 336-339: IntroducesCALIBRATION_STEP_FACTOR_MAX = 1.75,CALIBRATION_MAX_DEPTH = 30,calibration_factor_max(depth), and sharedcalibration_ratio(realized, predicted, depth), removing the duplicated clamp logic betweenDepthCalibration::factorandRequestCalibration::factorand threadingdepth: usizethrough calibration accessors andRequestCalibration::observe.helios/src/scheduler/policy_tests.rs:6433-6599: Adds two isolated, production-path CPU unit tests:gpu_confidence_calibration_ceiling_scales_per_step_across_depth(verifying2.0,10.71875,15.0unclamped, and18.7578125at depths0,3, and4) andgpu_confidence_multi_step_calibration_escapes_packed_three_trap_and_respects_low_depth_two_survival(verifying a single-laneB = 1, W = 6, alpha = 0.75scheduler moves frompacked_token_capacity = 3to6under[0.95..0.75]survival while staying at3under[0.95, 0.90, 0.05, 0.0, 0.0]).docs/scheduling-runtime-design.md:113-152andhelios/README.md:447-456: Updates GPU-confidence calibration documentation to[0, 2 * 1.75^depth](depthcapped at30) and accurately states thatproposal_confidence[frame, row, d]holds model-agnostic per-step conditional confidences multiplied on the host (rounds.rs:614-616), citing Rényi-2 collision probability only as an example drafter signal.
Pre-merge Checks
- [PASS] Security / malicious screen: Pure
f64bound arithmetic in scheduler calibration with no I/O, unsafe code, external input parsing, or credential/network surface. - [WARN] Charter & value fit: Model-agnostic change in the right layer (
rounds.rs) with small runtime footprint (+24/-16), no per-model branches or flags, and requiredDiscord: el8line—but the isolated matched A/B at shipped defaultalpha = 1.0regresses 5 of 6 workloads, failing the charter's served-workload speedup evidence bar (#210). - [PASS] Related / duplicate / conflict check: Genuinely additive downstream of #515/#522, cleanly rebased over #620/#624, with #633 closed as duplicate and no conflicting open PR touching
helios/src/scheduler/rounds.rs. - [WARN] Tests & verification evidence: Isolated CPU tests and all four
--locked --releasecrate suites pass (1,808 + 245 + 227 + 216passed, 0 failed), andscripts/scheduling_sim/does not model GPU-confidence calibration; however, default-config served evidence is net negative, the motivatingdraft_tokens = 5/alpha = 0.75case lacks anorigin/maincomparator, and CI green status (native-serving,helios-lifecycleTLA+/Kani,python-cpu) on9110228fstill needs confirmation.
Blockers
- Default-configuration served A/B is net negative and the motivating workload remains unpaired (
helios/src/scheduler/rounds.rs:13-15, 24-26,helios/src/scheduler/policy.rs:40):- Verified behavior & impact:
PolicyConfig::default()shipsadaptive_verification_alpha: 1.0(policy.rs:40). In the PR's isolated matched A/B againstorigin/main(0a8c20f4,draft_tokens = 7,alpha = 1.0), 5 of 6 workloads regress:8K C=173.97 -> 70.14 tok/s(-5.2%),C=4156.10 -> 153.20(-1.9%),C=16322.16 -> 313.43(-2.7%),C=32456.31 -> 441.56(-3.2%, draft acceptance65.6% -> 59.4%), and5x Coding Peakmedian102.19 -> 98.09(-4.0%). Only thespec_answersegment of PS4 Tetris HTML/JS gains (135.53 -> 140.32,+3.5%), while overall full-run decode is still lower (116.27 -> 112.59) under single-passtemperature = 1.0sampling. Meanwhile, the motivating configuration from the Problem statement (draft_tokens = 5,W = 6,alpha = 0.75, stuck at2.002offered drafts/round and87.74 tok/s) has no pairedorigin/mainbaseline—everyalpha = 0.75figure in the description is candidate-only on thedraft_tokens = 7core. Becausecalibration_factor_max(depth)reaches18.76atd = 4,32.83atd = 5, and57.45atd = 6, small-sample upward noise at deep censored depths and warmed globalDepthCalibrationfactors can pushpacked_round_candidates(rounds.rs:765-871) into widerpacked_token_capacityshapes on moderate-acceptance text. - Concrete fix (do not add a default-false opt-in flag, per
docs/design-review.mdPrinciple 3):- Tighten the depth-scaling rule so moderate-acceptance workloads at default
alpha = 1.0do not regress (for example, a smaller step factor or a modest reachable absolute cap oncalibration_factor_max, and/or requiring non-trivial request observation weight before scaling above2.0at deep depths). - Re-run matched A/B benchmarks against
origin/mainon (a) the shipped defaultalpha = 1.0matrix (usingtemperature = 0or repeated trials to separate signal from sampling variance) showing neutral-or-better throughput without theC=32acceptance drop, and (b) the motivatingdraft_tokens = 5/alpha = 0.75(or matchedalpha = 0.75) workload on the same core. - Confirm GitHub Actions CI (
native-serving,helios-lifecycleTLA+ & Kani,python-cpu) is green on the final head.
- Tighten the depth-scaling rule so moderate-acceptance workloads at default
- Verified behavior & impact:
Should Fix
- The "conservative per-step shrinkage margin" rationale does not hold for typical drafter confidences (
docs/scheduling-runtime-design.md:127-131):- Verified behavior & impact: Lines
127-131state that2.0 * 1.75^depth"preserves a conservative per-step shrinkage margin against noise (0.5 * 1.75 = 0.875 < 1relative to doubling per step)". For a drafter with per-step confidencec, the maximum permitted calibrated survival isc^(d+1) * 2.0 * 1.75^d = 2c * (1.75 * c)^d, which shrinks with depth only whenc < 1 / 1.75 ≈ 0.5714. For anyc > 0.5714,(1.75 * c)^dgrows with depth and relies solely on[0, 1]clamping and nonincreasing survival (rounds.rs:425). Additionally, the0.5factor is used before the0.5^dpopulation prior is introduced at:133(and"relative to doubling per step"relies on PR revision history against2^(d+1), contrary to.agents/skills/repo-prose/SKILL.md:22-25 (not opened), 71). - Concrete fix: Rewrite
:127-131(matching whatever tightened bound resolves Blocker 1) to state the exact condition without hidden context—e.g. noting that the ceiling shrinks against the0.5^(d+1)population prior (0.5 * 1.75 = 0.875 < 1), holds only for per-step confidencec < 1 / 1.75 ≈ 0.57, and relies on[0, 1]clamping and nonincreasing prefix monotonicity above that threshold.
- Verified behavior & impact: Lines
Subtract / Simplify
- Remove unreachable
CALIBRATION_MAX_DEPTH = 30and its two doc clauses (helios/src/scheduler/rounds.rs:15, 25,docs/scheduling-runtime-design.md:117,helios/README.md:450):Forecasts::calibrationhas lengthcompletion_token_capacity - 1(rounds.rs:312-314), andmanifest.rs:840enforcesgraph.draft_tokens <= completion_token_capacity - 1(DEFAULT_COMPLETION_TOKEN_CAPACITY = 8atmanifest.rs:13, test maxMAX_DRAFT_TOKENS = 15athelios/src/execution/tests.rs:8). Depth30requirescompletion_token_capacity >= 33, and2.0 * 1.75^30 ≈ 3.92e7is neither a realistic calibration bound nor anf64overflow guard (1.75^doverflowsf64neard ≈ 1130). Unless Blocker 1 replaces this with a tight reachable bound, deleteCALIBRATION_MAX_DEPTH(usingdepth.min(i32::MAX as usize) as i32or a real factor cap) and drop the"with depth capped at 30"clauses from both docs.
- Drop the redundant clamp restatement in
docs/scheduling-runtime-design.md:141-142:- The bullet already states at
:114-115that "Both calibration levels clamprealized / predictedto[0.0, calibration_factor_max(depth)]." The trailing, and clamped to calibration_factor_max(depth)in theRequestCalibrationsentence at:141-142now repeats:114-115; end the parenthetical aftermatching PrefixEstimate.
- The bullet already states at
Nits
helios/src/scheduler/policy_tests.rs:6530:vec.verification_width = plan.token_capacity as i64;is already set identically bycompletion_records(policy_tests.rs:207); onlyvec.offered_draftsneeds overriding here.
Dropped on verification
- Correctness F1 (Blocker:
RequestCalibration::observeseeding atrounds.rs:96-109"manufactures evidence" / proposed fixglobal.factor(depth).min(CALIBRATION_FACTOR_MAX)): Dropped as over-flagged with a broken fix. Before first observation (weight == 0.0),RequestCalibration::factoralready returnsglobal.factor(depth)(rounds.rs:89-90), which starts at1.0and only rises from actual completed rounds. Clamping the first-observation seed to2.0would break #522's scale-invariant hierarchical prior (a request seeingglobal.factor(4) = 15.0on round 0 would drop to6.33after its first observation confirms15.0). Atd >= 5,.clamp(0.0, 1.0)caps the seeded ratio downward to20.0, not upward. The real effect—larger global-prior bleed whenglobal.factor(depth)is warmed—is captured accurately in Merge Risk and Blocker 1. - Correctness F2 (Major: inflated curve prices requests up to ~19× cheaper via
service.rs:278-286): Dropped as factually incorrect. Every entry inspeculative_curveis clamped to[0.0, 1.0](rounds.rs:425), soexpected_tokensis strictly bounded in[1.0, width]and can never inflate 9×–19×;submission.expected_tokensis used only for in-flightprojected_service(service.rs:281), whereasobserve_service(service.rs:378-383) credits actualuseful_tokens; and largerdeliveredinServicePrice::observe(utility.rs:62-66) increases decay and lowers in-flight priority rather than rewarding the lane. - Correctness F3 (Major: undeclared shifts in
SurplusHistoryand Hoeffding exploration bonus): Dropped.SurplusHistory(rounds.rs:589-627) intentionally pairs calibrated curves (docs/scheduling-runtime-design.md:162) and appliescal_factors[depth]symmetrically to bothhost_predandactual_calper #515/#522. The Hoeffding claim (rounds.rs:418-421) is mathematically backwards: the Hoeffding radius is an additive probability bound in[0, 1], and a largercalibratedmean pushescalibrated + bonuscloser to1.0(more selection, not suppressed exploration). - Correctness F4 (Major: regressions caused by
prefix_lengths_with_valuesranking atrounds.rs:470-498): Dropped as misattributed and duplicate of Blocker 1. OnPrefixAllocation::Gpushapes,round_lengths_optimisticearly-returnsceilings(rounds.rs:457-459), and the GPU device allocator ranks prefixes on-device; host shape selection occurs inpacked_round_candidates(rounds.rs:765-871), which is already addressed in Blocker 1. - Correctness F7 (Minor:
0.5^dvs0.5^(d+1)indocs/scheduling-runtime-design.md:133): Dropped as pre-existing wording onmainthat was only re-wrapped in this diff. - Correctness F8 (Minor: add
Forecasts::new(64)test for unreachableCALIBRATION_MAX_DEPTH = 30): Dropped in favor of Subtract/Simplify #1 (deleting the inert constant rather than adding a synthetic test for it). - Correctness F9 (Minor: "
powitranscendental in per-shape × lane inner loop"): Dropped as factually incorrect.f64::powiis integer exponentiation by squaring (0–3 multiplies ford = 0..6), not a transcendental, andpacked_round_candidatescachespowered_curveonce per lane viacurves[slot](rounds.rs:735, 770), not per shape × lane. - Subtraction F2 (merge
single_lane_packed_calibration_engineintosingle_lane_packed_engine): Dropped. Verifiedpolicy_tests.rs:4300-4313vs:6453-6515: the two builders configure different graph catalogs (speculative = trueretaining default speculative graphs at10 * MSvsspeculative = falsefiltering speculative graphs and adding explicitd0-w1+ 5 timed packed shapes), so unifying them would over-parameterize the 14-line helper. - Subtraction F3(b) (
s.refresh.acceptance_credit_ns = 0.0; s.refresh.credit_ns = 0.0;atpolicy_tests.rs:6551-6552claimed to be no-ops): Dropped as false.ready()(policy_tests.rs:262-273) runs Ordinary prefill steps viastep(), which callsRefreshState::complete(refresh.rs:71-78) and accrues non-zerocredit_nsandacceptance_credit_ns;:6580and:6595are likewise load-bearing after theCREDIT_CAP_NSprobe loops. - Subtraction F3(c) (delete
15.0unclamped depth-4 case andclampedForecastsatpolicy_tests.rs:6435-6450): Dropped. The15.0case discriminates againstmain's flat2.0ceiling and verifies unclamped pass-through below the18.7578125ceiling (preventing a regression where the factor always saturates to the ceiling).