Value proposition report · NVIDIA/hyperflare-inference #483

Raw Markdown for agents: https://autobot.eidonix.com/p/96f82d1d-5cce-4e85-a705-b162db4ce408.md

Verdict: worth merging — PR #483 "Add Gemma 4 image preparation, Bracketed patch-width metadata, and atomic spans"

Head ab9a432b, base main 27716185, 38 files, +2490/−251. Third review pass; all verified against the current head.

One correction to my earlier summary: this is the eleventh image-preparation profile, not the twelfth — helios/src/model/contract.rs:68 (not opened) on main defines ImagePreparationKind 1–10 and the PR appends 11. The cross-profile consistency test has 11 rows because it includes Gemma 4.

Charter fit

Right layer. The charter says Helios "shouldn't accumulate per-model branches" (#267, #334). Image preparation is not an ad-hoc branch but a declared extension point: helios/model-contract.md:243-244 — "Tool parsers, reasoning parsers, image preparation, and image layouts each have an independent enum selector." Ten profiles already exist, the most recent (padded_grid) added by maintainer Luke Alonso in 8628b7c5. An eleventh is the sanctioned shape, and the only route by which a Gemma 4 core can declare native image preprocessing.

Not a new alias, and more than one checkpoint. Gemma 4 is already a shipped family: docs/model-preparation.md:321 (e2b/e4b/12b/26b-a4b/31b + NVFP4), docs/api.md:749 (not opened), docs/cli-design.md:457 (not opened),486, docs/model-development.md:77-83, history commits 1fd1f917, d367edc5 (#56), bcf7177d (#62). Images are the missing half. Ignition now asserts only consumed fields — model_type: gemma4, vision_config.model_type: gemma4_vision, patch_size 16, pooling 3, processor flags, soft-token allowlist (ignition/preparation/frontend.py:114-141) — so E2B/E4B/26B-A4B/31B pass while gemma4_unified (12B) is rejected (tests/preparation/test_frontend_gemma4.py:129), with three real cached checkpoints at :228-257.

Wire additive and inert. ImagePreparationKind = 11; ImageSettings.profile tag 11; VisionCapacity.patch_features field 6 with #[serde(default)] (helios/src/model.rs:51-53); describe.rs:466-468 omits 0 so legacy describe JSON is byte-identical; round-trip test at protobuf.rs:813 (not opened). Existing cores keep loading: missing patch_features decodes 0 → legacy 1176 (model.rs:72-80).

Decisive argument: it fixes two real main defects

  1. Every span-declaring Bracketed image failed per request on main. layouts/bracketed.rs emitted no data.spans, while model.rs:442-465 rejects any scoped token outside a span → "image token spans do not match their declared boundaries". Fixed in layouts/bracketed.rs:57-88: the run is flushed when the feature run ends, the span is start-1..end+1 (covering start_token…end_token), bounds-checked at both ends, gated on image_tokens.span.is_some(). The shared prompt.rs fallback was deleted, not patched, so the layout that builds the envelope owns the span (matching layouts::deepseek).
  2. Every cached MiniMax prepared-image record was discarded. conditioned.rs:185-193 on main ended _ => 588, so PatchMerge's 1176-wide patches never satisfied valid_processed and were re-materialized per request. Now via ImageProcessor::patch_features() (mod.rs:459-471, conditioned.rs:187), which also fixes PaddedGrid = 1200.

Both fixed without adding a branch in shared scheduling or cache code.

Cost

Simpler way? Duplication?

No. Ignition is Python and serves nothing at request time, so HF's Gemma4ImageProcessor cannot be reused. Gemma 4's layout (interleaved (y,x,channel), (x,y) positions, 1/255, 3×3 pooling) genuinely differs from patch_merge's channel-planar temporally duplicated 1176-wide patches; parameterising one profile for both is more code and more risk. The PR takes the two real reuse opportunities: patch_merge::Envelope extracted and shared (patch_merge.rs:10-136, MiniMax behaviour unchanged), and resize::resize reused.

Residual, non-blocking

Bottom line

Worth merging. It sits at the sanctioned extension point, keeps the wire additive, ships CI-durable bit-exact parity against Hugging Face across 8 fixture cases at two soft-token budgets, moves three invariants from per-request rejection to load-time failure, and repairs two independent latent main defects — a per-request rejection for any span-declaring Bracketed core, and a per-request cache-invalidation bug for every MiniMax prepared image. Land it, then treat the TODO's end-to-end qualification as the real bar before claiming Gemma 4 vision support.