Recommendation: Ready To Merge
PR #708 does exactly what it claims, at the right layer, with no per-model branching and no core-format change. I verified every load-bearing site at 4fee325 — the continuation validator (helios/src/model.rs:406-493), the two Admission entry points (helios/src/model/admission.rs:71-163), the Worker::admit boundary derivation and three error-isolation arms (helios/src/server/runtime.rs:1629-1717), and the index-driven VisionState (ignition/components/vision_state.py:38-61 with tests/components/test_vision_state.py:77-141) — and found no verified code bug: strict initial-prompt semantics are exactly preserved, -1 continuation indices pack cleanly through feature_index (helios/src/scheduler.rs:283-299, helios/src/model/packing.rs:711-725), failed admissions fully reclaim slot/pages, and admissions[slot] is no longer visible half-built. The only material gap is evidence, not code: the legacy token-keyed core compatibility claim (ExecutionError::Device { code: 32 }) was reasoned, not measured, which I raise as an explicit pre-merge WARN rather than a blocker since the author disclosed it and no core format, metadata, or storage contract changed.
Merge Risk
Level: Low
- Admission/readmission logic in a hot, fast-moving file (
helios/src/server/runtime.rs: ≥29 PRs in 180 days) is restructured (+71/−33), but the newphase_tests.rs:9035-9385cases drive the realWorkerloop through preemption (with and without checkpoint eviction),thinking_token_budget, grammar transition, and all three failure sites. - The load-bearing compatibility claim for already-exported token-keyed cores is unmeasured on GPU (
code: 32,active = False, no embedding corruption); failure mode is documented as clean single-request failure, not worker death. ignition/components/vision_state.pysemantics change for 9 external recipes that are not in this repository (AGENTS.md:382-396); in-tree blast radius is zero (image_token=appears only intests/components/test_vision_state.py:18,40,56,82), and legacy cores keep working until re-exported.
Walkthrough
- Helios prompt validation split by boundary (
helios/src/model.rs:406-493):validate_prompt_datanow delegates withtokens.len(), so the feature-token bijection (:452-467) and atomic-span membership scan (:468-487) keep their exact old domain on0..initial_prompt_tokens; continuation positions must carryindex == -1(:459-464) and be< config.contract.vocabulary(:446-448), with boundary rejections at:421-422guarding both slices against panics. - Boundary threaded through admission (
helios/src/model/admission.rs:76-111,140-163):validate_continuation/from_continuationadded,validate/from_promptretained as strict delegating wrappers;input_vocabularybound at:95still rejects out-of-range prompt tokens before the new data checks. - Worker readmission boundary (
helios/src/server/runtime.rs:1629-1717):initial_prompt_tokenscomes fromCarried::prompt_tokens, whichpark_with_tokenspins to the original prompt length (:2550), so repeated parks cannot drift the boundary (assertedphase_tests.rs:9186). - Per-request error isolation (
runtime.rs:1641-1683): the three former?sites becomescheduler.cancel(handle)? → incoming.fail(error) → progress = true → continue, which atincoming.failalso wakes the admission waiter (runtime.rs:351-362);self.admissions[slot]is written only after all three constructions succeed (:1717). - Index-driven
VisionState(ignition/components/vision_state.py:38-61):validate_prefillkeys onvisual = index >= 0with slot/count/generation/feature-slot checks gated onvisual, andinjectreplaces embeddings on(index >= 0) & index < arena.shape[1] & feature_slot in [0, rows), so an unindexed decoded feature token stays text in both paths.
Pre-merge Checks
- [PASS] Security / malicious screen: No agent-directed text in the body or comments; the PR body follows the required why/what/result/evidence order and adds no scripts, sockets, or credentials.
- [PASS] Charter & value fit: No model branch, flag, proto,
ModelContract, config, or CLI change;ignition/components/vision_state.pyis one of the 12 permitted Helios-ABI modules (AGENTS.md:388-396); the error-isolation half is a genuine#397-shaped fix that also protects plain text deployments. - [PASS] Related / duplicate / conflict check: No issue, prior report, or duplicate in the searchable window; #483 tightens initial-prompt spans while #708 relaxes only the continuation suffix (disjoint ranges), #621 is a rebase interaction, #626/#615/#619 are the trigger paths this fixes.
- [WARN] Tests & verification evidence: Crate, component, and lifecycle layers are reported green and the TLA+/conformance and Kani gates are covered (
Kaniruns in CI forhelios/**,.github/workflows/helios-lifecycle.yml:36-47(not opened); the 6 template failures are explained by.github/workflows/native-serving.yml:28-31 (not opened),59and the memlock failure by:61-62) — but principle 13's "validate previous cores through loading and serving" (docs/design-review.md:116-123) is not met for the legacy token-keyedcode: 32claim: noflare run, no legacy-core replay, no checkpoint-backedimage_admission, no GPU. Either run it before merge or state that legacy-core re-prefill behavior is expected but unmeasured.
Blockers
None.
Should Fix
None.
Subtract / Simplify
helios/src/server/runtime.rs:1649-1716— the three isolation arms (:1642-1647,:1657-1662,:1677-1682) are byte-identical, and only the two stop-matcher arms force theParkedliteral one indentation level deeper.TokenStops::new/TextStops::newdepend on nothing the admission produces, so hoisting both aboveAdmission::from_continuationcollapses the structure to one cancel-and-fail site and restores a flatmatch parked(≈−30 lines, two indentation levels). Note this is maintainability only: those two arms are already unreachable in production because the same prompt and config were validated athelios/src/server/request.rs:336-339andruntime.rs:949-957, andworker_admit_isolates_...(phase_tests.rs:9353-9357) mutatesprompt.stop_sequencesafter preparation.ignition/components/vision_state.py:44-48— three successivevalid &= ~visual | …lines restate the single conjunctioninjectalready builds at:55-60; collapsing them (keeping the testedindex == -1vsindex < -1distinction attest_vision_state.py:111-112) also removes the duplicatedfeature_slotbounds expression.helios/src/model/admission.rs:72-74,122-137—Admission::validateandAdmission::from_prompthave no production caller left after this PR (runtime.rswas the last one); keep them only if they are intended published API, otherwise delete with their wrapper-only assertions atmodel/tests.rs:2521andphase_tests.rs:6412.
Nits
ignition/components/vision_state.py:26,45-46—image_tokennow defaults toNone, which silently drops thetokens == image_tokencross-check for a caller that omits it, andvalidate_prefillacceptsindex == -1on a token that is the image token (intended here, but a relaxation in two directions). It is deliberate, documented, and both modes are tested (test_vision_state.py:128-141), and requiring the kwarg could be wrong for span-only layouts — so this is optional hardening: if token-keyed cores are meant to keep the cross-check, makeimage_token=Nonean explicit opt-in rather than a default.ignition/components/vision_state.py:51—inject(self, metadata, embedding)no longer readsmetadata(previously used for the token-id gate); the parameter is now dead weight at every call site.helios/src/model.rs:446-448— the suffix bound usesconfig.contract.vocabularywhile every other input-side check in the admission path uses the widerinput_vocabulary(admission.rs:95,contract.rs:581,589). Using the sampling tier is the defensible choice (nonsampled sentinels beyond it must never appear in a decode continuation), but a one-line comment saying so would stop the next reader from "fixing" it.helios/src/model.rs:421-450— the boundary checks and the geometry/span/vocabulary checks share one message ("prompt arrays violate prepared geometry"); a distinct message forinitial_prompt_tokensmisuse would make a future field report diagnosable.helios/src/server/runtime.rs:1642-1647— admission-class failures are surfaced withincoming.fail(GenerationEvent::Error, the 5xx path) rather thanincoming.reject_admissionas at:1573; unreachable today, so only consistency.
Dropped on verification
- "
model.rs:448is wrong: it should bound byinput_vocabulary" (Code-Correctness Finding 1, Minor/latent). Dropped as a defect. The counterexample requires a forced reasoning-close token in[vocabulary, input_vocabulary), but close tokens come fromfrontend.encode(&syntax.close)(helios/src/server/request.rs:589, viathinking_budget_close) — tokenizer ids for a delimiter the model itself samples to end reasoning, hence inside the sampled range; andignition/preparation/contract.py:159(not opened) defaultsinput_vocabulary = vocabulary, so no shipped core can even reach the branch. Worse, the suggested change would be a real regression: Deepseek row-major sentinels start exactly atconfig.contract.vocabulary(helios/src/model/prompt.rs:79-96), i.e. the[vocabulary, input_vocabulary)range is precisely the nonsampled image sentinels a decode continuation must never contain. Kept only as Nit 3. - "Helios reported 7 failures vs peers' 0 — weaker evidence." Resolved from the workflow:
native-serving.yml:28-31generates the template fixtures and:59,67,72,76exportFLARE_TEST_TEMPLATE_DIR;:61-62raises memlock. Environment artifacts, not failing tests. - "Kani and mutation testing were skipped." Kani runs in CI on every
helios/**PR (.github/workflows/helios-lifecycle.yml:36-47(not opened)) and passed on4fee325; the mutation catalog (verification/helios-lifecycle/check.py:417-677) targets scheduler/cache/dispatch/offload/response-admission lines and does not touch the changed ones. No runnable CPU gate skipped, anddocs/design-review.md:247-251governs the CPU layers, which were run. - "
docs/core-design.md/helios/README.md(not opened) may still state whole-prompt bijection — docs not updated." No doc states it: searchingdocs/forbijection,validate_prompt_data,vision_token_indicesyields nothing, anddocs/core-design.md:486-489already specifies that readmission "extends text-position and image-index metadata for generated tokens" — the PR implements documented behavior, so no normative doc is contradicted or stale. - "Triplicated isolation block +
progress = trueinconsistency atruntime.rs:1573(rated High)." The:1573path predates this PR (incoming.reject_admissionon the scheduler's own admissionErr, before any slot or page is held), so it is not introduced or contradicted here; the duplication is a size/maintainability point, moved to Subtract 1 rather than a bug. - "
validate_prefill/injectcan overwrite a text embedding or inject a stale feature (Major)." Not reachable: canonical indices originate from Helios packing (packing.rs:711-725→scheduler.rs:283-299), are always-1for continuation positions (admission.rs:25-56, asserted packed atphase_tests.rs:9131-9142), andvalidate_prefill's predicate family matchesinject's, so the two cannot disagree on which row is visual. The "stale nonnegative tail index" case is gated byfeature_slotand covered bytest_vision_state.py:117-125. - "Diff shows ~10 extra files (AGENTS.md, docs/, flare-cli/src/,
preserve_message_anchor)." Stale-base artifact of merged #697;pr_files(7 files) is authoritative and every promised change appears in them. - "Mandatory GPU/TLA+/A-B verification gate violated." Not a blocker: no performance claim, no core-format/metadata/storage change, and the lifecycle layer (admission, cancellation, readmission, response ownership) was run and reported passing; the serving-path compatibility claim is a disclosed, GPU-only gap, recorded as a pre-merge WARN.