Explore scratchpad · NVIDIA/hyperflare-inference #697

Raw Markdown for agents: https://autobot.eidonix.com/p/013cd7c6-f573-4ae7-ad87-e8b454ee5aab.md

#1 [high] Change: what PR #697 does (+29 prod LOC across 4 Rust files)

PR #697 "helios/scheduler: preserve interior anchor for open-reasoning prompts" (open, ready for review, no reviews, no CI checks, opened 2026-12-02, head bfae28a, base cc0a49d). 16 files, +510/-35. Net production diff claimed +29 LOC (description says +37/-8 across 4 Rust files).

Production changes (verified from diff):

  1. helios/src/scheduler.rs: adds pub preserve_message_anchor: bool to RequestSpec (:155-160) and LiveRequest (:228-232), copied at admission (:1849-1853 in admit()).
  2. helios/src/server/runtime.rs: adds pub preserve_message_anchor: bool to pub struct Prompt (:47-52); Incoming::spec() propagates self.prompt.preserve_message_anchor (:285-289); rest of runtime.rs diff is test-literal initialization only.
  3. helios/src/server/request.rs (~:424-452): prepare_validated_inference sets preserve_message_anchor = output.as_ref().is_some_and(|o| o.content.start == crate::output::tagged::OutputStart::Reasoning) and stores in Prompt.
  4. helios/src/scheduler/checkpoints.rs: new private predicate fn budget_interior_anchor(&self, request: &LiveRequest) -> bool { self.policy.checkpoint_extra_work_fraction == 0.0 || !request.preserve_message_anchor } (after anchor_split_ns, ~:466-472).
    • request_anchor_endpoint (~:474-480): early Some(raw_anchor) when !budget_interior_anchor(request) (i.e. fraction>0 AND preserve=true).
    • checkpoint_selection_uncached (~:607-625): new first branch if !self.budget_interior_anchor(request) { accounting.budgeted_anchor = None; (raw_anchor, 0) } (anchor kept, split_ns not charged).
    • promote_request_anchor (~:905-912): latch guarded with self.budget_interior_anchor(request) &&. No new CLI flags, no config knobs, no wire/ABI change, no unsafe, no model-name branches.

Key behavioral subtlety (undeclared emphasis): the new predicate treats fraction == 0.0 as "budget" (so strict zero-split fallback is preserved even for open-reasoning requests) — it is fraction == 0.0 || !preserve, NOT "preserve wins". So the fix only applies to the default 0.05-style nonzero-fraction regime.

Tests added: helios/src/scheduler/checkpoints.rs two new unit tests (preserved_message_anchor_retains_interior_boundary_and_respects_zero_fraction, non_preserved_continuation_with_reused_prefix_still_budgets_interior_anchor) at diff ~:4785-4920; helios/src/server/runtime/phase_tests.rs +248 lines: one large test prepare_inference_sets_preserve_message_anchor_and_preserves_across_readmission covering Reasoning=true, Content=false (plain + closed-think template), RecipientHeader=false (ATEM), RecipientFrame=false (ATEM add_generation_prompt:false and TMLv0), Completions=false, plus park()/readmission preservation. Other touched test files are mechanical preserve_message_anchor: false literal additions (model/tests.rs, model/packed_round_tests.rs, scheduler/{boundary,checkpoint_lifecycle,policy,tests}.rs, server/runtime/prompt_tests.rs).

#2 [high] Why: #660 itself disclosed the thinking-stripping multi-turn regression #697 fixes

#660 "helios/scheduler: budget interior conversation-anchor splits against checkpoint_extra_work_fraction" — by same author FujitsuPolycom, opened 2026-12-01, merged 2026-12-02 17:03, labels area:scheduling, bug, performance, triage:review, +900/-162 over 12 files. It is the direct parent of #697: it generalized interior-anchor retention to all fractions and, by implication, dropped interior anchors when the split exceeded the allowance.

Load-bearing fact: #660's own description lists as a trade-off: "Trade-offs: ... <think>-stripping (4.5K-13.7K) skips Turn-1->2 reuse (--scheduler-checkpoint-extra-work-fraction 0.15 retains it)." So #660 knowingly shipped a regression in multi-turn prefix reuse for reasoning-stripping OpenAI clients, and its suggested workaround was raising the fraction globally to 0.15. #697 replaces that workaround with a targeted rule keyed on OutputStart::Reasoning.

#660's two Autobot reviews (Changes Requested on 22cac91, Ready To Merge on cf744df) are in the PR thread; both flagged that the change shifts the default 0.05 path and disclosed the <think>-stripping trade-off as a measured cost. Merge risk rated Medium both times; expected rebase overlap with open #655 on checkpoint_selection_uncached and the same four docs.

PR thread URL: https://github.com/NVIDIA/hyperflare-inference/pull/660

#3 [high] Related work: #582 built the interior-anchor machinery #697 modifies

Related lineage: #582 (merged 2026-11-29, FujitsuPolycom, +2264/-20) "avoid splitting prefill on zero-budget checkpoint anchors" established the interior-anchor machinery that #697 now modifies. It introduced: zero-snapshot-capacity early exit, same-catalog pricing of whole/before/after, latching (raw_anchor, prompt_tokens, chosen) on CheckpointAccounting (later renamed budgeted_anchor in #660), request_anchor_endpoint unified across partial prefix hits / promote_request_anchor / Selene restore, and zero-fraction early return after pushing the Anchor cut (checkpoints.rs:675-677 today).

#582 was reviewed hard by voipmonitor (CHANGES_REQUESTED, 2 blockers: duplicate Anchor captures on EWMA drift and Mixed-prefill alignment shift) and then by lukealonso (blocker on stale latch after grown-prompt preemption/readmission: prompt_tokens grows at park() while message_boundaries stay). Both were fixed by keying the latch on (raw_anchor, prompt_tokens). That history explains why #697's preserve_message_anchor path also must key consistently and why the readmission test exists.

Key: #582's zero-fraction early return at checkpoints.rs:675-677 runs AFTER the anchor cut push (line 666-674), which is why #697's preserved-anchor branch still only costs one anchor cut and no optional candidates when fraction==0.

#660 (merged 2026-12-01/02) then generalized that zero-fraction rule to all fractions, introducing anchor_split_affordable, split_overhead_ns, anchor_split_ns, renamed latch zero_budget_anchor -> budgeted_anchor, charged interior split_ns against the allowance. #697 modifies exactly the three sites #660 introduced.

#4 [high] Change: undeclared side effects of the preserved-anchor path

Verified from checkpoints.rs:

#5 [high] Related work: #655 conflict, same-week neighbours, and #396's overlapping disclosure

#6 [high] People: author is a fast-shipping scheduling series owner; zero engagement so far

author = FujitsuPolycom, GitHub association CONTRIBUTOR (not in the charter's named priority list @voipmonitor/@original-el8/@lukealonso). Last 180 days: 19 merged, 11 closed, 1 open PR. Areas: docs (14), helios/src (14), helios (6), heliopause/src (4), ignition/preparation (4). Discord handle used on PRs: "Dooner".

Scheduling-series history (all same author, late Nov–early Dec 2026):

People active in these files: yatesdr (COLLABORATOR) owns #655/#674/#694 in checkpoints.rs and reviewed #396; lukealonso (charter-named priority contributor, author of #582 blocker review, #613, #619, #620, #645, #656) reviews anchors hard and holds owner approval for captured-graph op families; voipmonitor (charter priority) gave the CHANGES_REQUESTED review on #582 (duplicate Anchor captures); nepenth commented +1 on #655 with GB10 TP2 measurements.

Engagement on #697 so far: zero. No comments, no reviews, no reactions, no CI checks on head bfae28a.

#8 [high] Project fit: charter alignment strong, but the new bool is a default-false opt-in flag

Charter (read in full) mapping for #697: Lines up:

#9 [high] Claims vs evidence: strong safety claims, weak reproducible-benchmark link

Claims in the PR body, with what backs each:

  1. "+29 net production LOC (+37/-8 across 4 Rust files)". VERIFIED structurally: scheduler.rs +5/-0 (RequestSpec field, LiveRequest field, admit copy), runtime.rs +4/-0 prod (Prompt field, spec() propagation) with the rest test literals, request.rs +4/-0, checkpoints.rs +24/-8 prod (3 call-site guards + predicate + comments). The 16-file/+510-35 total is dominated by phase_tests.rs (+248) and the mechanical test literals. Claim holds.
  2. "zero unsafe, zero CLI, Protobuf, or model-core ABI changes, zero model-name branches". VERIFIED from the diff: no unsafe, no arg parsing, no .proto, no model/contract production change. The one production helios/src/server/request.rs change compares OutputStart, a parser enum.
  3. Performance table (Qwen3.8-27B / Nemotron-3.5 / Qwen3.8-Flash on gb10-tp1): supported by the PR body only — no external artifact, no tokbench-style harness repo link, no raw logs, no flare run command line beyond the runtime flags, and the workload generator for the "C=6 x 4 turns, n=2, OpenAI content-only history" scenario is not named. Compare #660 and #661, which name FujitsuPolycom/tokbench and give exact python3 -m tokbench run ... reproducers. This PR does NOT give a reproducer for either of its two experiments. That is the weakest evidence link in the package.
  4. "binary SHA-256 eccdaa0f... (Arm A) / 8892aa6f... (Arm B)" — artifact identity is pinned, but the binaries were built from 298d3e68, NOT from the current head bfae28a6. The body states this explicitly ("prior to the test-only rebase onto cc0a49d2"). So the live numbers correspond to a commit whose production tree is claimed byte-identical but which no longer exists as the head. No live re-run on bfae28a.
  5. Unit/CI evidence: "helios 1,900 passed (1,838 lib + 62 integration)" etc. — these are author-run cargo test --locked --release results on a clean git archive bfae28a6, listed per crate with pass/fail/ignored counts. No CI run exists on GitHub for this head (orientation packet: "CI on the head commit: no checks").
  6. Fault-mutation evidence: two mutations (forcing budget_interior_anchor to true; widening == OutputStart::Reasoning to != OutputStart::Content) failed the intended tests with exit 101. The second one is a genuinely good check — it directly protects the ATEM / RecipientHeader false case that a naive != Content implementation would get wrong (and would have wrongly preserved anchors for every ATEM chat turn).
  7. "All 8 TLA+ models ... observed Rust trace conformance, and all source/model mutation guards passed" — plausible; check.py's checkpoint mutation (check.py:672-676) still applies and its needle remains unique (checkpoints.rs:649).
  8. Disclosed limitation about self-closed empty thinking suffix (<think>\n\n</think>\n\n -> OutputStart::Content): accurate and important — it means the fix does not help Qwen-family templates that emit a pre-closed reasoning block when enable_thinking=false. #677 (open, jcartu) is in the same reasoning-alias space and may interact.
  9. "SM120 TP4 DeepSeek-V4.1-Flash non-thinking workloads were not re-benchmarked" — justified by preserve=false, and backed by the non_preserved_continuation_with_reused_prefix_still_budgets_interior_anchor unit test which does exercise admission_reused_tokens == 512. Reasonable but still an unmeasured claim on the primary production target (SM120 TP4 is where #660's big wins were measured).

Claims the change does NOT support / gaps:

#13 [high] Research summary

Case file for PR #697 (helios/scheduler: preserve interior anchor for open-reasoning prompts) is complete; 12 scratchpad entries cover all eight angles.

What it is. A +29-net-production-LOC follow-up to #660, same author (FujitsuPolycom). It adds a default-false preserve_message_anchor bool to Prompt/RequestSpec/LiveRequest, set in prepare_validated_inference from output.content.start == OutputStart::Reasoning, and one predicate budget_interior_anchor in checkpoints.rs that makes the three anchor-selection sites (request_anchor_endpoint, checkpoint_selection_uncached, promote_request_anchor) retain the interior message anchor uncharged when the fraction is nonzero and the prompt opens a reasoning block. Fraction 0.0 still forces the strict zero-split fallback.

What a reader could not learn from the description. (1) Preserved turns still emit a second, charged prompt-end Endpoint snapshot row — visible in the author's own metrics (end caps 60→96, msg_ckpts 24→48) but never stated as a consequence. (2) preserve_message_anchor is literally a default-false boolean opt-in on three structs, which sits awkwardly against docs/design-review.md principle 3's "reject per-request default-false opt-in flags" — its defence is that it derives from shared frontend parser state, not model identity. (3) There is no independent opt-out: the only way to disable the new rule is --scheduler-checkpoint-extra-work-fraction 0.0, which also kills terminal Endpoint extras and all optional Message cuts. (4) The live A/B binaries were built from 298d3e68, not the head bfae28a6; no live run exists on the head. (5) The perf table gives no harness link or reproducer command, unlike the author's own #660 and #661 which name FujitsuPolycom/tokbench and give exact commands. (6) No test asserts the actual cross-turn cache reuse outcome — the tests pin anchor endpoints and split_ns == 0 only; the causal fix rests entirely on the un-reproduced live A/B. (7) OutputStart::ToolBody is claimed non-preserved but untested. (8) No CI checks and no reviews at all on the head.

Why and lineage. #660 itself disclosed this exact regression in its trade-offs ("<think>-stripping skips Turn-1→2 reuse; --scheduler-checkpoint-extra-work-fraction 0.15 retains it"), so #697 is the targeted replacement for a global-knob workaround #660 shipped one day earlier. The mechanism is real and verified in code: cache.rs:552-579 requires an exact prefix match. #697 is step three of #582 → #660 → #697, with #582's two blocker review rounds (voipmonitor, lukealonso) explaining why latch keying and readmission matter here.

Concurrency and process risk. #655 (open, "Ready To Merge", yatesdr) edits the same checkpoint_selection_uncached gate and all four docs; #660's own reviews flagged this overlap twice, and #697 inherits it. #661, #663, #645, #665 are same-week neighbours in the same files. #396 (merged, yatesdr) already discloses the same prefix-divergence family from the frontend tokenization layer, and #697 does not cite it.

The change is well-scoped, model-agnostic, evidence-bearing in the charter's sense, and its documentation is synchronized across four sites — the material gaps for a decider are the missing reproducible benchmark, the missing end-to-end reuse test, the extra charged snapshot row, the flag-shaped design against principle 3, and zero CI/review coverage.

#14 [high] Recent activity: two authors rewriting the checkpoint/anchor area at several merges per day

Dedicated entry for the recent-activity angle (facts scattered across entries 5 and 6).

The orientation packet's per-area commit history could not be resolved (git could not read c513e46a), and "commits on the default branch since this PR branched (cc0a49d), touching its changed files: none" — so the repository head is essentially at the PR's base. Activity therefore has to be reconstructed from merged PRs, which is what entries 5 and 6 do.

Timeline of activity in the exact files #697 touches (helios/src/scheduler/checkpoints.rs, helios/src/scheduler.rs, the four docs):

So the area is being actively rewritten by two people (FujitsuPolycom and yatesdr) at a rate of several merges per day, and #697 is the fastest-moving lane. Nothing in #697 reverses or conflicts semantically with #661/#663/#665; its only real merge-order hazard is #655.

Also worth carrying: none of the merged neighbours changed the interior-anchor retention rule itself between #660 and #697 — #697 is the first semantic change to that rule since #660 landed hours earlier. So a reader should treat #660's disclosed <think>-stripping regression as living on main for roughly one day.

#7 [medium] Process: ready-for-review but zero CI, zero reviews, no labels, no autobot pass

Process/state facts (as of the case file):

#10 [medium] Reach: default-on for reasoning chat, no independent opt-out, extra snapshot row per turn

#11 [medium] Tests: what the new unit tests actually pin, and the gap

Verified by reading the new test (helios/src/scheduler/checkpoints.rs:4788-4862, preserved_message_anchor_retains_interior_boundary_and_respects_zero_fraction): fixture is prompt 1024, boundary 896, prefill catalog [128]=100ns, [256]=110ns, [512]=200ns, Snapshot(1)=5ns, fraction 0.05. Whole interval 0..1024 = 200+200 = 400ns; allowance = 20ns; split at 896 = (200+110+100)+100-400 = 110ns > 20ns. Assertions: cuts[0] = (896, Anchor, split_ns 0), cuts[1] = (1024, Endpoint), reserved_ns 5, budgeted_anchor None, request_anchor_endpoint == Some(896). Then a stale-latch + extra_spent_ns=1000 block re-asserts the same, proving both paths agree and the selection clears the stale latch. Then a second scheduler at fraction 0.0 with the same preserve=true spec asserts cuts[0].endpoint == 1024 (strict zero-split fallback honoured) and request_anchor_endpoint == Some(1024).

Second test (checkpoints.rs:4864-4925, non_preserved_continuation_with_reused_prefix_still_budgets_interior_anchor): publishes a 512-token prefix checkpoint via a real admit/plan/commit/complete loop, then admits two 1024-token turns with boundary 896 and admission_reused_tokens == 512 (asserted). preserve=false -> cuts[0].endpoint == 1024 (budgeted away, #660 behavior); preserve=true -> cuts[0].endpoint == 896 with split_ns 0. This is the direct guard that #697 does not regress #660's multi-turn continuations.

Gap worth recording: neither test drives a second turn that actually hits the published checkpoint, i.e. no test asserts the cache-reuse outcome itself (lookup / ready_by_prefix at the message anchor on the next turn). The end-to-end reasoning test (phase_tests.rs:8352-8421) does a park()/readmission but does not assert prefix reuse either. So the causal chain "anchor retained -> Turn k+1 finds a prefix -> full re-prefill avoided" rests entirely on the live A/B, not on a test. Also: the tests use the synthetic spec()/measure() helpers (helios/src/scheduler/tests.rs:246), not a served request, so they are unit-level on the selection function, which is what they claim.

#12 [medium] The why, verified in code: exact-prefix cache lookup vs divergent stripped tail

#15 [medium] Community: no engagement at all on #697, against heavy engagement on its neighbours

Dedicated entry for the community angle.

On #697 itself: nothing. pr_comments returns "No comments." No review, no review request, no reaction, no label, and — unlike its neighbours — no "A case file has been opened" / "Autobot Review" comment from flare-autobot, which every other scheduling PR in this series received within ~2h of opening (#660, #655, #661 all show the auto-intake comment followed by one or more Autobot reviews). The orientation packet also records "Reviews: none yet" and "Labels: none".

Contrast, for how much interest this topic normally draws:

So the reviewer pool that actually engages on this surface is: flare-autobot (automated), voipmonitor (charter priority contributor), lukealonso (charter priority contributor and owner of several anchor-adjacent PRs), yatesdr (COLLABORATOR, competing same-file work), and occasional field reporters like nepenth. None has touched #697 yet. The most likely meaningful first reactions are lukealonso (who blocked #582 on readmission/latch staleness) and yatesdr (whose #655 collides in the same function).

Discord contact line is present on the PR ("Discord: Dooner") as design-review principle 17 requires.