PR #632: helios/scheduler: scale GPU prefix calibration ceiling per step across depth

Raw Markdown for agents: https://autobot.eidonix.com/api/v1/cases/c72e138d-80b0-4f9e-893c-a13b619c6fc8

Opened by a workflow run, Nov 30, 2026 3:42 AM EST. decide malicious: all_clear (100%): No malicious content found

explore

Author: original-el8 (COLLABORATOR; charter-named priority contributor; Discord: el8) Motivation: GPU-confidence speculative pricing clamps the realized/predicted calibration ratio to a flat 2.0 at every draft depth, but the value being clamped is a product over depth+1 steps, so a small per-step underprediction compounds and gets truncated. That keeps packed selection stuck at 2 drafts/round on high-acceptance workloads. Scale: +216 / −33 lines in 4 files Proposal:

Full report · Notes

Value Proposition

Value Proposition: PR #632 — helios/scheduler: scale GPU prefix calibration ceiling per step across depth

Charter alignment — good. The change lives in shared scheduler code (helios/src/scheduler/rounds.rs, +15/−10) as a depth-indexed numeric bound: a new calibration_factor_max(depth) helper plus depth threaded through six functions. It adds no model branch, alias, flag, config key, dependency, or ABI/Protobuf change, so it respects "keep the runtime small and model-agnostic" and the recipe/runtime split; the diff contains no per-model special case. The description carries all four required parts (why, what changed, claimed result, evidence) plus the required Discord: el8 line. It cites no issue and is not a roadmap item, but it targets a specific, reproducible scheduler-selection pathology rather than a hypothetical user.

Novelty & status — genuinely additive; not superseded, not obsolete. The flat CALIBRATION_FACTOR_MAX = 2.0 is only five days old, introduced by #515 (commit 1e78f080) and reshaped by #522 (e30d55db). No open PR proposes a depth-scaled ceiling, #632 rebases cleanly over the interim rounds.rs commits (#555 c9693765, #620 c146d7be), and nothing it does is already fixed on main. The author's earlier #521 was superseded by #522, but #632 is their first non-duplicative attempt in this subsystem — and they are a charter-named priority contributor whose PRs are not to be closed out of hand.

Value vs maintenance cost — plausible mechanism, weak evidence, undeclared behaviour changes. The mechanism is coherent: a flat cap on a d+1-step cumulative product truncates deeper ratios. The strongest evidence is interior to the PR — the behavioural test's > 8.0 assertion at policy_tests.rs:6564 is unreachable under flat 2.0, so it genuinely discriminates old from new (capacity 3 → 6 at high survival, 3 retained at low). But that is CPU simulation on a synthesized engine. The headline 87.74 → 118.23 tok/s is explicitly not a clean A/B (it also changes draft_tokens 5/W=6 → 7 adaptive), the same block with the same scope note appears in sibling #633, and the PR self-labels isolated single-PR TP4 serving as not run — so it does not meet "performance PRs need benchmarks showing an actual speedup over main."

Three consequences are not declared and expand the maintenance surface: (a) at depth ≥ 4 the ceiling × the 0.5^(d+1) prior equals exactly 1.0, so the estimator becomes effectively unbounded rather than "still bounded"; (b) RequestCalibration::observe's first-observation seed saturates, pricing brand-new requests at realized = 1.0 at depth ≥ 4 with no test for request birth; (c) the depth-scaled factors feed host_pred/actual_cal into SurplusHistory, shifting B ≥ 2 packed pricing. The PR's own alpha = 0.75 regression (accept 59.7–62.2% → 49.4–51.8%, more verification rows) is honest but buried outside the claimed-benefit summary. CI is red on the head commit and the description does not disclose it.

Verdict: Worth it with changes. Right layer, right mechanism, no supersession. Because it changes the semantics of a bound asserted in #515's Theorem 2, it needs: calibration-owner sign-off (voipmonitor); a disclosed CI failure cause or green CI; an isolated main-vs-branch served A/B at matched draft_tokens; and explicit declaration of the depth ≥ 4 saturation, seed-optimism and SurplusHistory effects, with a request-birth-at-depth ≥ 4 test.

Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.

Classify intake

Selected: triage:review, performance, area:scheduling

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +triage:review, +performance, +area:scheduling

Subtraction and simplicity

Verdict: PR #632's production diff is already lean — +15/−10 in rounds.rs, one 4-line helper plus required depth threading through six functions, no knob/env/config/ABI change, no dead code, no missed call site. Three targeted cleanups, one doc cut.

  1. S1 rounds.rs:15-18 — i32::try_from(depth.saturating_add(1)).unwrap_or(30).min(30) has a redundant fallback (both arms yield 30); CALIBRATION_FACTOR_MAX.powi(depth.min(29) as i32 + 1) is total and identical. The fn also sits between consts (:13 const, :15 fn, :19 const); move it below :25.

  2. S2 rounds.rs:47-53 vs :83-91 — the identical six-line ratio clamp (if predicted > 1e-6 { … .clamp(0.0, calibration_factor_max(depth)) } else { 1.0 }) is written twice, and this PR edits both copies. Extract calibration_ratio(realized, predicted, depth); net −4 lines, one definition of the ceiling and the 1e-6 epsilon.

  3. S3 policy_tests.rs:6449-6511 — the new 90-line fixture near-duplicates single_lane_packed_engine (:4300-4313) and repeats six near-identical 13-field GraphDescriptor literals. Parameterise the existing helper, or at minimum use the builder-closure idiom already present at cost.rs:369-383 (38 literal lines → ~15).

  4. Nits — policy_tests.rs:6553 re-zeroes acceptance_credit_ns set at :6547 with only a plan() between (confirm plan() doesn't write it first); :6523-6527 re-derives offered_drafts that packed_completion_records (:4315-4323) also sets, but the expressions differ, so this is "consolidate", not "replace".

  5. Low, docs — helios/README.md:446-452 has a 6.5-line parenthetical inside a 3-line sentence duplicating docs/scheduling-runtime-design.md:113-123; keep README at clamped to [0, 2^(depth + 1)]).

Correctly absent: SURPLUS_FACTOR_MAX = 2.0 (rounds.rs:25) is rightly left flat and must not be unified with this ceiling. No clippy allowance needed (observe has 6 args).

Open: is the depth ≥ 4 saturation (prior × ceiling = 1.0) intended — a Correctness-lens question, not a deletion; does plan() mutate acceptance_credit_ns; and what the red CI failure actually is (unreadable from the PR, so S3(A) might be forced by a formatting/lint fix).

Full report · Notes

Correctness and contracts

PR #632 widens the GPU-confidence calibration ceiling to 2^(depth+1); I verified the arithmetic is internally consistent and hazard-free (panic-free helper, no cfg/platform divergence, no lock/alloc/I/O, [0,1] clamp and running-min monotone bound untouched, depth plumbing complete, no proto/ABI change), but the effect is far larger than the diff and than the description states.

Findings, most important first:

  1. Blocker — the new ceiling is exactly the population prior's complement: prior 0.5^(d+1) (rounds.rs:309-311) × ceiling 2^(d+1) (rounds.rs:15-18) = 1.0 at every depth, so the upper clamp is inoperative and the factor is effectively unbounded, reversing #515's Theorem 2 while the text claims it "keeps CALIBRATION_FACTOR_MAX = 2.0 as the per-step ratio bound".
  2. Blocker — request-birth seeding saturates: (anchor * global.factor(depth)).clamp(0.0, 1.0) with anchor = 0.05 (rounds.rs:22, 99) yields realized = 1.0 at depth ≥ 2, and seed weight 3 (rounds.rs:100-104) makes one failed round only reach 0.667. No test covers birth at depth ≥ 2.
  3. Major — the reach is not shape selection only: the same curve sets each request's priced token_rate (service.rs:209-216 → :150-160, :327-337) and both inputs of SurplusHistory (rounds.rs:593-623), so fairness ordering and B ≥ 2 surplus pricing shift, with no config key and no test.
  4. Major — saturation pins the calibrated curve at 1.0 for all depths (rounds.rs:412-424), i.e. full acceptance at maximum width, which is what generates the extra verification rows the PR itself measures (accept rate 59.7–62.2% → 49.4–51.8%).
  5. Major — the unchanged Hoeffding bonus (rounds.rs:415-421) becomes inert against a saturated calibrated, so optimistic_tokens (learning.rs:12) collapses onto the conservative curve and probing stops exploring.
  6. Major — the Rényi-2 premise exists only in this PR's own doc lines; helios/model-contract.md:218-225 specifies shape only, and the added prose both claims a "2.0 per-step ratio bound" and "without truncating deeper prefixes".
  7. Major — charter #210 unmet (no isolated served A/B; headline 87.74 → 118.23 tok/s also changes draft_tokens), and red CI on the head commit is undisclosed.
  8. Minor — test comment at policy_tests.rs:6439-6441 attributes the 99.0 clamp to depth 4 when the observation is at depth 3; out-of-range depth falls back to identity factor 1.0 (rounds.rs:283-285).

Open: the CI failure cause (no log access); whether depth ≥ 4 saturation and the birth-seed change are intended; whether #503/#530 are considered related.

Full report · Notes

Final review

Recommendation: Changes Requested

The production code change in helios/src/scheduler/rounds.rs (+15/−10) is small, mathematically coherent, and preserves [0.0, 1.0] probability clamping, monotonic non-increasing prefix survival, broken-drafter W=1 fallback, and core/ABI compatibility. However, the PR cannot be merged as-is because CI on head 64c7198 is red and undisclosed while mandatory scheduler verification gates (--release crate tests, TLA+ lifecycle conformance, and Kani) were not run, the performance claim lacks an isolated main-vs-PR served A/B at matched draft_tokens (and at default adaptive_verification_alpha = 1.0), and the new documentation inaccurately describes proposal_confidence as storing cumulative Rényi-2 products rather than per-step conditional confidences multiplied on the host.

Merge Risk

Level: Medium

Walkthrough

Pre-merge Checks

Blockers

  1. Undisclosed failing CI and skipped mandatory scheduler verification gates (helios/src/scheduler/rounds.rs, docs/design-review.md:180-251).
    • Verified behavior/impact: CI is failed on head commit 64c7198 and not disclosed in the PR description. Under docs/design-review.md:180-251 (Testing Hierarchy Layers 1 and 3, matching .github/workflows/native-serving.yml (not opened) and .github/workflows/helios-lifecycle.yml (not opened)), modifying helios/src/scheduler/ requires running full --release crate tests (cargo test --locked --release on helios --features runtime-core,server, flare, flare-cli, and heliopause — "cargo check does not substitute for cargo test") plus python3 verification/helios-lifecycle/check.py (not opened) and cargo kani --manifest-path helios/Cargo.toml (not opened) --features runtime-core --lib. The PR currently reports only debug-mode filtered scheduler:: tests and cargo check on flare-cli.
    • Fix: Diagnose and fix (or explicitly account for, if an external runner issue) the red CI check on 64c7198, run the required --release crate test suites and helios-lifecycle / cargo kani verification gates, and record the exact results in the PR description.

Should Fix

  1. Provide an isolated main-vs-PR served A/B at matched draft_tokens and default adaptive_verification_alpha = 1.0 (docs/design-review.md Principle 12, Charter #210).
    • Verified behavior/impact: Every GPU serving measurement in the PR is from a combined SM121/RoCE/recipe/scheduler stack (identical block copied to sibling PR #633), and the headline long-form comparison (87.74 vs 118.23 tok/s) also changes draft_tokens (5/W=6 vs 7/W=8). Moreover, the served run uses adaptive_verification_alpha = 0.75 rather than default 1.0 (docs/scheduling-runtime-design.md:75), and its own 8K C=16 / C=32 note reports lower acceptance (49.4%–51.8% vs 59.7%–62.2%) and extra packed verification rows on low-acceptance prose without reporting the matched baseline C=16 / C=32 throughput.
    • Fix: Run an isolated main-vs-PR flare run A/B on one GPU-confidence core with draft_tokens held fixed, covering both high-acceptance generation (demonstrating the packed-width recovery) and high-concurrency/low-acceptance decode (C=16/C=32) at default alpha = 1.0 (and alpha = 0.75 if retained), with matched baseline numbers for every reported cell.
  2. Correct the inaccurate sidecar format description in docs/scheduling-runtime-design.md:117-123 and helios/README.md:450-452.
    • Verified behavior/impact: docs/scheduling-runtime-design.md:117-119 states that "the GPU confidence sidecar at 0-based depth (d) records the cumulative Rényi-2 collision survival prod_{j=0..d} sum_i q_{j,i}^2 across d + 1 draft steps" (and helios/README.md:451-452 repeats this). That contradicts both the runtime implementation and contract: proposal_confidence[frame, row, d] carries per-step conditional confidence values, which the host multiplies into cumulative prefix survival (prefix *= confidence[row][depth]) in helios/src/scheduler/rounds.rs:609-613 and the device multiplies in FP64 per helios/model-contract.md:218-221. Additionally, helios/model-contract.md:218-231 is model-agnostic and does not mandate Rényi-2 collision probabilities as the sidecar contract; multiplicative c^(d+1) compounding follows for any per-step conditional confidence multiplied across d + 1 steps.
    • Fix: Update docs/scheduling-runtime-design.md:117-123 to state that the host multiplies per-step conditional sidecar confidences into the (depth + 1)-step cumulative prefix survival product (optionally mentioning Rényi-2 collision probability only as a concrete recipe example rather than the wire contract), and update helios/README.md:449-452 accordingly.

Subtract / Simplify

  1. Simplify calibration_factor_max and move it below the const block (helios/src/scheduler/rounds.rs:13-25).
    • calibration_factor_max splits the contiguous const block between lines 13 and 19, and i32::try_from(depth.saturating_add(1)).unwrap_or(30).min(30) carries redundant overflow/fallback conversions. Move the helper below SURPLUS_FACTOR_MAX (:25) and simplify to CALIBRATION_FACTOR_MAX.powi(depth.min(29) as i32 + 1) (optionally naming const CALIBRATION_FACTOR_MAX_STEPS: usize = 30;), which is total, panic-free, and identical for every usize.
  2. Deduplicate the ratio-clamp expression shared by DepthCalibration::factor and RequestCalibration::factor (helios/src/scheduler/rounds.rs:47-53, 83-91).
    • Both methods contain the identical if self.predicted > 1e-6 { (self.realized / self.predicted).clamp(0.0, calibration_factor_max(depth)) } else { 1.0 } block edited in both sites by this PR. Extract a single calibration_ratio(realized: f64, predicted: f64, depth: usize) -> f64 helper so the 1e-6 epsilon and depth ceiling have one definition.
  3. Trim the 6.5-line parenthetical in helios/README.md:447-452.
    • Shorten the README summary clause to clamped to `[0, 2^(depth + 1)]` with `depth + 1` capped at `30`) and leave the multiplicative compounding derivation in docs/scheduling-runtime-design.md.

Nits

Dropped on verification

Full report

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with. decide malicious: all_clear (100%): No malicious content found