Recommendation: Changes Requested
The core scheduler change (+29 net production LOC across 4 Rust files, zero unsafe, zero model-name branches or ABI/wire changes) cleanly and safely fixes the <think>-stripping multi-turn prefix-reuse regression disclosed by #660, with strong single-GPU gb10-tp1 A/B gains (+9.74 to +31.78 pp Turn 2+ cache hit, 0 / 108 zero-hit misses, -20.1% to -45.1% total prefill tokens). No merge blockers exist, but three concrete issues should be addressed before merge: an internal documentation contradiction in docs/cli-design.md:709-713, the lack of an end-to-end two-turn divergent-suffix reuse test in helios/src/scheduler/checkpoints.rs, and the undisclosed extra prompt-end Endpoint snapshot published on every preserved open-reasoning turn (ckpt_caps end 60/61/64 → 96) alongside missing benchmark harness command lines in ## Evidence.
Merge Risk
Level: Medium
- Default-path behavior change on reasoning-enabled chat (
0.05): Every open-reasoning request (OutputStart::Reasoning) under nonzeroscheduler_checkpoint_extra_work_fractionnow retains its interiorraw_anchorunconditionally (restoring pre-#660split behavior for reasoning prompts while leavingOutputStart::Content,RecipientHeader,RecipientFrame,ToolBody, raw completions, andfraction == 0.0on#660's exact budgeted path). This trades an extra Turn-1 tail prefill (and disclosed queueing launch amplification onNVIDIA-Nemotron-3.5-Bolt-74B-A9B-24GB-FLAREatmax_active = 4) for recovering Turn 2+ prefix reuse. - Clean concurrency, lifecycle, and readmission invariants:
RequestSchedulermutates single-threaded (&mut self),configure_policyrejects policy changes after admission (helios/src/scheduler/policy.rs:225-228),Incoming::spec()preservespreserve_message_anchoracrosspark()/park_grammar_transition()readmission (helios/src/server/runtime.rs:288,2422-2519), andverification/helios-lifecycle/check.py:672-677'sbudgeted_anchormutation needle remains unique. - Rebase overlap with open
#655: OpenReady To MergePR#655edits the adjacent snapshot-cost gate incheckpoint_selection_uncached(helios/src/scheduler/checkpoints.rs:681,fresh_duration→measured_duration) and the same four documentation files; changes are semantically orthogonal but require rebase coordination.
Walkthrough
helios/src/server/request.rs:427-429,452: Computespreserve_message_anchor = output.as_ref().is_some_and(|o| o.content.start == crate::output::tagged::OutputStart::Reasoning)inprepare_validated_inferenceand stores it onPrompt.helios/src/server/runtime.rs:50-53,288&helios/src/scheduler.rs:158-160,231,1852: Threadspub preserve_message_anchor: boolthroughPrompt→Incoming::spec()→RequestSpec→LiveRequestatadmit(), preserving it across initial admission and preemption/grammar readmission.helios/src/scheduler/checkpoints.rs:469-483,620-624,908-912: AddsRequestScheduler::budget_interior_anchor(&self, request: &LiveRequest) -> bool(fraction == 0.0 || !request.preserve_message_anchor) shared byrequest_anchor_endpoint(earlySome(raw_anchor)),checkpoint_selection_uncached(retains(raw_anchor, 0)and clearsbudgeted_anchor), andpromote_request_anchor(suppresses latching).docs/cli-design.md:696-708,docs/core-design.md:1436-1454,docs/scheduling-runtime-design.md:664-674,helios/README.md:370-386: Updates present-state checkpoint anchor docs for open-reasoning preservation under nonzero extra-work fractions.helios/src/scheduler/checkpoints.rs:4789-4926&helios/src/server/runtime/phase_tests.rs:8352-8589(+ mechanicalpreserve_message_anchor: falseupdates across 8 test files): Adds isolated unit tests for preserved vs. budgeted anchor selection, stale-latch clearing,fraction == 0.0fallback,admission_reused_tokens == 512non-preserved budgeting, frontendOutputStartclassification, andworker.park()readmission.
Pre-merge Checks
- [PASS] Security / malicious screen: Pure scheduler predicate, boolean metadata propagation, unit tests, and docs; zero
unsafe, no new I/O, parsing, FFI, or untrusted-input surface. - [WARN] Charter & value fit: Model-agnostic (
OutputStart::Reasoningis shared parser state, zero model-name branches) and fixes a real measured regression in the right layer, butdocs/cli-design.md:709-713contradicts the updated paragraph immediately above it. - [WARN] Related / duplicate / conflict check: Directly addresses
#660's disclosed<think>-stripping trade-off with no competing PR, but overlaps openReady To Merge#655inhelios/src/scheduler/checkpoints.rsand all four doc files — coordinate merge/rebase order. - [WARN] Tests & verification evidence: New tests are isolated and exercise real production types (
RequestScheduler,prepare_inference,Worker), andscripts/scheduling_sim/kaniare accurately N/A; however, no test exercises end-to-end Turnk→ divergent Turnk+1prefix reuse,## Evidenceomits the benchmark harness/command line (unlike#660), and GitHub Actions CI +Design-Signed-Off-By:commit trailers should be confirmed on headbfae28a.
Blockers
None.
Should Fix
- Fix internal contradiction in
docs/cli-design.md:709-713: Lines699-702state that under a nonzero fraction an interior message endpoint is "retained without charging its split when the generation prompt opens a reasoning block", but lines709-711immediately below still state "Any retained interior anchor split, earlier messages, and a distinct prompt end share the fraction of estimated uncached prefill work" (whereasdocs/core-design.md:1449-1451was properly updated to "when such a budgeted interior anchor is retained").- Fix: Change
docs/cli-design.md:709to "Any budgeted interior anchor split..." and clarify at:712-713that uncharged anchor copies and preserved open-reasoning anchor splits are excluded from budgeted extra-work accounting (flare_checkpoint_extra_work_nanoseconds_total).
- Fix: Change
- Add an end-to-end two-turn divergent-suffix reuse test (
helios/src/scheduler/checkpoints.rs:4789-4926): Neither new scheduler test executes apreserve_message_anchor: trueTurn 1 throughplan() -> commit() -> complete_test_step()to publishAnchor(896)and then admits a divergent Turn 2 (matching0..896and diverging in896..1024, modeling stripped reasoning history). Right now:4790-4865only inspectscheckpoint_selection()/request_anchor_endpoint()without stepping, and:4868-4926only executes a 512-token Turn 1 withpreserve_message_anchor: falseand no interior boundary.- Fix: Add an isolated test (following
#660's Case 1 pattern atcheckpoints.rs:4270-4332) that runs Turn 1 (prompt_tokens = 1024,message_boundaries = [896],preserve_message_anchor = true) through prefill publication and asserts that a Turn 2 matching0..896with a modified896..1024suffix admits withadmission_reused_tokens == 896(and that the same sequence withpreserve_message_anchor = falsefalls back to1024and admits withadmission_reused_tokens == 0).
- Fix: Add an isolated test (following
- Resolve/document the extra prompt-end
Endpointsnapshot on preserved open-reasoning turns (helios/src/scheduler/checkpoints.rs:695-697) and add benchmark reproducer commands (## Evidence):- Because preserved turns keep
anchor = raw_anchor < request.prompt_tokenswithanchor_split_ns = 0,checkpoints.rs:695-697pushes(request.prompt_tokens, RetentionRole::Endpoint)withsplit_ns = 0and full prefill allowance intact, publishing an extraGraphKind::Snapshotcopy and snapshot row atprompt_tokenson every open-reasoning turn (visible in the PR's own tables:ckpt_caps endrose60→96,61→96,64→96across48turns, i.e.,+32to+36extra prompt-end snapshots for the exact<think>suffix that Turnk+1strips; also pinned atcheckpoints.rs:4819-4822). Whileprotected_budget(prompt_tokens - raw_anchor,:769-773) bounds eviction under tight snapshot capacity and this matches pre-#660behavior, it is never mentioned in## Whator## Trade-offs. - Fix: Either confirm whether that prompt-end
Endpointcapture is intentionally kept (for exact-prompt replay / pre-#660parity) and disclose the extra per-turnEndpointsnapshot copy/row in## What/## Trade-offs, or skip pushingrequest.prompt_tokensat:695-697when!self.budget_interior_anchor(request)if the extra copy is unnecessary. Also add the workload harness repo/commit and exact invocation commands forC=6 x 4 turnsandprefill_burstto## Evidence(matching#660).
- Because preserved turns keep
Subtract / Simplify
- Fold the duplicate fallback arm in
checkpoint_selection_uncached(helios/src/scheduler/checkpoints.rs:620-624,662-665): The newif !self.budget_interior_anchor(request)arm at:621-623executesaccounting.budgeted_anchor = None; (raw_anchor, 0)— byte-identical to the pre-existingelsearm at:662-665. Changing:620toif raw_anchor < request.prompt_tokens && self.budget_interior_anchor(request)deletes 4 lines, one nesting level, and the duplicatebudgeted_anchor = Noneabove the TLA+ mutation target at:649with identical behavior across all four reachability cases. - Extract a shared
preparehelper inhelios/src/server/runtime/phase_tests.rs:8358-8377,871-888: The 18-linelet prepare = |...| { ... }closure at:8358-8377is a verbatim duplicate of the first 18 lines ofprepared_budget_requestat:871-888. Extractingfn prepare(fixture: &Fixture, protocol: Protocol, body: serde_json::Value) -> PreparedInferenceremoves ~18 duplicated lines and keeps theprepare_inferencecall site in one place. - Optional — extract a local stepped-cost scheduler helper in
helios/src/scheduler/checkpoints.rs:4791-4802,4843-4854,4869-4880: The 10-line[(128, 100), (256, 110), (512, 200)]+Snapshot(1, 5)+configure_policy(fraction)fixture setup is repeated verbatim 3 times in the new tests (and 5 other times earlier in the module); a smallfn budgeted_scheduler(fraction: f64)helper cuts ~20 lines.
Nits
- Hoist repeated
OutputStart::Reasoningcheck (helios/src/server/request.rs:414,427-429): Computinglet opens_reasoning = output.as_ref().is_some_and(|o| o.content.start == crate::output::tagged::OutputStart::Reasoning);once above:408avoids stating the same check twice 13 lines apart. OutputStart::ToolBodytest coverage (helios/src/server/runtime/phase_tests.rs:8352-8589):## Why/## Trade-offslistOutputStart::ToolBodyamong non-preserved starts; while obviouslyfalseunder== OutputStart::Reasoning(request.rs:429), adding aToolBodycase (or omitting it from the tested list) keeps claims and fixtures 1:1.
Dropped on verification
- Correctness Lens F1's proposed fix ("charge
split_nsintoreserved_ns/extra_spent_nsfor preserved anchors"): Dropped. Charging an over-budget interior split (e.g.,110 nsvs20 nsallowance atcheckpoints.rs:4804-4806) intoaccounting.extra_spent_nsputs the request in deep allowance debt, starving earlier alignedMessagecuts (e.g., shared system prompts) and terminalEndpointcaptures (allocate_terminal_captureatcheckpoints.rs:1091-1099). Uncharged anchor work (copy_ns: 0and pre-#660interior anchor splits) has always been excluded fromextra_spent_ns/checkpoint_extra_work_ns; the verified defect is the stale wording atdocs/cli-design.md:709-713(kept as Should Fix 1). - Correctness Lens F2's claim that the extra prompt-end
Endpointcopy displacedMessagecuts (msg11→0,2→0,21→12) on the allowance: Verified false.checkpoint_selection_uncached(helios/src/scheduler/checkpoints.rs:687-697) evaluatesMessagecandidates before pushing(request.prompt_tokens, RetentionRole::Endpoint)last, soEndpointcannot consume allowance beforeMessagecuts. (Themsgcount drop reflects eliminating Turn 2+ zero-hit misses that previously re-prefilled full multi-turn histories with earlier messages.) - Correctness Lens F3 ("uncharged anchor split removes downstream gating and explains Nemotron's
90 → 229prefill launches"): Dropped as duplicate of F1 + speculative attribution. Two prefill chunks per turn across 48 requests is96launches (matching both Qwen models), Nemotron had fewerMessagecuts on the fix arm (21 → 12), and prompt-endEndpointhassplit_ns == 0(zero added prefill launches). - Correctness Lens F4 / Value Proposition claim that
preserve_message_anchor: boolviolatesdocs/design-review.md:58-61("default-false opt-in"): Dropped.docs/design-review.md:58-61rejects per-model boolean policy flags / model allowlists (supports_*,can_*).preserve_message_anchor: boolis a per-request frontend-derived flag onPrompt/RequestSpec/LiveRequest— identical in pattern togrammar_constrained: boolandprompt_logprobs: bool(helios/src/scheduler.rs:152-160) — that varies dynamically per request on the same model. Replacing it with a 2-variant enum adds churn without benefit. - Correctness Lens F6's claim that preserved requests "bypass cache-readiness verification of their anchor" (
checkpoints.rs:504-519): Verified false. Lines504-519only run on full-prompt GPU cache hits (baseline_start == request.prompt_tokens) to infer whether the cached turn keptraw_anchoror fell back toprompt_tokens; returningSome(raw_anchor)early at:480is exact for preserved requests, andpromote_request_anchor(:920-926) still checksself.cache.ready_by_prefix(&key)before promoting. - Subtraction Lens F3 ("invert
budget_interior_anchortopreserved_interior_anchor(fraction, request)") & F1's sub-claim of deleting a call site: Dropped. Once Subtraction 1 folds:620-624into the outerif,budget_interior_anchoris positive at 2 of 3 call sites (:620,:908) and negated only once (:480); inverting it increases negations from 1 to 2 and makes callers more verbose. Folding keeps 3 call sites while removing 4 lines and the duplicate arm. - Discovery Dossier stale note ("no automated intake comment"): Verified stale against
pr_comments(flare-autobotposted the intake comment on2026-12-02 23:55).