Explore scratchpad · NVIDIA/hyperflare-inference #683

Raw Markdown for agents: https://autobot.eidonix.com/p/719d86f3-4e93-49bd-948a-d6ef21a026fa.md

#1 [high] Change: what PR #683 does, file by file

PR #683 "ignition: propagate CLI prog, move image specs to recipes, and harden state.py kernels", author lukealonso (COLLABORATOR), base main, head 70e84eb, 8 files +406/-148, open, ready for review, no reviews, no CI checks.

Three logically separate changes in one PR:

  1. CLI prog propagation: ignition/registry.py gains _ACTIVE_PROG ContextVar + current_prog() + active_prog() contextmanager (defaults "ignition"; rejects empty/non-str with ValueError). ignition/cli/__init__.py:363-376 binds active_prog(prog) in main(). ignition/preparation/rebuild_manifest.py:231 reproduction_arguments(..., prog=None) and :288 from_plan(..., prog=None) emit [current_prog(), 'export', target, ...] instead of hardcoded 'ignition'.
  2. frontend.py: deletes hardcoded per-recipe image_settings(config, model, profile, qwen_model_type="qwen4_exp") table (padded_grid/glm/radio/moonvit/deepseek_row_major/deepseek4/qwen/mimo with literal model_type strings inkling2, inkling2_loop, glm5_next, qwen4_exp, mimo_v2 and token ids 154854/154855, 18, 151655). Replaces with new IMAGE_PROFILES frozenset (same 8 profile names retained), _EMPTY_IMAGE_PROFILES frozenset(padded_grid, glm, radio, moonvit, deepseek4), frozen dataclass ImageProcessorSpec (ignition/preparation/frontend.py:40-67) and _validate_image_payload(profile, payload) (frontend.py:157-...). Breaking signature change: image_settings(config, model, spec: ImageProcessorSpec) and prepare_frontend(..., image_spec=...) replaces image_profile=/qwen_model_type=.
  3. state.py kernels: casts to tl.int64 in _gather_rows, _gather_rows_three, _scatter_rows, _save_hidden, _request_history; scatter_rows(source, rows, destination, active, *, memory_capacity=None, allow_zero=False) (state.py:165-189); _scatter_rows gains MemoryCapacity pointer arg + HAS_CAPACITY/ALLOW_ZERO constexpr and reads live capacity via tl.load(MemoryCapacity); null slot 0 protected by default.

Tests added: tests/cli/test_parameters.py (+7), tests/components/test_state.py (+62, incl. one CUDA test gated on FLARE_RUN_CUDA_TESTS=1), new tests/preparation/test_frontend_spec.py (104 lines).

#2 [high] Change: undeclared/incomplete details found in the diff

Undeclared behaviour changes in #683:

Description says but the change does not do:

#3 [high] Related work: #483 and #229 add profiles to the table #683 deletes

Two open PRs add new image profiles to the exact hardcoded table #683 deletes:

Consequences for #683 (verified against #683's code):

  1. Textual conflict: both PRs insert into the block #683 rewrites wholesale (frontend.py old lines 89-206). Neither is merged, so #683 cannot be a clean rebase for them.
  2. Structural gap, not just a conflict: #683's IMAGE_PROFILES frozenset (frontend.py:26-35) is a closed set of the eight profiles that existed at its base; ImageProcessorSpec.__post_init__ (frontend.py:59-61) raises for any other profile. _validate_image_payload (frontend.py:157+) only handles deepseek_row_major, qwen, mimo and the five empty profiles, and falls through to raise ValueError("unsupported image preprocessing profile"). So a recipe CANNOT introduce gemma4 or muse_glimmer through ImageProcessorSpec without editing core ignition again — the profile names and the per-profile payload schema stay in core.
  3. #483's gemma4 needs data the new spec interface does not carry: extract is typed Callable[[Mapping, Mapping], dict] — receives only (image, model); no tokenizer_config and no snapshot path. #483's validation opens tokenizer.json from the snapshot. So its validation cannot be expressed by an ImageProcessorSpec today. Conclusion: #683 moves per-checkpoint field tables out of core but keeps the profile registry and payload wire-schema in core, and it lands between two open PRs that extend that same table.

#4 [high] Change: core still owns IMAGE_PROFILES + payload schema; 2 of 10 wire profiles missing

helios/proto/runtime_core.proto:613-626 ImageSettings oneof has 10 profile tags: qwen=1, mimo=2, deepseek4=3, moonvit=4, step=5, radio=6, deepseek_row_major=7, glm=8, patch_merge=9 (PatchMergeImageSettings: patch_size, min_pixels, max_pixels, image_mean, image_std, image_token, start_token, end_token), padded_grid=10.

#683's IMAGE_PROFILES (ignition/preparation/frontend.py:26-35) contains 8 of those 10 — step and patch_merge are absent, and _validate_image_payload has no branch that can produce them; any spec with those profile names raises "unsupported image preprocessing profile" (frontend.py:59-61 blocks it at construction). The same 8-name limit existed in the old hardcoded image_settings (old code: if profile not in ("qwen","mimo"): raise ValueError("unsupported image preprocessing profile")), so this is not a regression introduced by #683, but it does mean the "recipe-owned" contract still cannot express two Helios-supported profiles, and the payload schemas for the three payload-bearing profiles (deepseek_row_major, qwen, mimo) remain hardcoded in core _validate_image_payload (frontend.py:157-204) — the description's "move image specs to recipes" moves only the checkpoint field tables, not the wire-payload schema or the profile registry.

#5 [high] Related work: state.py row kernels have an open TODO (gridDim.y) and #659 shares the null-row-0 invariant

docs/TODO.txt:366-367 carries an open project TODO against exactly the kernels #683 edits: "[ ] Guard or stride the 65,535 * 1024 (~64 MiB/uint8 row) gridDim.y ceiling in ignition/components/state.py row kernels." #683 changes index widths (int64) in those kernels but leaves the 2-D launch unchanged: _gather_rows grid is (output.shape[0], triton.cdiv(output.shape[1], 1024)) (ignition/components/state.py:102-103) and _scatter_rows grid is (source.shape[0], triton.cdiv(source.shape[1], 1024)) (state.py:182-184), so the second grid dimension still grows with row width; the TODO is not closed by this PR and the description does not mention it. Related memory-side work by the same author: #659 (open) "perf(helios): alias null continuation row zero onto a single zeroed VMM granule" reserves row 0 (StateSlotId allocations start at 1; state_transfer rejects row == 0) and warns that any write to slot 0 now corrupts aliased granules. #683's allow_zero=False default in scatter_rows (state.py:165-201) reinforces exactly that invariant on the Python/Triton side, and #683's test asserts slot 0 is untouched by default (tests/components/test_state.py:90-96). The two are complementary, not conflicting; #659 is in Helios/Rust, #683 in ignition/Python.

#6 [high] Process: #683 has no comments, no reviews, no CI; evidence = one pytest run

PR #683: opened 2026-12-02 16:48 by lukealonso (COLLABORATOR), branch unify-ignition-recipe-boundary -> main, head 70e84eba, +406/-148, 8 files. Process facts: state "open, ready for review"; zero comments, reviews or reactions ("Discussion (0)" in read_item); no CI checks on the head commit (orientation packet: "CI on the head commit: no checks"). Same-day age relative to the repo's latest merged work (#670 merged 2026-12-02). Evidence in the description: 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 tests/cli with CUDA_VISIBLE_DEVICES=0 FLARE_RUN_CUDA_TESTS=1 on RTX PRO 6000 Blackwell SM120 → 164 passed, 0 failed. Declared limitations: no Rust tests (no Rust files changed — verified true), no full ignition export + flare run, no multi-GPU TP. Charter PR-description standard (why/what/result/evidence, design-review.md & charter "PR descriptions: Expect four parts") is satisfied structurally. Charter rule relevant to the state.py half: docs/design-review.md:124-130 principle 14 restricts Claude Opus/Sonnet/etc. authorship of low-level CUDA/PTX/Triton kernels and GPU-optimization changes; charter also says for GPU kernel code reviewers "report concrete defects only". The PR edits four Triton kernel bodies; the description does not state who authored that half. Recorded as a fact for the reviewer to check, not as a violation.

#7 [high] People: lukealonso is a charter priority contributor and the main author in all touched areas

lukealonso: GitHub association COLLABORATOR; named in the charter as one of three priority contributors (@voipmonitor, @original-el8, @lukealonso) who "carry extra weight" (read_charter, "Respect contributors"). 38 merged PRs in the last 180 days, 3 open: #668, #659, #658. He is the dominant author in every area #683 touches: 180-day commit counts ignition/preparation 162, tests/preparation 208, ignition/components 108, tests/cli 104, ignition 272, ignition/cli 83 (orientation packet "People in these areas"). Most relevant prior work by him:

#8 [high] Reach: prog threading, wire compatibility of reproduction_args, and the hard Python API break

Before #683, prog reached only argparse/help text: ignition/cli/__init__.py:26,31,33,83,89,92,116,134,308,316,322,333,351,364,371 thread prog through _parser/parse_args for prog= and epilogs only (tests/cli/test_recipe_injection.py:58-75 already asserted custom-ignition export MODEL --help), while reproduction_arguments hardcoded ['ignition', 'export', ...] (ignition/preparation/rebuild_manifest.py:263 before, :262-263 after). So the prog-parity gap is real and verifiable in code. Reach of the change:

#9 [high] Project fit: charter/design-review alignment, and where "recipe-owned" stops short

Charter and docs mapping for #683 (facts, both directions): Aligned:

#10 [high] Claims and evidence: what is verified, what is self-reported, what is overstated

Claims vs evidence in #683 (verified in code unless marked):

  1. "hardcoded 'ignition' as argv[0]" — TRUE, confirmed at rebuild_manifest.py:263 before the diff; prog threaded to argparse only (ignition/cli/init.py:308-361).
  2. "reproduction_arguments/from_plan emit [current_prog(), 'export', ...]" — TRUE (rebuild_manifest.py:231-263, 288-336); the new test asserts jetson argv[0] and that the rest of the vector is identical (tests/cli/test_parameters.py:362-368).
  3. "removes external recipe identifiers from core" — PARTLY: model_type strings/token IDs/processor classes gone; profile NAME set (IMAGE_PROFILES) and payload schema remain (frontend.py:26-35, 157-204).
  4. "preserving the exact Protobuf ImageSettings wire format" — TRUE for the 8 profiles: payload dict shape for deepseek_row_major/qwen/mimo unchanged (compare old vs new _validate_image_payload), and nothing under helios/proto changes in this diff.
  5. "int32→int64 casts across all five kernels" — TRUE and complete: every row/column/slot index is .to(tl.int64) (state.py:112-114, 140-142, 196-201, 209-214, 242-254). Overflow risk (115–215 MiB rows) is arithmetic, not measured: 2^31 / 215 MiB ≈ 10 rows; unverified end-to-end because no export+serve run.
  6. "_scatter_rows baked export-time SLOTS" — TRUE before; the constexpr is still passed as the fallback and the live limit comes from tl.load(MemoryCapacity) when HAS_CAPACITY (state.py:181-199).
  7. "reject writes to reserved null slot 0 by default" — TRUE (state.py:187, 200); CPU and CUDA tests (tests/components/test_state.py:90-96, 133-146).
  8. "dynamic memory_capacity at replay" — TRUE for the Triton path, incl. capacity bump without recompiling (tests/components/test_state.py:137-141); validation rejects wrong dtype/device (state.py:175-179).
  9. Test evidence "164 passed, 0 failed on SM120" — self-reported, not reproducible here; no CI checks on head 70e84eb.
  10. "Python callers must pass image_spec" — TRUE; hard break with TypeError (frontend.py:207-208, 268-269), no deprecation shim.
  11. Not in the description: new requires_preprocessor / default_preprocessor knobs (frontend.py:55-56, 285-292); _validate_image_payload now rejects non-empty payloads for the five empty profiles (frontend.py:161-164); ImageProcessorSpec.extract receives only (image, model) so #483-style gemma4 tokenizer validation cannot be expressed.
  12. Not mentioned: docs/TODO.txt:366-367 gridDim.y ceiling on these same kernels stays open.