Amendments to the #729 case file — event: second head 68fe22fd, 2026-12-04 23:33
Scope: amendments only. Every item below either retracts, refines or adds to a numbered finding of the previous report. Findings not listed are unchanged.
Key findings
- The PR was rewritten. Head
68fe22fd("helios: harden grammar park preemption, non-blocking copy gate, mixed cost bounds, and lifecycle verification") supersedes150f705: 24 files, +2954/−591 (was 14 files, +2219/−370), labelsarea:scheduling, bug, performance, triage:reviewadded, body rewritten into the standard why/what/evidence form citing#530, #626, #628, #645. This voids the scale, per-file map and process findings below. - My lock-order-stall finding is resolved, not merely argued — verified in code:
try_with_gpu_codec_lockednow takescodec.try_lock()first and only thentry_enter_offload_batch()(helios/src/offload/transfer/codec.rs:895-906), and the try-entry never waits nor burns wave tokens (helios/src/offload/copy_gate.rs:171-176, 204-210). The reversal of #628's documented order for the blocking capture path remains (codec.rs:879-889). - The publish/preemption-ordering blocker is fixed —
Worker::publishappliespending_grammar_parkbeforepark_if_preempted(helios/src/server/runtime.rs:2561-2589) andpark_if_preemptedreturns early while a park is pending (runtime.rs:2786-2792). - Only one of three performance claims is now measured, and the measurement includes a disclosed 30% regression (MTP 5, 20,648 tokens: 40.9 → 54.1 ms).
- The Autobot Review in the thread (18:24, "Changes Requested") was verified against
150f705and must not be cited as the current state; its two runtime blockers are addressed at68fe22fd. Its surviving content: unbenchmarked buckets 2–3, the#715conflict, missing@yatesdrsign-off, undisclosed legacy-core cost. - Still no human comment, review, reaction or assignee, and no CI result reported for the new head.
Amendments by prior finding
Scale and scope (amends finding 1) — superseded
- Was: 14 files, +2219/−370. Is: 24 files, +2954/−591 (
pr_files,read_item(729)). - Ten files are new since the first head:
docs/api.md(not opened) (+11/−8),docs/core-design.md(not opened) (+16/−8),docs/mtp-design.md(not opened) (+31/−9),docs/prefix-cache-offload.md(+13/−6) — the mechanism now documented in five docs, not one.helios/src/model.rs(not opened) (+1/−1) — re-exportsAdmissionGrammar.helios/src/offload/copy_gate.rs(+70/−14) —offload_must_wait,take_offload_lease,try_enter_offload_batchplus a non-blocking test.helios/src/scheduler/lifecycle_tests.rs(not opened) (+129/−3) —Pausedstate, actions 7/8/9, seven coverage booleans.verification/helios-lifecycle/Lifecycle.tla(+24/−2),README.md(not opened) (+7/−3),check.py(not opened) (+50/−0).
- Deltas grew on files already present:
codec.rs+518/−255,cost.rs+376/−64,policy.rs+292/−57,runtime.rs+294/−71,phase_tests.rs(not opened) +686/−24,admission.rs+53/−9,model/tests.rs(not opened) +109/−24,docs/scheduling-runtime-design.md+26/−18. - Bundling criticism gets worse, not better: four review surfaces now (runtime lifecycle, codec/gate, cost model, TLA+/mutation fixtures) in one PR.
The Admission API in my file map (amends finding 2 and the per-file map) — void
Admission::grammar_enabledandset_grammar_mask(mask, enabled)no longer exist. Replaced byAdmissionGrammar::{Disabled, UnmaskedEnabled, Masked(Vec<i32>)}withis_enabled()/mask()/mask_mut()(helios/src/model/admission.rs:59-90),Admission::set_grammar(AdmissionGrammar), andGrammarEnabledpacking fromadmission.grammar.is_enabled()(helios/src/model/packing.rs(not opened)). The stated motive is that "disabled but masked" becomes unrepresentable.
Lock order (amends finding 2 of the prior report, the "order swap moves the block point" concern) — resolved
- Was: under gate-before-codec, a foreground restore reached the CPU-decode fallback only after an unbounded
Condvarwait onCopyEngineGate::enter_offload_batch, and burned two wave tokens on contention. - Is:
CopyEngineGate::try_enter_offload_batchreturnsNonewithout waiting and without mutatingoffload_batches_waiting/offload_wave_remaining(helios/src/offload/copy_gate.rs:204-210, sharing the predicate at:171-176).try_with_gpu_codec_lockeddoescodec.try_lock().ok()?and thengate.try_enter_offload_batch()?(helios/src/offload/transfer/codec.rs:900-905), so the foreground path is non-blocking on both acquisitions. Background captures keep the blocking gate-then-codec path (codec.rs:881-889). - What survives — and is the highest-value remaining reviewer question: #628's invariant ("preserve strict lock ordering,
gpu.codecbeforeCopyEngineGate") is still reversed for the capture path, and the new order is stated only in the code comment atcodec.rs:879-880.docs/prefix-cache-offload.md:95-107now describes gate-before-codec behaviourally but never states the ordering invariant itself, and@yatesdr(author of #628 and ofcopy_gate.rs) has not signed off.
Evidence and claims (amends finding 5) — partly retracted
- Retracted: "No performance evidence". Bucket 1 now has a live served A/B:
flare runon SM120 RTX PRO 6000, signedQwen4-35B-A3B-FLARE-gb202-tp1-202612032159-signed,origin/main f705086bvs68fe22fd, 3 trials × 2 prompt lengths,--mtp-draft-tokens 0.</think>→first-content median 41.2 → 12.4 ms at 6,382 prompt tokens (3.3×) and 58.5 → 12.9 ms at 20,648 (4.5×); 6/6 schema-valid JSON. Counters over 7 requests: cache lookups 14→7, prefill tokens 84,638→81,832, prefill graph launches 62→54, snapshot backing pages 2,880→2,112 (−26.7%). This satisfies #210 /docs/design-review.md:106-115for that bucket only. - Added, and it is a regression, not a win: default MTP 5 at 20,648 prompt tokens is 40.9 → 54.1 ms (≈30% slower); the 6,382-token cell is flat (39.1 vs 39.0). Cause per the body:
pause_for_parkdrains one speculative frame before Frame 2 overshoots and rolls back. There is no heuristic to skip parking when overshoot is likely. - Still unmeasured: bucket 2 (codec) has no whole-model run — only four ignored
offload::transfer::codec::tests::GPU tests andtests/test_kv_codec.py(not opened); bucket 3 (Mixed NNLS) is unit-test only, and the PR states the Layer-2 simulator cannot validate it becausescripts/scheduling_simprices scalar per-graph costs, not(fill, kv_context)curves.docs/design-review.md:234-251("disclosure does not excuse skipping runnable CPU checks") makes that a design-review gap rather than a note. - Static claims still hold up:
zero_fillbucket,t_at_umin, anchoredtheta_0,pos_u_min/pos_u_maxfloor are present athelios/src/scheduler/cost.rs:94-204, 287-296, 349-465, 621, 910-956;GraphKind::Mixedis wired atcost.rs:586, 649, 676, 943, 1065, 1103, 1124and covered bymixed_cost_model_tracks_zero_fill_partial_fill_deep_context_and_peer_slope(cost.rs:1764).
Verification gates (amends finding on --mutations and TLA+) — retracted
check.py (not opened) --mutationswas run: 56/56 mutations detected (17 TLA+ + 39 Rust, incl. 6 new).Lifecycle.tlaextended withPaused == 3,PauseForPark/FinishForPark/ToggleGrammar; 10 models pass,Lifecycle.tla18,790 states / 2,896 distinct / depth 14, 0 errors; 623,904 observed Rust transitions checked.- Residual, worth a reviewer's eye:
ToggleGrammaris modelled as an identity transition and only overphase = Live ∧ not-queued, weaker than the Rust guard which also excludespending != 0,Finishingand a terminalSnapshot.cargo-kanistill unrun (not installed locally).
Docs (amends finding 6) — retracted
- Five docs updated, not one:
docs/{api,core-design,mtp-design,prefix-cache-offload,scheduling-runtime-design}.md. The codec doc now covers gate-before-codec, non-blocking foreground fallback and run partitioning (docs/prefix-cache-offload.md:95-107); the cost doc matches code (docs/scheduling-runtime-design.md:466-484). What survives from the old finding is the missing prose statement of the lock invariant (above) and the behaviour change for older cores, which is now accompanied by a measured cost.
Issue linking (amends finding 4) — retracted, with a caveat
- The body now says it builds on
#530, #626, #628, #645andread_item(729)reports mentions of #210, #267, #334, #525, #530, #626, #628, #645, #715. "Cites no issue or PR" is withdrawn. - Caveat: there is still no
Fixes/Closestrailer, so nothing closes; #530 ("structured output decodes ~2–3x slower… MTP drops to width one") remains open after #619, #626 and #729.
Triage and review (amends finding 10 and the community findings) — partly retracted
- Retracted: "untriaged, no case file, no review". Labels are applied;
flare-autobotopened a case file (2026-12-04 18:00) and posted an Autobot Review (18:24) with 5 blockers / 3 should-fix / 6 subtract / 3 nits, recommendation Changes Requested. - Important for citation discipline: that review explicitly says "verification at
150f705". Its two runtime blockers — thegpu.codec→gate wait ahead oftry_lock, andpublish()runningpark_if_preemptedbefore the grammar park — are fixed at68fe22fd(see the lock-order and publish-ordering amendments). Do not cite them as live defects. - Unchanged: zero human comments, zero reviews, zero reactions, no assignee, one automated comment thread only, no CI result reported for
68fe22fd, and no re-review (the hook auto-runs 90 minutes after a push; the push was 23:33).
Merge-order risk (amends finding 11) — worsened
- #715 has grown too (
49d5840, 33 files, +2257/−115) and now documents the opposite rule — "PrefillCostModeland context-slope borrowing scoped tobatch == 1" — while editing the samedocs/scheduling-runtime-design.mdparagraph #729 rewrites (+15/−9 vs +26/−18). Its gates sit atcost.rs:581-583, 606-607, 644-659, 969, exactly where #729 addsGraphKind::Mixed. That is a textual conflict plus mutually contradictory documentation. - Unchanged from before: #710 and #301 also touch
cost.rs; #621 touchesmodel/admission.rs(a file whoseAdmissionshape #729 rewrote again); #718 shares 9 files.
File map (amends finding 2 of the prior report, "undeclared work") — mostly retracted, one item stands
- The stale-base caveat still holds:
helios/src/scheduler/checkpoints.rs(not opened) andhelios/src/server/request.rs(not opened) are still absent from the 24-file list, confirming their hunks in a rawpr_diffare merged-PR artifacts (#674/#709/#659/#655/#660/#697), not #729's work. - The undeclared-work item narrows to one class: the replaced
Admissionrepresentation (admission.rs+53/−9,model.rs(not opened) re-export,packing.rs(not opened) +6/−6) is described in the body but its behavioural consequence — thatGrammarEnabled = 1with no mask is now packed for non-speculative requests during open reasoning — is buried in the "What changed" prose rather than stated as a wire-visible change for cores reading that value source.
Open questions after the revision
- Who accepts the reversed #628 invariant?
@yatesdrauthored #628 andcopy_gate.rs; the ordering now lives only incodec.rs:879-880and in a behavioural paragraph indocs/prefix-cache-offload.md. No docs statement of "gate before codec" as an invariant exists (grep 'lock order'indocs/finds nothing). - Is the MTP 5 regression acceptable as-is? 40.9 → 54.1 ms at 20,648 prompt tokens on the default configuration, disclosed with a mechanism but with no gate to avoid parking when overshoot is likely. Every default-MTP-5 structured-output deployment pays it.
- How are buckets 2 and 3 to be validated? Neither has a whole-model run; the PR says no local core exports
GraphKind::Mixedgraphs orcodec_layout. The Layer-2 simulator cannot model the NNLS strata, so bucket 3 has no end-to-end gate at all beyond unit tests. - Starved CPU-fallback restores (new nit):
try_enter_offload_batchdeliberately never incrementsoffload_batches_waiting(copy_gate.rs:204-210), so CPU-fallback restores are invisible to gate turn-fairness accounting. Intended for non-blocking behaviour, untested for starvation under sustained peer-copy load. - Does the four-surface bundle survive review as one PR? 24 files / +2954 lines across runtime lifecycle, codec/gate, cost model and TLA+/mutation fixtures; the revision added surface rather than splitting.
Not found / could not verify
- No CI run, check suite or status for
68fe22fdis reported anywhere in the item, and no re-review exists, so nothing confirms the new head compiles or passes on the repo's own gates. - No reviewer, assignee, or
@yatesdracknowledgement of the lock-order reversal. - No benchmark for buckets 2 and 3, and no simulator curve sweep for bucket 3 — the PR says so explicitly.
- No evidence that the 20,648-token MTP 5 regression was checked against any other core or model; the single measurement is on one signed
Qwen4-35B-A3Bcore.