Case file — PR #708: fix(helios,ignition): handle decoded VLM feature tokens on continuation readmission and unify index-driven VisionState
https://github.com/NVIDIA/hyperflare-inference/pull/708 — open, "ready for review", head 4fee325, base cc0a49d on main, 7 files, +736 / −56. Author: lukealonso. No labels, no reviews, no comments. CI on 4fee325: passed.
Key findings
- No issue, no prior report, no duplicate PR. Searches over open and recently-closed items for the failure mode (
vision_token_indices image token preemption readmission VLM,feature token decode mask image token crash worker,VisionState validate_prefill image_token injection,validate_prompt_data image admission strict,worker health unhealthy fail all requests model thread) return only #708 itself. The problem statement is entirely self-authored in the description; no issue is linked. The bug is at most as old as the features that created its trigger paths — merged #615 (thinking_token_budgetpark) and merged #626 by the same author (park_grammar_transition). - The description understates a validation-weakening default.
VisionState.__init__now defaultsimage_token=None(ignition/components/vision_state.py:26), which silently disables thetokens == image_tokencross-check for any caller that omits it (:45-46). The description presents this only as "backward-compatible with all recipe call sites passingimage_token=...".validate_prefillalso now acceptsindex == -1on a token that is the image token, i.e. a genuinely indexed image whose index was lost is treated as text rather than rejected. Both are deliberate, argued in prose, but they are weakenings against principle 15 (docs/design-review.md:135-146). - The "9 VLM recipes" blast radius is not verifiable from this repository. At PR head,
VisionStateappears only inignition/components/vision_state.py:25andtests/components/test_vision_state.py; no recipe and noimage_token=...call site exists in-tree. Official recipes live in the externallocal-inference-lab/hyperflare-recipesrepo (AGENTS.md:382-396), so the effect of theinject/validate_prefillsemantics change on real recipes cannot be checked from the PR. - Second, broader change the description frames as incidentals:
Worker::admitno longer propagatesAdmission,TokenStopsandTextStopserrors out ofWorker::run(helios/src/server/runtime.rs:1633-1683). Before, any malformed stop string, out-of-vocabulary stop sequence, or bad prompt geometry terminated theflare-modelthread (catch_unwind+worker_health.store(false)atruntime.rs:796-807) and failed every co-resident request. This is a general reliability fix for all text deployments, not just VLMs, and its regression surface is wider than the VLM story. Also fixed incidentally:self.admissions[slot]is written only after the stop matchers are built (runtime.rs:1717). - Evidence is honest but weaker than sibling PRs and misses the layer the compatibility claim rests on. The author reports 7 failing helios tests (6 needing
FLARE_TEST_TEMPLATE_DIR, 1 aulimit -lartefact), whereas #697 reported 1,900 passed / 0 failed and #483 1,913 / 0 failed; GPU/CUDA, checkpoint-backedimage_admission, and live VLM core re-export +flare runserving were not run — yet the compatibility claim ("legacy token-keyed cores … fail only the affected request cleanly,ExecutionError::Device { code: 32 }") is exactly a serving-path claim, asserted from reasoning.cargo-kaniandcargo-mutantswere not run although the PR changes an admission validator and adds guards. - No documentation is updated (all 7 files are code + tests). The new continuation-validation invariant lives only in the doc comment at
helios/src/model.rs:410-413. Comparable runtime PRs updated docs (#697: four doc files; #483:helios/README.md(not opened) +docs/runtime-core-design.md(not opened)), so design docs may still describe "strict bijection over the whole prompt". - Base drift in the diff viewer. ~10 files appear in the diff that are not in the PR's 7-file list (AGENTS.md,
docs/*,flare-cli/src/*); e.g.preserve_message_anchor(helios/src/server/runtime.rs:50-52,helios/src/server/request.rs:427-429) is #697's merged work re-shown as added.pr_filesis authoritative; this is stale-base artefact, not hidden scope. - Zero community engagement so far (
pr_comments: "No comments"), while sibling PRs by other contributors drew aflare-autobotcase file and Autobot Review within ~90 minutes. Interest is unmeasured.
The change
Three production files, four test files (pr_files):
ignition/components/vision_state.py(+16/−8).__init__signature becomesimage_token=None(:26).validate_prefill(:38-49) is now index-driven:visual = index >= 0; valid =(index == -1) | (visual & index < count[slot] & index < arena.shape[1]); thetokens == image_tokencheck applies only& ~visualand only whenimage_tokenis set (:45-46); generation andfeature_slotbounds checks are gated on~visual(:47-48).inject(:51-61) replaces embeddings wherevisual = (index>=0)&(index<arena.shape[1])&(feature_slot>=0)&(feature_slot<arena.shape[0]); it no longer readsmetadataat all.helios/src/model.rs(+51/−13).validate_prompt_data(:406-408) now delegates to the newvalidate_continuation_prompt_data(config, tokens, data, initial_prompt_tokens)(:414-493), so existing callers keep strict whole-prompt semantics. New boundary rules: rejectinitial_prompt_tokens == 0 && !tokens.is_empty()andinitial_prompt_tokens > tokens.len()(:421-422); nonnegative vision indices only below the boundary (:427-439); spans must satisfys.end <= initial_prompt_tokens(:440-445); the continuation suffix must be< config.contract.vocabulary(:446-448); the feature-token bijection applies inside0..initial_prompt_tokensand continuation positions must haveindex == -1(:452-467); the atomic-span membership scan is scoped totokens[..initial_prompt_tokens](:468-487). Invariant documented at:410-413.helios/src/model/admission.rs(+34/−2).Admission::validate→validate_continuation(config, initial_prompt_tokens)(:72-111);Admission::from_prompt→from_continuation(..., initial_prompt_tokens, ...)(:122-163); both old names remain as delegating wrappers.helios/src/server/runtime.rs(+71/−33).Worker::admitcomputesinitial_prompt_tokens = parked.carried.prompt_tokens.unwrap_or(incoming.prompt.tokens.len())(:1629-1632), callsAdmission::from_continuation(:1633), and turns the three former?sites intoself.scheduler.cancel(handle)?; incoming.fail(error); progress = true; continue(admission:1641-1648,TokenStops:1652-1663,TextStops:1667-1683);self.admissions[slot] = Some(request_admission)moved to:1717.- Tests (+564):
helios/src/model/tests.rs:2461continuation_prompt_validation_permits_decoded_in_vocab_image_and_span_tokens_only_after_initial_prompt;helios/src/server/runtime/phase_tests.rs:9035vlm_feature_token_survives_preemption_and_thinking_budget_readmission,:9217vlm_feature_and_span_tokens_survive_grammar_transition_readmission,:9326worker_admit_isolates_admission_and_stop_matcher_failures_without_killing_worker;tests/components/test_vision_state.py:77test_unindexed_feature_tokens_remain_text_during_validation_and_injection,:128test_index_only_vision_state_without_image_token.tests.rsalso gains ~13 mechanicalpreserve_message_anchor: falseliteral additions (base drift, see below).
Description-vs-code: everything the description promises is present. Nothing material is done that the description omits, except (a) the image_token=None default's weakening effect, (b) the index == -1-on-image-token acceptance, and (c) the generality of the error-isolation fix. Nothing in the description is missing from the diff.
Mechanics confirmed in code: the appended continuation positions really are -1 because PromptMetadataMut::extend_text does indices.resize(after, -1) (helios/src/model/admission.rs:25-56), called from Worker::park_with_tokens (runtime.rs:2525-2527), which stores Carried{prompt_tokens: Some(active.carried.prompt_tokens.unwrap_or(prompt_tokens))} at runtime.rs:2550 — the exact value Worker::admit now reads, and unwrap_or preserves the original boundary across repeated parks (asserted at phase_tests.rs:9084).
The why
The reported bug: for VLMs whose image feature token is inside the decoded vocabulary (Nemotron-H, GLM-5.3, Qwen3.8, Qwen3.8-Dense, Inkling2, Kimi3, MiMo-V2, MiniMax-M3, Step5), Helios does not mask the feature token at decode, so text decode can sample it or an in-vocabulary atomic span delimiter. On the next park (park_if_preempted, park for thinking_token_budget, park_grammar_transition), the tokens are appended to prompt history with vision_token_indices = -1; on readmission the pre-change validate_prompt_data bijection (*token == layout.feature_token) == (*index >= 0) and atomic-span membership failed over the whole tokens slice, the Err propagated out of Worker::run, worker_health went false, every request on that worker failed, and the flare-model thread died (runtime.rs:645-647, :796-807). Second failure: the shared Ignition VisionState keyed validate_prefill/inject on the token id rather than the index, so relaxing Helios alone would let an unindexed decoded image_token overwrite its text embedding with an arena feature.
Duration and breadth of the want: no recorded history. No issue, PR, or comment in the searchable window describes this failure. The trigger paths are recent: park (thinking budget) from merged #615 (newjordan), park_grammar_transition from merged #626 (lukealonso, same author), pipelining constraints from merged #619. The affected recipe population lives outside this repo (AGENTS.md:382-396), so it cannot be counted here. This reads as an owner-found follow-up to his own grammar-transition feature (#626), not a long-standing community ask.
Related work
- #483 (open, rickybrent, +2349/−255, 39 files) "Add Gemma 4 image preparation, Bracketed patch-width metadata, and atomic spans" — the nearest same-code work: touches
helios/src/model.rsandhelios/src/server/runtime.rs, and is the other half of the feature-token/ImageSpansurface. It adds/tightens span handling forBracketedlayouts while #708 relaxes span validation on the continuation suffix. Semantically compatible (disjoint ranges: initial prompt vs continuation), but textual conflict risk inhelios/src/model.rsnear the span/feature-token checks. Neither merged. - #626 (merged, lukealonso) "Allow speculative reasoning for grammar-constrained requests" — introduced
Worker::park_grammar_transition, one of the three park paths #708 fixes. #708 is a direct follow-up bug fix. - #615 (merged, newjordan) "support
thinking_token_budgetfor ContentHeaders and trim incomplete UTF-8 tails on cut" — ownsWorker::parkandtrim_incomplete_utf8_tail(runtime.rs:2465); second park path. - #619 (merged, lukealonso) "Unlock multi-token speculation and two-frame pipelining for host stops" — source of the width-1 / 2-frame-pipelining constraint the description cites as the reason decode masking is not enabled.
- #579 (merged, lukealonso) VLM teardown/PatchMerge validation; #620 (merged, lukealonso) legacy-core loadability — the same genre and the precedent the compatibility claim leans on.
- #621 (open, jcartu) "Validate scheduler admission against the core parameter declarations" — edits the
Worker::admit/admission-validation path inruntime.rs; potential rebase interaction, not a duplicate. - #697 (merged, FujitsuPolycom, 2026-12-03) interior anchor /
preserve_message_anchor— appears in the diff only as base drift. - Author's other open PRs #707, #668, #659, #658 — #707 and #668 touch ignition/flare-cli but share no file; not stacked on #708.
- Checked and not related beyond shared files: #691, #692, #694, #674, #705, #698, #663, #628, #607, #505, #548/#549/#560, #576, #554/#334, #301, #102, #504, #540, #497.
Recent activity
search_history and the orientation packet's per-area commit lists are broken on this checkout (git: Could not read c513e46a…, cannot simplify commit ef38cb93…) — a tooling limitation, not an absence of activity. Substitute evidence from items_touching:
helios/src/server/runtime.rs: ≥29 PRs in 180 days, including #697 merged the day before (2026-12-03 01:18, ~16h before #708 opened), plus #663, #628, #626, #620, #619, #615, #607, #497, #505, #579; #691/#692/#705 are open in the same file. Hot file, fast-moving.helios/src/model/admission.rs: only #708, #626 (lukealonso), #505 (jcartu) — quiet.ignition/components/vision_state.py: no other toucher in 180 days — the token-keyed design has not been revisited and there is no in-flight competitor for this refactor.- #708 builds on #626/#615/#619/#579 and does not reverse them; the only "reversal" is of strict whole-prompt validation, which #483 is tightening for the initial prompt — disjoint, so they should compose.
People
- Author: lukealonso, COLLABORATOR. The charter names
@lukealonsoas a priority contributor.docs/design-review.md:22-26names project owner Luke Alonso lalonso@gmail.com, the approver for captured-graph operation families — i.e. the author is the project owner. 180 days: 41 merged, 0 closed, 4 open; merged PRs inhelios/src(28),docs(23),ignition/preparation(14),flare-cli/src(10),tests/preparation(10). He authored the very machinery this fixes (#626, #619, #620, #579, #607, #670, #683). Discussion contactDiscord: lukealonsogiven (principle 17,docs/design-review.md:163-169). - Other people in these areas:
runtime.rshas the widest contributor set — jcartu, yatesdr, FujitsuPolycom, WynnD, rickybrent, fordbmorris, ebfio, ateska, javieratomic, shadownetX.vision_state.pyhas no other recent toucher. - Engagement: none. No reviewers assigned, no reviews, no inline comments, no labels. For comparison, sibling PRs opened by others (#697, #483) drew a
flare-autobotcase file within minutes and an Autobot Review within ~90 minutes; #708 had none at case-file time.
Community
pr_comments returns "No comments". No reactions recorded. The change has drawn no attention either way, so there is no third-party corroboration of the bug, the fix, or the recipe blast radius. The PR text contains no instructions directed at agents or reviewers (nothing to flag on that front); it follows the repo's required description scheme (why / what / claimed result / evidence, docs/design-review.md:147-162) closely and discloses unrun checks.
Project fit
Lines up:
- Principle 3 (
docs/design-review.md:40-61): "Admission, page reservation and growth, eviction, preemption, readmission, and offload must not branch on model or recipe identity or capability flags" — the change adds no model branch; the description invokes exactly this plus principle 13 as the reason a capability flag (to distinguish index-drivenqwen38from token-keyedqwen38_dense, identicalModelContractmetadata) is disallowed. - Charter line 12 ("keep the runtime small and model-agnostic … shouldn't accumulate per-model branches", #267/#334) — satisfied.
- Principle 12 (
:106-115) disclosure: unrun checks are explicitly listed. - Principle 13 (
:116-123) field compatibility: no Protobuf/ModelContractchange, old cores load. - AGENTS.md:388-396 restricts
ignition/components/to 12 Helios-ABI modules;vision_stateis explicitly one of them (:391), so editing it is in bounds.
Tension:
- "Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)" — the literal root cause ("Helios does not mask image feature tokens during decode") is deliberately left in place; the change scopes validation and isolates errors. Defensible as "fail one request cleanly", but a reviewer applying the rule strictly could read it as declining the root cause. The description argues the root-cause paths (a decode mask, or model-identity branching) are blocked by captured-graph op-contract rules and principles 3/13.
- Principle 15 (
:135-146, "weaken numerical or lifetime contracts", "do not make a violating contribution acceptable by weakening its governing rule") — theimage_token=Nonedefault and theindex == -1-on-image-token acceptance are weakenings. - Principle 13's stronger clause "Validate previous cores through loading and serving" is unmet by the author's own account (no
flare run/ re-export was executed). - The charter roadmap (line 21: SM103/SM120/SM121 captured-graph serving) says nothing about VLM; no GPU verification here.
Claims and evidence
| Claim | Backing | Gap |
|---|---|---|
| Decoded in-vocab feature/span tokens no longer kill the worker on KV preemption, budget, or grammar-transition readmission | Three new phase tests (phase_tests.rs:9035, :9217, :9326) + one model test (tests.rs:2461); targeted run 4 passed / 0 failed |
CPU Fixture-driven only, no GPU |
| Malformed admission/stop inputs fail only one request with full slot/page reclamation | worker_admit_isolates… loops over the three failure sites; code at runtime.rs:1641-1683, :1717 |
Same |
Re-exported cores validate/inject solely by vision_token_indices >= 0 |
vision_state.py:38-61; 2 new component tests (test_vision_state.py:77, :128), 5 passed; components+cli 336 passed / 56 skipped |
The 9 recipes are external; nothing in-repo consumes VisionState |
Legacy token-keyed cores keep working, failing only the affected request (ExecutionError::Device { code: 32 }, active = False) |
Reasoning only | No GPU test, no checkpoint-backed image_admission test, no live re-export + serving |
| Rust suites green | helios lib: 1,837 passed / 47 ignored / 7 failed (6 need FLARE_TEST_TEMPLATE_DIR, 1 ulimit -l artefact re-run clean); flare 255/0; flare-cli 246/0; heliopause 229/0 |
7 failures vs. 0 in peer PRs (#697 1,900/0, #483 1,913/0); the template env var is normally populated in CI via tests/frontend/prepare_templates.py (not opened) |
| Formal/lifecycle conformance | verification/helios-lifecycle/check.py (not opened) all models passed, reported edge counts incl. ResponseLifecycle 365,508, CacheOwnership 222,817 |
— |
Feature-matrix cargo check clean |
default / runtime-core / runtime-core,server, 0 warnings in modified files |
— |
| Kani + mutation testing | Not run (tools not installed) | Required by docs/design-review.md:221-228 for sequential validators / new safety guards, so the testing hierarchy's top layer is partly unmet |
No performance claims are made. The code: 32 device-error behaviour is the single load-bearing unmeasured claim.
Reach
- Who is affected: any deployment serving a VLM whose
feature_tokenlies inside the decoded vocabulary (nine recipes named, all external). Today one such request, after a park, kills theflare-modelthread and every co-resident request; after this PR it is re-admitted and the decoded tokens stay text. - Broader: every text deployment gets the per-request admission/stop-matcher error isolation (
runtime.rs:1641-1683) — previously a bad stop string or prompt geometry killed the worker. Also the half-populatedadmissions[slot]window is closed (:1717). - Configuration / defaults / wire: no Protobuf,
ModelContract, config key, or CLI flag changes; operators need do nothing. Only Python-level default change:image_token=None(vision_state.py:26). - Compatibility: no re-export needed to load old cores; index-driven
qwen38cores get the readmission fix immediately; legacy token-keyed cores need re-export to re-prefill an unindexed decoded feature token as text — until then that request fails cleanly instead of corrupting embeddings. Better than today (fatal), not parity. - Dependencies / deployment: none.
- Documentation: none updated — the invariant lives only at
helios/src/model.rs:410-413. Reviewers should check whetherdocs/core-design.md/helios/README.md(not opened) still describe whole-prompt strict bijection.
Process
Open, marked ready for review, opened 2026-12-03 17:09, same-day age at case-file time. CI passed on head 4fee325. No labels, no reviewers, no reviews, no comments. Description carries the four required parts plus a Discord: lukealonso line. No Design-Signed-Off-By: trailer observed (cannot be confirmed from the description).
Open questions / not found
- Who has actually hit this in production, and how often? No issue, no report, no reproduction log outside the synthetic phase tests.
- Do the nine named recipes really all use
ignition.components.vision_state.VisionState, and do they passimage_token=? Not answerable in this repository (external recipe repo, AGENTS.md:382-396). - Does any in-repo or external caller rely on the old
injectbehaviour of copying features wherever the token id matched butvision_token_indices == -1? That pattern now becomes text, silently. - Interaction with #483 in
helios/src/model.rs— textual conflict unverified (both unmerged; no merge-base test possible here). - #483 may hold the better long-term answer for atomic spans on the initial prompt; whether #708's continuation relaxation composes cleanly with it has not been demonstrated.
- Commit-level history of the touched files is unavailable on this checkout (
search_historygit failure), so "no competing work landed in the last 60 days" is inferred fromitems_touching, not from commits. - Whether CI ran the helios suite with
FLARE_TEST_TEMPLATE_DIRpopulated (which would reconcile the 7 reported failures with CI green) is not recorded anywhere the case file can read.