Case file — PR #683 ignition: propagate CLI prog, move image specs to recipes, and harden state.py kernels
Author: lukealonso (GitHub COLLABORATOR; Discord lukealonso). Branch unify-ignition-recipe-boundary → main, head 70e84eba, open, "ready for review", 8 files, +406 / −148.
Key findings
- Three unrelated changes are bundled in one PR (scratchpad #1, verified in diff): CLI
progpropagation (ignition/registry.py,ignition/cli/__init__.py,ignition/preparation/rebuild_manifest.py), theImageProcessorSpecrefactor ofignition/preparation/frontend.py(+170/−122 of the total), and Triton kernel hardening inignition/components/state.py. They share no code path, no test file and no risk profile; the state.py half touches GPU kernels, the other two are Python-only. - "Move image specs to recipes" is only partial, and the PR says otherwise. The profile registry and the wire-payload schema stay in core:
IMAGE_PROFILESis still a closed 8-name frozenset atignition/preparation/frontend.py:26-35,ImageProcessorSpec.__post_init__rejects any other profile (frontend.py:59-61), and_validate_image_payloadstill hardcodes the payload schema fordeepseek_row_major,qwenandmimo(frontend.py:154-202). Only the per-checkpoint field tables,model_typestrings and token IDs actually moved out (scratchpad #2, #4, #10). - It lands in the middle of two open PRs that extend the very table it deletes. #483 (rickybrent, gemma4) inserts
if profile == "gemma4":atignition/preparation/frontend.py:114-173of its own head; #229 (Raydius, muse_glimmer) insertsif profile == "muse_glimmer":atfrontend.py:151-166. Both are textual conflicts with #683's wholesale rewrite, and — worse — structurally cannot be expressed through the new spec:ImageProcessorSpec.extractis typedCallable[[Mapping, Mapping], dict](image, model only), while #483 openstokenizer.json(not opened)/tokenizer_config.json(not opened) from the snapshot to validate envelope token IDs. So #483 would need another core edit to land after #683 (scratchpad #3 — the most important cross-PR finding). - Two Helios wire profiles are not representable by the new "recipe-owned" contract.
helios/proto/runtime_core.proto:613-626defines 10ImageSettingsoneof tags includingstep=5 andpatch_merge=9; #683'sIMAGE_PROFILEShas 8 and_validate_image_payloadhas no branch for those two. Not a regression (the old code had the same 8-name limit), but it caps the claim (scratchpad #4). - The PR has no review, no comments and no CI checks on its head commit; the only evidence is a self-reported pytest run (164 passed on an RTX PRO 6000 Blackwell SM120).
flare inspectin Rust formatsreproduction_argsgenerically (flare-cli/src/inspect.rs:453-472) and no Rust reader assumesargv[0] == "ignition", so the prog change is wire-compatible and the "no Rust files changed" statement is consistent (scratchpad #6, #8, #10). - Undeclared behaviour in the frontend refactor (scratchpad #2): new
requires_preprocessor/default_preprocessorknobs (frontend.py:55-56,290-294) that let a recipe suppress readingpreprocessor_config.json(not opened) for any profile, and_validate_image_payloadnow actively rejects non-empty payloads for the five "empty" profiles (frontend.py:157-160) — a new validation that did not exist before. - The state.py half does not close the open project TODO on the same kernels.
docs/TODO.txt:366-367asks to "Guard or stride the 65,535 × 1024 gridDim.y ceiling in ignition/components/state.py row kernels"; #683 widens indices totl.int64but leaves the 2-D launch and its unbounded second grid dimension in place (state.py:102-103,182-184). The description never mentions it (scratchpad #5).
The change
Verified file-by-file (scratchpad #1).
1. CLI prog propagation — small, well-contained.
ignition/registry.py:27-39adds_ACTIVE_PROGContextVar (default"ignition") pluscurrent_prog();registry.py:52-60adds theactive_prog(prog)contextmanager, which raisesValueErrorfor an empty or non-str name.ignition/cli/__init__.py:364-372binds it:with active_recipes(recipes), active_prog(prog), bind_source_roots(source_roots):.ignition/preparation/rebuild_manifest.py:231reproduction_arguments(..., prog=None)and:288from_plan(..., prog=None)now computeprogram = current_prog() if prog is None else prog(:262) and emit[program, 'export', target, *params.reproduction_args(context)](:263).
2. ImageProcessorSpec — the bulk of the diff.
- Deleted: the hardcoded
image_settings(config, model, profile, qwen_model_type="qwen4_exp")table onmain(ignition/preparation/frontend.py:92-..., withqwen_model_typeused at:175,:224,:250), which carriedmodel_typestringsinkling2,inkling2_loop,glm5_next,qwen4_exp,mimo_v2, processor class names and literal token IDs154854,154855,18,151655. - Added: frozen dataclass
ImageProcessorSpec(frontend.py:40-67) withprofile,label,processor_fields,image_processor_key,image_processor_fields,image_processor_exact_keys,image_processor_optional_fields,size_fields,model_fields,model_types,vision_fields,requires_preprocessor,default_preprocessor,extract;_validate_image_payload(profile, payload)(frontend.py:154-202);image_settings(config, model, spec)(:205-243) which raisesTypeErroron a non-spec;prepare_frontend(..., image_spec=...)(:263-296) which raisesTypeErrorfor a non-spec and forimage_profilecallers (the old keyword is gone entirely). - Tests: new
tests/preparation/test_frontend_spec.py(104 lines) covering spec validation,TypeErrorpaths,default_preprocessor, and the deepseek prompt-encoder/profile mismatch.
3. state.py kernel hardening.
tl.int64casts on every row/slot/column index in_gather_rows,_gather_rows_three,_scatter_rows,_save_hidden,_request_history(ignition/components/state.py:112-114,140-142,196-201,209-214,242-254).scatter_rows(..., *, memory_capacity=None, allow_zero=False)(state.py:165-189), with dtype/device/size validation (:175-179); the Triton kernel gainsMemoryCapacity+HAS_CAPACITY/ALLOW_ZEROconstexprs (:193-203):limit = tl.load(MemoryCapacity).to(tl.int64) if HAS_CAPACITY else SLOTSandin_bounds = (selected >= 0) if ALLOW_ZERO else (selected > 0). The oldSLOTS: tl.constexprremains, but only as the no-capacity fallback.- Tests:
tests/components/test_state.py+62, incl. a CUDA test gated onFLARE_RUN_CUDA_TESTS=1that bumpsmemory_capacitywithout recompiling and asserts slot 0 is untouched.
What the description says that the diff does not do (scratchpad #2): the claim "This PR keeps core ignition strictly at the 12 Helios-ABI modules in ignition/components/" describes an invariant already enforced by tests/preparation/test_core_boundary.py:39-63 (13 names including __init__); #683 neither changes that test nor adds a module. No plugin discovery is added — verified: no importlib/entry-point scan, ignition.recipes/hyperflare_recipes imports still forbidden by the boundary test.
What the diff does that the description does not say: see Key finding 6, plus the new always-read of config.json (not opened) (frontend.py:282) and the exact failure mode (TypeError, not a deprecation warning) for old callers (frontend.py:207-208, 268-269).
The why
- The
proggap is real and verifiable: onmain,progreached onlyargparsehelp/epilog (ignition/cli/__init__.pythreads it through_parser/parse_args), andtests/cli/test_recipe_injection.py:58-75already assertedcustom-ignition export MODEL --helpworks — so a recipe CLI namedignition-jetsonprinted correct help but recordedignition export …in its manifests (scratchpad #8). - The boundary motivation is the documented extraction:
da037284(2026-11-22, same author) "Stage hyperflare_recipes separation, slim core ignition…"; charter "Keep the runtime small and model-agnostic" cites #267/#334;docs/design-review.md:42-46principle 3 gives recipes ownership of "model composition and checkpoint mapping" (scratchpad #7, #9). - The kernel motivation (signed 32-bit offset overflow on 115–215 MiB continuation rows) is arithmetic, not measured: 2^31 / 215 MiB ≈ 10 rows. No end-to-end export/serve run backs it (scratchpad #10).
- The null-slot-0 rule connects to Helios-side work: #659 (open, same author) aliases null continuation row 0 onto a single zeroed VMM granule and requires that nobody write it; StateSlotId allocations start at 1. #683 enforces the same invariant from the Python/Triton side (scratchpad #5).
- No linked issue is referenced in the description; none of the orientation-packet candidates (#668, #533, #545, #675, #678, #574, #659, #658, #646, #229, #483, #398, #622, #581, #518) reports the overflow or the
progbug.
Related work
- #483 (open, rickybrent) — gemma4 image profile. Adds a
gemma4branch to the exact table #683 deletes (head lines 114-173), validatingmax_soft_tokens ∈ {70,140,280,560,1120},model_type == "gemma4",vision_config.model_type == "gemma4_vision", and resolving envelope tokens by openingtokenizer.json(not opened) andtokenizer_config.json(not opened). Payload{"gemma4": {...}}is not in the proto's 10 tags either. Conflict: textual (same block) and structural (extractgets no snapshot/tokenizer access) (scratchpad #3). - #229 (open, Raydius) — muse_glimmer profile. Head lines 151-166, model_type
muse_glimmer, token IDs 200092/200091. Same conflict class; payload not in the proto (scratchpad #3). - #659 (open, same author) — null row 0 aliasing in Helios. Complementary: #683's
allow_zero=Falsedefault reinforces the Rust invariant; no overlap in files (scratchpad #5). - #545 (merged) "ignition: introduce compositional RecipeParameters and dynamic CLI" — the machinery
reproduction_arguments/from_planandprogbelong to; #683 is a follow-up in the same author's series (scratchpad #7). - #518 (closed)
--target-head-quantizationand #533 (open, "New argument to cap the prepared per-request context") and #574 (open, AOT guard serialization) all touchrebuild_manifest.py; #683'sprog=keyword andfrom_plansignature are additive-only for these (prog=Nonedefault), so no signature conflict (scratchpad #8, orientation packet). - state.py kernels: earlier work in the same file by Ricky Brent (
50c876df, "Stride state_transfer._copy_rows tiles within CUDA's gridDim.y limit", #484) touched the same gridDim.y ceiling problem in a sibling module — #683 does not apply that fix tostate.py(scratchpad #5). - Nothing found that #683 supersedes or reverses, other than the two open profile PRs it would block.
Recent activity
ignition/preparationin the last 60 days: 162 commits by lukealonso, plus Martin Vit (52), Eugene Rakhmatulin (36); latest2acc3f3a(#670, 2026-12-02) "parameterize THINK_TAGS reasoning… and propagate peer source roots" — the same author's immediately preceding boundary/propagation PR, one day before #683.ignition/components: #648 (merged, 2026-11-30) "Migrate ignition runtime patches and preparation onto public b12x contracts",50c876df(#484, gridDim.y onstate_transfer), plus engram prefetch work (#566) and capacity work (#555) — the state.py kernels were last meaningfully touched indirectly via #648.tests/preparation: mostly test churn from the same boundary series;9a054b49(#608) "restore catalog validation, CPU Python tests".- #683 builds directly on this series; nothing in the recent activity conflicts with it. It does, however, re-reverse nothing recent.
People
- lukealonso — COLLABORATOR; named in the charter among three priority contributors (@voipmonitor, @original-el8, @lukealonso) who "carry extra weight". 38 merged PRs in 180 days, 3 open (#668, #659, #658). Dominant author in every touched area (ignition 272 commits, tests/preparation 208, ignition/preparation 162, tests/cli 104, ignition/components 108, ignition/cli 83). Prior relevant:
da037284(stage hyperflare_recipes separation), #545 (RecipeParameters/dynamic CLI), #620/#618/#648/#670 (boundary + hardening series) (scratchpad #7). - Authors of the deleted table's entries: yatesdr (#407 GLM), kyonjova (#239 MiMo), FujitsuPolycom (#386 Qwen3.8), nero- (#433 Inkling 2), Jason Cook (
7fe5ac78GLM images), Martin Vit (32ace57fDeepSeek V4.1 row-major), malventano (#381 qwen38 vision) — this PR replaces their inline tables with recipe-supplied specs; not one has commented on #683 (scratchpad #7). - rickybrent (#483) and Raydius (#229) are the two authors whose in-flight work #683 conflicts with (scratchpad #3).
- No one has engaged: 0 comments, 0 reviews, 0 reactions (scratchpad #6).
Community
Nothing to report: "Discussion (0)"; no reviewers requested, no labels, no reactions (scratchpad #6). Interest so far is nil; the deployment-side consumer evidence in the description names two external repos (local-inference-lab/hyperflare-recipes, local-inference-lab/hyperflare-jetson-recipes) and a stated merge order — a coordination claim, not something verifiable from this repo.
Project fit
Aligned:
- Charter "Keep the runtime small and model-agnostic … shouldn't accumulate per-model branches (#267, #334)" — #683 removes per-checkpoint
model_type/token-ID tables from coreignition(charter line 12; scratchpad #9). docs/design-review.md:42-46principle 3 (recipes own composition + checkpoint mapping; only Helios-ABI components inignition/components/);docs/core-design.md:297-309("one native lifecycle serves every model").docs/preparation-development.md:11-43documentsreproduction_argsas aRecipeParametershook serialized byfrom_plan— the prog change extends it without changing the contract.- Charter "Bring real evidence" (#210/#397) and
docs/design-review.md:106-115principle 12 (exercise affected shapes, disclose unrun checks) — the description discloses its unrun items (Rust tests — genuinely unnecessary, no Rust files; full export+serve; multi-GPU TP).
Tensions / limits:
- The profile registry and payload schema remain core-owned model knowledge (Key finding 2/4), so the stated goal is met only halfway.
- Charter "New model recipes … support more than a single checkpoint" (line 37) is not implicated; but a third-party recipe cannot add a profile without editing core, which sits uneasily beside principle 3.
docs/design-review.md:124-130principle 14 restricts Claude-authored low-level CUDA/PTX/Triton changes and the charter says for GPU kernel code "report concrete defects only"; #683 edits four Triton kernel bodies and the description does not state who authored that half — recorded for the reviewer to check, not as a violation (scratchpad #6, #9).
Claims and evidence
| Claim | Verdict |
|---|---|
Hardcoded 'ignition' argv[0] |
Verified — rebuild_manifest.py:263 on main; prog reached only argparse. |
[current_prog(), 'export', …] with optional prog= |
Verified — rebuild_manifest.py:231,262-263,288; test at tests/cli/test_parameters.py:362-368 asserts ignition-jetson argv[0] and an otherwise identical vector. |
| "Removes external recipe identifiers from core" | Partial — model_type strings/token IDs gone; IMAGE_PROFILES name set and _validate_image_payload schemas remain (frontend.py:26-35, 154-202). |
"Preserving the exact Protobuf ImageSettings wire format" |
Verified for the 8 representable profiles — payload dict shapes unchanged; nothing under helios/proto/ in this diff. |
| 32-bit overflow fix across all five kernels | Verified in code and complete (all index casts present); the risk scenario is unmeasured (no export+serve run). |
_scatter_rows no longer bakes SLOTS |
Verified — constexpr kept only as fallback, live limit from tl.load(MemoryCapacity) (state.py:199). |
Null slot 0 protected by default; allow_zero=True opt-out |
Verified — state.py:187,200; CPU + CUDA tests tests/components/test_state.py:90-96,133-146. |
Dynamic memory_capacity honoured at replay |
Verified for the Triton path, incl. capacity bump without recompile; wrong dtype/device rejected (state.py:175-179). |
| "164 passed, 0 failed on SM120" | Self-reported, not reproducible here — no CI checks on 70e84eba. |
"Python callers must pass image_spec" |
Verified, and it is a hard break — TypeError, no deprecation shim (frontend.py:207-208,268-269). |
| "Keeps core ignition strictly at the 12 Helios-ABI modules" | Already true before the PR (enforced by tests/preparation/test_core_boundary.py:39-63); not a change of this PR. |
Reach
- Manifests / Rust consumers:
reproduction_argsis consumed byflare inspect(flare-cli/src/inspect.rs:453-472), surfaced inheliopause/src/export/binding.rs:1107-1108, and validated inhelios/src/runtime_core/preparation.rs:105-112(not opened) (count/text bounds, no argv[0] assumption); protorepeated string reproduction_args(helios/proto/runtime_core.proto:95,191) unchanged. A non-ignitionargv[0] is wire-compatible; no Rust change is needed (scratchpad #8). - Where
progmatters:from_planhas exactly two production callers,ignition/cli/serve.py:237and:338, both inside CLI handlers, socurrent_prog()is bound whenever a manifest is emitted. Both rely on the default rather than passingprog=— a handler run outsidemain()would silently fall back to"ignition"(scratchpad #8). - Python API break:
prepare_frontend(image_profile=..., qwen_model_type=...)andimage_settings(..., profile, qwen_model_type=)are removed outright. No in-repo production caller ofprepare_frontendexists on the PR head, so the breakage lands on the two external recipe repos and their forks — matching the description's stated merge order (this PR first). - Configuration/defaults: new
requires_preprocessor/default_preprocessordefaults (frontend.py:55-56) change which file is read;_EMPTY_IMAGE_PROFILESnow rejects payloads where the old code returned{profile: {}}silently. - Operators:
scatter_rowsdefaults toallow_zero=False, so any existing non-continuation caller writing to row 0 (KV pages) must now passallow_zero=True— the docstring says so (state.py:168-171); the in-repo KV callers were not enumerated here. - Docs: no documentation file is changed by the PR; the external recipe repos need companion PRs (not linkable from this repo).
Process
- Open, marked ready for review, opened 2026-12-02 16:48, last updated the same day; head
70e84eba. - No CI checks on the head commit; no reviews, no comments, no reactions; no labels.
- Evidence offered:
CUDA_VISIBLE_DEVICES=0 FLARE_RUN_CUDA_TESTS=1 pytest tests/preparation/test_core_boundary.py tests/preparation/test_frontend_spec.py tests/components/test_state.py tests/components/test_state_gather_fields.py (not opened) tests/cli→ 164 passed, 0 failed on RTX PRO 6000 Blackwell (SM120). - Declared limitations: no Rust tests (correctly unnecessary), no full
ignition export+flare run, no multi-GPU TP. - Description satisfies the charter's four-part standard (why / what / evidence / limitations).
- Merge order is asserted by the author: this PR before the two external recipe PRs — a coordination dependency, not enforceable from this repo.
Open questions / could not be found
- Who authored the Triton half?
docs/design-review.md:124-130principle 14 makes this a review-relevant fact, and the description is silent. - Are there in-repo
scatter_rowscallers that write row 0 today and would needallow_zero=True? Not enumerated. - Does the
requires_preprocessor=Falsepath produce aprocessor_config={}that every downstream profile validator accepts? Only the profile the recipe selects matters, and no recipe in this repo exercises it. - Will #483 and #229 be rebased onto
ImageProcessorSpec, and if so does the spec need snapshot access inextract? Nothing in the PR, issues or comments addresses this. - No linked issue exists for the
reproduction_args/progbug or for the 32-bit overflow; no user report was found in the searchable window. - What closes
docs/TODO.txt:366-367(gridDim.y ceiling on these same kernels)? Not this PR, and no other open item references it.