Explore scratchpad · NVIDIA/hyperflare-inference #540

Raw Markdown for agents: https://autobot.eidonix.com/p/4d8396a2-02a4-48f4-ae37-a16b6d526353.md

#1 [high] Change: shape and size of PR #540

PR #540 "helios: cost-refresh recovery, prompt+output SAM copy-drafts, and calibrated wide copy-verify" by FujitsuPolycom. Open, ready for review, opened and updated 2026-11-26, base main, head 7ca5430c. 25 files +3965/-119. No comments at all (pr_comments returns empty), no reviews, no CI checks on head.

Four commits atop main 33ab6df5:

Files (pr_files): docs/scheduling-runtime-design.md +31/-23; heliopause/src/python.rs +14/-3; helios/src/execution/manifest.rs +7/-2; execution/tests.rs; model/catalog.rs +13; model/packing.rs; model/testing.rs; model/tests.rs +324; runtime_core/selection.rs +109/-12; runtime_core/serving.rs +7; scheduler.rs +180/-9; scheduler/checkpoints.rs; scheduler/cost.rs +120; scheduler/decoded_history.rs +13; scheduler/policy.rs +119/-14; scheduler/policy_tests.rs +501; scheduler/refresh.rs +17/-9; scheduler/rounds.rs +194/-12; scheduler/sam.rs added +1606; scheduler/speculation.rs +103; scheduler/speculative_lifecycle_tests.rs; scheduler/tests.rs +583; server/runtime.rs +6/-2; server/runtime/phase_tests.rs; ignition/preparation/execution.py +10/-1.

#2 [high] Change: what the four commits actually do (plain terms)

  1. Cost-refresh recovery (a85be397). helios/src/scheduler/refresh.rs: RefreshState::idle() is now an empty body (previously clamped both credit ledgers to <=0) and the clamping moved into abort() (refresh.rs:96-105 in the diff). helios/src/scheduler/cost.rs adds observed_compute_duration_ns (observed duration minus ReadinessIntervals::wait_ns()) and timing_refresh_duration_ns (compute duration, else wall_ns fallback); ordinary income and timing-refresh episode charges use these, acceptance learning keeps raw physical duration (refresh.rs complete()). ActionCosts::refresh_order changed from u64 to (bool, u64): tier 0 = never attempted since becoming stale (last_attempt_ns < observed_at + ttl), tier 1 = attempted while stale, keyed by oldest attempt.
  2. Per-request Suffix Automaton (83ff9ed6). New helios/src/scheduler/sam.rs (1607 lines): PromptSAM (immutable, compacted flat edge table, build/build_capped, DEFAULT_MAX_PROMPT_TOKENS = 131_072), OutputSAM (dynamic, Link-Cut Tree over suffix-link tree, sam.rs:564-735, keeps max_endpos exact and gives recency tie-break), PromptOutputSAM (Arc + lazy OutputSAM seeded with DEFAULT_BOUNDARY_OVERLAP = 512 prompt tokens, 1-token lag, DEFAULT_MAX_OUTPUT_TOKENS = 131_072, DEFAULT_MIN_MATCH_LEN = 6). Wired in scheduler.rs:1852 sam: Option<sam::PromptOutputSAM> created at admission only when self.decoded_history.is_some() (i.e. history drafts enabled); push_token on commit paths (scheduler.rs:1231-1237 and ~3013); RequestScheduler::request_history_proposal[_with_match_len] (scheduler.rs:1099-1163) prefers the SAM unless the shared DecodedHistory ring has a strictly longer match; request_copy_match_stats (pub(crate)) for the wide-copy gate. Model packing and server runtime switched from history_proposal(live.tokens(), ..) to request_history_proposal(handle, ..) (model/packing.rs:399-405, server/runtime.rs:2145).
  3. Cost-calibrated wide copy-verify (35ab143a). Adds per-graph draft_source: Option<ProposalSource> to GraphDescriptor (execution/manifest.rs:188-193), validated (manifest.rs:839-851), read from proto (runtime_core/serving.rs:58-63) and from the Python manifest (heliopause/src/python.rs:225-237), declared by recipes via GraphSignature.draft_source (ignition/preparation/execution.py:32, 102-108, 315-319). selection.rs retains optional draft_source=2 graphs only when proposal source is mtp + history drafts + adaptive (retain_wide_copy, selection.rs:182-184, 277-298) and narrows speculative_widths back to source widths otherwise (selection.rs:379-393). New speculation::CopyCalibration (aged per-depth survival + per-step rate, prior WIDE_COPY_PRIOR_RATE = 0.88, speculation.rs:98-190), rounds.rs wide_copy_curve/expected_copy_tokens, and a wide-copy candidate builder inside packed_round_candidates (rounds.rs:749-900) that is gated on decoded_history present, adaptive width, shape.drafts > base_mtp_drafts, request.copy_allowed(), match_len >= WIDE_COPY_MIN_MATCH_LEN (6), copy_len >= base_mtp_drafts + 3. Copy-only rounds are excluded from host/gpu MTP acceptance learning (copy_only_step in scheduler.rs:2795-2801, 2860-2875) and from the MTP packed duration table (cost.rs:189-202).
  4. Padding dominance + threshold (7ca5430c). policy.rs dominates_padding_with gains a branch for strict batch-width domination with equal (capacity, draft_tokens) and smaller.packed_token_capacity >= min(sum lane ceilings, larger.packed); prune_padding adds a whole-list pass marking any GPU-allocated ragged speculative candidate dominated when a strictly narrower batch (>= active lanes) with the same (capacity, drafts) offers at least min(lane ceilings, own packed) (policy.rs:221-254). Candidate gains an expected field (zero-duration useful value) used only for RefreshStart ranking (compare_refresh, policy.rs:1265-1332, 1413-1425). DEFAULT_MIN_MATCH_LEN 3 -> 6 (sam.rs:22).

#3 [high] Undeclared gap: heliopause export overwrites draft_source with MTP

heliopause/src/export/binding.rs:196-202 (unchanged by this PR, identical on main, confirmed by reading the file at ref main): for every graph whose kind is "speculative" (or mixed with speculation_enabled) the export path does graph.insert("draft_source".into(), "MTP".into()) unconditionally. That JSON is what becomes the wire Execution via message("Execution", &value) (binding.rs:390-395) — the JSON->protobuf transcode will not fail on the mismatch because it is a string enum, but the declared copy source is lost.

Consequence (connection): ignition/preparation/execution.py:316-319 is the only place that emits draft_source = 2 (from GraphSignature.draft_source), and heliopause/src/python.rs:225-233 is the only consumer of that dict — but the dict consumed by python.rs is the one built by PreparedExecution.manifest()/export_manifest() in ignition, whereas the dict that becomes the core's wire metadata goes through RuntimeCore.write -> export_capture -> binding::execution (ignition/preparation/runtime_core.py:108-140, capture.rs:3157-3160). Those are two different paths; only the second one is rewritten to "MTP".

So a recipe that declares copy-only wide graphs (the feature part 3 exists for) cannot get draft_source=2 into the exported core through the standard PreparedExecution/RuntimeCore export, unless it patches binding.rs (which this PR does not). This is exactly the kind of thing the PR's own "no core re-export required" / "Ignition declares draft_source" claim glosses over, and the author's Limitations do admit W=16/W=24 copy-only GPU export/replay was not benchmarked.

Importance: high — a reader has to know the declarative half of the feature is not plumbed end-to-end in this repository.

#4 [high] Change: details the description does not say

Multiple changes in the diff that the description does not mention:

#5 [high] Recent activity / ownership: PR rewrites Luke Alonso's refresh design and reverses its idle-credit contract

The PR states Upstream main 33ab6df5. Verified from search_history at pr/540: the four commits a85be397, 83ff9ed6, 35ab143a, 7ca5430c sit directly atop 33ab6df5 (PCCessna, #508, 2026-11-26) and the PR has no merge conflicts reported (autobot packet says head 7ca5430, base main).

Code area ownership (search_history for the touched files):

So: the PR rewrites/extends the funded-refresh design by its original author (Luke Alonso, docs author, 365 commits in docs / 207 in helios/src) and replaces the oldest scheduler refresh tests' assertions (refresh_skips_infeasible_ages... renamed to refresh_skips_infeasible_shapes_and_ranks_unattempted_tier_by_expected_value; ordinary_income_excludes_queued_wall_wait_and_idle_discards_only_positive_credit renamed to ..._idle_retains_credit_while_abort_discards_positive). Two existing test names encode the previously documented contract that idle discards positive credit, and this PR changes that contract.

#6 [high] Related work: overlaps, prerequisites, and same-day conflict with #538

#7 [high] People: author history and standing; no reviewers yet

Author FujitsuPolycom, GitHub association CONTRIBUTOR (not one of the charter's priority contributors @voipmonitor/@original-el8/@lukealonso). Last 180 days: 5 merged, 10 open. Merged: #508 (recipe-declared row-sharded attention planning + PreparationManifest metadata), #499 (row-sharded prefill planning, PCIe DMA/RoCE row-shard collectives), #498 (flush PCIe D2H tails), #386 (image input for Qwen3.8 27B), plus one more. Areas their merged PRs touched: docs (3), ignition (3), ignition/cli (3), ignition/preparation (3), tests/cli (3) — i.e. an Ignition/CLI/docs contributor, not previously a helios scheduler contributor. Open ones (same day, same thesis of "scheduler/packing gaps"): #538 (prefill discovery), #539 (engram/heliopause export blob reuse), #512, #497, #496, #284/#283/#282 (DeepSeek V4.1 row-sharded prefill, flagged by original-el8 as conflicting with main), #387. Reviewer culture in this area: yatesdr and original-el8 review with "Should fix" lists and demand per-model scope and evidence (see #414 discussion: reviewer asked the author to name untested recipes, scope single-run claims, fix stale docs). #414's reviewer review and the follow-up are a template for what a review of #540 will demand — #540 names only DeepSeek-V4.1-Flash live, and hello docs staleness is present here too. No one has engaged on #540: pr_comments returns no comments, no reviews, no CI checks on head 7ca5430c.

#8 [high] Reach: who/what is affected — SAM built at admission, per-request memory, min_match_len default change, opt-in gating

#9 [high] Project fit: charter requirements and doc obligations, where met and where not

Charter (read_charter) lines relevant as facts:

#10 [high] Claims and evidence: what is backed, what is self-reported, what is untested

Claims and what backs them (all from the PR description; nothing verified here by running tests):

  1. "615 passed, 0 failed, 5 ignored" (cargo test --locked --manifest-path helios/Cargo.toml) and "1,625 passed, 44 ignored" (--lib --features runtime-core,server --skip template) on tip 7ca5430c — self-reported; no CI checks exist on the head commit ("CI on the head commit: no checks"), so nothing is independently reproduced. Note the two suites' counts differ from what #538 (same author, same base) reports for a comparable command (1,690 passed on tree 93ef9518), so the numbers are branch-local.
  2. "cargo check heliopause ... passed", "pytest tests/preparation/test_core_boundary.py: 4 passed" — but no Python test files are modified in this PR (pr_files has no tests/ entries), so new Python validation in execution.py:102-108 and heliopause/src/python.rs:225-233 is exercised only by the existing suite the PR says it ran (test_execution.py:299 asserts decoded.draft_source == 1 for a mixed graph with default signature; nothing asserts 2 or the rejection cases).
  3. "120 randomized brute-force SAM oracle trials" — backed by a real test: sam.rs exact_oracle_equivalence_randomized_streams_and_repetitions loops trial in 0..120 against a brute-force oracle with several min_match_len and prompt lengths (sam.rs:1401-1469). This is the strongest evidence in the bundle.
  4. "Suffix automaton latency: 0.80 ms / 2.72 ms / 13.05 ms build; 140/145/317 ns per step" — a CPU release microbenchmark; the corresponding test loop exists (sam.rs:1547 iterates [8_192, 32_768, 131_072]) but the timings are not checked in.
  5. Live claims — "max_b == C on every cell vs B16 at C=4 and B32 at C=6..16 before", "C=4 9.19 vs 9.55 ms/rd, +5.1%", "C=6 -7.9%", "C=8 -5.2%", "+0.57 tokens/round and +12.9% tok/s on a 512-token repetitive code-edit prompt", "+0.25 ms/rd overhead" — single machine, single model, single core, temperature 0; the description itself says "end-to-end throughput reflects the combined runtime, recipe, and kernel stack", i.e. the delta is not attributable to this parent alone. No artifacts, no per-run scatter, no repeat counts.
  6. "Aggregate timing-refresh (P <= 0.002/0.998O + D) and acceptance-learning (P <= 0.01/0.99O + D) bounds remain preserved" — asserted; the refresh bound is actually re-tested in the changed test refresh_funding_requires_earned_credit_and_accounts_for_repeated_attempts_and_idle (policy_tests.rs, updated assertion ordinary_ns * 0.002/0.998 - refresh_ns), and power_cap_restore_recovers_largest_prefill_chunk_across_idle_requests asserts refresh_ns <= ordinary_ns*0.002/0.998 + last_refresh_ns. The acceptance bound is only implicitly covered (unchanged code path except the readiness split).
  7. "existing W=8-only cores ... load, prune, pack, and schedule with no Protobuf wire changes and no core re-export required" — partially verified: proto already carried DraftSource on main, so no wire change is correct; but the "existing cores load" claim is only tested against a synthetic manifest built in-process (wide_copy_verify_catalog_packs_23_sam_tokens_and_preserves_legacy_w8_cores, helios/src/model/tests.rs), not an on-disk exported core.
  8. Claimed-but-not-shown: the description says copy-only wide graphs are declared through Ignition, but the export path rewrites draft_source to MTP (see the undeclared-gap note), and Limitations concede W=16/W=24 GPU export/replay was not benchmarked — so the ec2e feature has never been exercised end-to-end.

#11 [medium] Process and community: no engagement, no CI, no upstream issue asking for it

#12 [medium] Reach: precise gating, no operator-visible configuration, admission cost