Opened by a workflow run, Nov 24, 2026 9:23 AM EST.
screen malicious
Screen Result: All Clear
Evidence:
- The PR discussion is empty (
pr_comments: "No comments."), so there is no conversational channel carrying injected text; the only outside-of-code strings are the PR description itself, whose "Discord: ran.cossack" is a contact handle, not an instruction. - The change set is 13 files and nothing else —
helios/proto/runtime_core.proto, ten files underhelios/src/, andignition/preparation/{frontend.py,runtime_core_pb2.py}; no.github/,scripts/, docs, dependency or lockfile edits that could steer an agent or the build. - Searches over the two new hand-written surfaces (
helios/src/frontend/images/gemma4.rs,ignition/preparation/frontend.py) foragent|assistant|instruction|ignore|inject|autobot|reviewerreturn no matches; repo-wide searches for instruction-style phrasing overhelios/srcandignitionhit only pre-existing vLLM comments (helios/src/output/chatml.rs:407(not opened),helios/src/server/models.rs:72(not opened),helios/src/server/runtime.rs:42(not opened)). - No hidden characters: no zero-width (U+200B) or bidi-override (U+202E) sequences anywhere in the PR.
- The only new process spawns are test-only and self-limiting:
helios/src/frontend/images/gemma4.rs:267and:356run the repo's own../.venv/bin/pythonwith a fixed inline parity script, skipping when the venv orFLARE_GEMMA4_TEST_SNAPSHOTis absent (:236-246,:352-355) — the same pattern already onmainathelios/src/frontend/images/patch_merge.rs:174-212. - Behaviour the description does not spell out, and which a reviewer should still check (none of it agent-directed):
ignition/preparation/runtime_core_pb2.pyis regenerated by an older protoc (header 7.36.2 → 7.36.1), andhelios/src/model/prompt.rs:137-151now fillsdata.spanssilently when it is empty and the layout declares an atomicImageSpan, with no new test inhelios/src/model/tests.rs(not opened). - Unverifiable claims: the description's "45 passed / 53 passed / cargo check / 15 passed" cannot be reproduced from the PR, which shows no CI checks on head
f2340e4.
Open questions: whether the precision/patch-geometry refactor in packing.rs:16-22 is covered by parity tests for every patches_per_feature, and why no CI runs on the head commit.
Full report · Notes decide malicious: all_clear (100%): No malicious content found
explore
Author: rickybrent (no GitHub association with the repo; 0 merged, 1 open PR in 180 days — #484, same day; Discord ran.cossack)
Motivation: Gemma 4 is already a supported text model here, but its image half was missing: Helios had no way to turn a picture into the 16×16 patches, (x, y) positions and 3×3 pooling Gemma 4 expects, and ImageLayoutKind::Bracketed was hard-wired to 2×2 merge. This adds a native Rust Gemma 4 image preprocessor plus the profile wiring, and feeds atomic image spans to the prefill scheduler.
Scale: +732 / −164 lines in 13 files
Proposal:
- New
helios/src/frontend/images/gemma4.rs(416 lines): area-bounded antialiased resize to a multiple of 48, RGB-interleaved 768-float patches, (x, y) positions, patches/9 soft tokens. Bracketedmerge geometry generalized from hard-coded 2×2/1176 to a 2-entry table4→(2,1176),9→(3,768)driven byvision.patches_per_feature(packing.rs:16-22).patch_merge::Processorsplit soEnvelope(start/image/end token expansion) is reusable by Gemma 4 (patch_merge.rs:10-30).model/prompt.rs:137-151fillsdata.spansfrom conditioned inputs when an atomicImageSpanis declared.- Additive wire/contract/Python wiring:
GEMMA4_IMAGE_PREPARATION = 11,ImageSettings.gemma4tag 11,prepare_frontend(..., image_profile="gemma4"). Touches: helios/src/frontend/images/+helios/src/model/packing.rs— new preprocessing and generalized upload packing (highest risk).helios/src/model/prompt.rs+ contract slot — recurrence of atomic prefill spans for all Bracketed cores.helios/proto/runtime_core.proto+ignition/preparation/{runtime_core_pb2.py,frontend.py}— wire and Python bindings. Related items:- #479 TERMINAL_PREFILL (merged): landed after the branch point; this PR's regenerated pb2 drops it.
- #426 TERMINAL_PREFILL contract & boundary-aware prefill (open): same proto file, same atomic-span scheduler machinery.
- #405 literal tokens / contract fixtures (merged): set the per-recipe contract-fixture precedent this PR does not follow.
- #386 Qwen3.8 images (merged) / #433 Inkling 2 vision (merged): the two prior bespoke image profiles this copies.
- #229 Muse Glimmer images (open): adjacent vision path, 10 shared files.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Autobot comments: Three things the description does not say. (1) The branch is stale: it predates #479 and its regenerated
ignition/preparation/runtime_core_pb2.pyomitsTERMINAL_PREFILL = 14and downgrades the protobuf gencode header 7.36.2→7.36.1 against theprotobuf>=7.36.2,<8pin; on #426 yatesdr treated exactly that as a merge blocker. (2) Theprompt.rsspan fill is not Gemma-specific — existing Bracketed cores that declare anImageSpanstart getting indivisible prefill units and new start/end-token validation, untested. (3) Both "Hugging Face parity" tests early-return silently withoutFLARE_GEMMA4_TEST_SNAPSHOTand a repo.venv, so the claimed "45 passed … including parity" reproduces nowhere but the author's machine and CI would report the same count without running them. Also: nogemma4_frontend.jsonfixture update, no docs, and nothing is servable without companion PRs in the split-outhyperflare-recipesrepo.
Value Proposition
Verdict: worth it with changes
The change is aimed at the right layer and the right problem, and it is built in the style the project already uses. It should not merge as-is: it carries a downgraded generated artifact, a hardcoded geometry table that contradicts its own stated goal, and one shared-code change (populating data.spans) with zero test coverage. Fix those five or six specific things and it is mergeable.
Charter fit: mostly good
Right layer. The charter says Helios "shouldn't accumulate per-model branches (#267, #334)" — but image preparation is already an explicit, enumerated extension point, not an ad-hoc branch. docs/model-contract.md:226-227 (not opened): "Tool parsers, reasoning parsers, image preparation, and image layouts each have an independent enum selector. Implementations are reusable syntax or image [implementations]." There are already eleven profiles (qwen, mimo, deepseek4, deepseek_row_major, moonvit, step, radio, glm, patch_merge, padded_grid), and the most recent, padded_grid, was added by a maintainer (Luke Alonso, 8628b7c5). Adding a twelfth profile is the sanctioned shape, not a violation.
Not a new model alias. It adds a preparation profile for a family the repo already supports: docs/model-preparation.md:345 lists gemma-4-e2b, -e4b, -12b, -26b-a4b, -31b and NVFP4 variants. The PR's Ignition side pins geometry shared by all of them (ignition/preparation/frontend.py:126-129: 27 layers, 1152 hidden, 16 heads, head_dim 72, 4304 FFN), so "more than a single checkpoint (#74)" is structurally satisfied — but see the evidence gap below.
A real gap. Today's Gemma 4 fixture has no image support at all: helios/tests/support/contracts/gemma4_frontend.json:16-17 (image_preparation: null, image_layout: null) and :38 (image_tokens: null). So Gemma 4 is text-only in Helios, and this PR is what unblocks images for it. That is a genuine user-facing benefit for people running Gemma 4 locally, which is exactly the focus the charter asks for.
Fits several "how we work" rules. The proto changes are strictly additive (ImagePreparationKind value 11, ImageSettings.profile tag 11 — helios/proto/runtime_core.proto:386,522), so existing cores stay wire-compatible. The Bracketed validation is generalised rather than special-cased: tokens.checked_mul(patches_per_feature) == patches replaces the old tokens == patches/4 && patches_per_feature == 4 (helios/src/frontend/images/packing.rs:488, cf. :527 in class_token, which was left alone). Extracting patch_merge::Envelope (helios/src/frontend/images/patch_merge.rs:11-81) instead of copying the envelope logic is the right call, and it reuses resize::resize rather than adding a second resampler. That is the "smallest footprint in shared code" the charter asks for.
Costs
- Code: one new file,
helios/src/frontend/images/gemma4.rs(416 lines, roughly half of it tests); ~130 lines touched elsewhere; a ~10-line generic addition toprepare_image_inputs. - Maintenance: a thirteenth-profile-shaped surface (describe JSON, protobuf decode, Ignition extraction, fixture) — the same recurring cost every existing profile carries, which is the accepted design.
- Performance: no serving-path cost. Decode/resize/pack already happen on the frontend pool; the only new work per image is the same bicubic pass other profiles do.
- Risk: concentrated in one place — the
data.spanschange in shared prompt code — plus one preparation-time validation hole.
Must fix before merge
- The checked-in protobuf is a downgrade.
ignition/preparation/runtime_core_pb2.py:5goes fromProtobuf Python Version: 7.36.2to7.36.1, and:16from minor2to1. Main's file was generated at 7.36.2 (from #430) andpyproject.toml:34pinsprotobuf>=7.36.2,<8. Regenerate with the pinned toolchain perhelios/manifest.md:468-472. This is a "pin everything (#215)" violation and would make the artifact look tampered with in review. - The hardcoded geometry table defeats the PR's own claim.
helios/src/frontend/images/packing.rs:16-21matches4 => (2, 1176), 9 => (3, 768)and errors otherwise. The PR description says the stride and width are "derived ... directly frompatches_per_feature... with no model-identity branching"; a two-entry literalmatchis a model-identity branch in disguise. Worse, the same constant is written three times:gemma4.rs:159computes3 * patch_size * patch_size,packing.rs:19hardcodes768, andconditioned.rs:192hardcodes768. Derive both from the profile/contract (e.g. carry patch feature width or the merge side next topatches_per_featureinVisionCapabilities), or at minimum from one shared helper. A future 2×2-merge encoder with 588-wide patches will otherwise silently fail upload. - The spans change has no test.
helios/src/model/prompt.rs:137-151now fillsprepared.data.spansfor any layout whoseImageTokenLayoutdeclares a span. That is shared code affecting scheduling (helios/src/scheduler.rs:1913-1934,helios/src/server/runtime.rs:1460(not opened)) for models beyond Gemma 4. Add tests for: (a) a span-declaringBracketedlayout gets spans equal to the conditioned input token spans; (b) layouts that already fill spans (ImageLayoutKind::Deepseek, which pushes athelios/src/frontend/images/layouts/deepseek.rs:149) are unchanged, since theis_empty()guard is the whole safety argument; (c) a layout with no span stays empty (helios/src/model.rs:452-454still rejects it). - Preparation doesn't validate what it will later depend on.
ignition/preparation/frontend.py:130-137hardcodes"<|image|>", "<|image>", "<image|>"with no check that each encodes to one atomic token — contrast_native_image_placeholder(frontend.py:231-245), which does exactly that for DeepSeek. Today a tokenizer mismatch only fails at request time insideEnvelope::expand(patch_merge.rs:38-48). Also:max_soft_tokensup to 1120 produces an image span of up to 1122 tokens, butvalidate_prompt_datarejects any span longer thanprefill_chunk_size(helios/src/model.rs:420-423, again atscheduler.rs:1926). Nothing validates that pair at preparation, so a recipe with a 512-token prefill chunk could export a core that rejects its own large images at admission. Reject the combination during preparation, with the reason stated. - Make the parity evidence durable. Both Hugging Face parity tests return silently unless
FLARE_GEMMA4_TEST_SNAPSHOTand../.venv/bin/pythonexist (gemma4.rs, the two tests near the end of the file), so CI proves nothing here — the 45-passing claim is a local run. Follow thepatch_merge.rs:174-212precedent but gate it on a checked-in fixture of reference pixels/positions rather than a livetransformersimport, or record the environment in the test output. The exactness claim is also narrower than it reads: f32 parity is against syntheticarangeimages at 91×37, 10×3000 and 3000×10. One real photograph and one second Gemma 4 checkpoint (the 26B-A4B or E4B, not just the 31B snapshot) would make the "#74 / prove it exports and serves" case. - Add the missing Ignition test and doc note. There is no
pytestforimage_settings(profile="gemma4")despite the new strict_expected()pins atfrontend.py:113-129— and those pins are exactly the kind of checkpoint-contract assertions this repo tests elsewhere. Also record the profile's pinned processor/vision fields and the prefill-chunk constraint somewhere indocs/, sincedocs/model-preparation.mdcurrently says nothing about Gemma 4 images.
Minor: SUPPORTED_SOFT_TOKENS is duplicated (gemma4.rs:8 and frontend.py:123); pick one owner.
Is there a simpler way?
Not for the preprocessing itself. Ignition is Python and serves nothing at request time, so the HF Gemma4ImageProcessor can't be reused; and the patch layout (interleaved (y, x, channel), (x, y) positions, 1/255 scaling) genuinely differs from patch_merge's channel-planar 1176-wide temporal patches — reusing that profile would mean parameterising patch layout, stride, normalization and geometry mode, which is more code, not less. The Envelope extraction already takes the one real reuse opportunity. The only place the PR makes itself more complicated than necessary is item 2 above.
The honest caveat: the atomic-span path has no in-repo consumer yet, since serving needs the companion recipe PRs in local-inference-lab/hyperflare-recipes. That is a reason to land the preparation profile (it is inert until a recipe selects it) but also a reason item 3 is non-negotiable — the one piece with cross-model blast radius is the one piece that end-to-end testing will not exercise.
Bottom line
Worth it with changes. The profile fills a real hole for an already-supported model family, lives at the sanctioned extension point, and is built with acceptable restraint and additive wire changes. Blocking items are mechanical (regenerate protobuf at 7.36.2; derive instead of hardcoding the 4/9 table; remove the three-way duplicated 768), one is a correctness risk in shared code (test the spans population across span and non-span layouts), and one is a preparation-time guard (single-token validation of the three image tokens; reject max_soft_tokens × 9 merges whose span exceeds the prefill chunk). With those plus a durable parity fixture and a second checkpoint, this is a clean merge.
Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Simplicity
Verdict: should-fix issues only
Blocking:
- None.
Should fix:
- helios/proto/runtime_core.proto:535-542 (+gemma4.rs:23-44, frontend.py:130-137):
patch_size/pooling_kernel_sizeare configurable but the pipeline cannot vary them; they add three separate copies of the 768 patch width (gemma4.rs:116, conditioned.rs:192, packing.rs:19) — deleting the two knobs and keeping profile constants asglm.rs:13does is smaller and fixes thepatch_size != 16cache-invalidation bug they hide. - helios/src/frontend/images/gemma4.rs:236-332: the envelope test writes a jinja file, spawns
../.venv/bin/pythonto render a chat template it never uses, and leaks the temp file on the earlyreturnat 281-283;FrontendAssets.chat_templateisOption(frontend/mod.rs:99) andEnvelope::expandis covered by layouts/bracketed.rs:104-180, so ~55 lines can go. - helios/src/frontend/images/gemma4.rs:334-415: the checkpoint pixel/position parity test silently returns when
../.venv/bin/pythonis absent and otherwise relies on an unpinned installedtransformers; the repo's pattern is a checked-in fixture (glm.rs:147-199 with tests/frontend/glm53_images.json (not opened)), which is also what the PR's "45 passed" claim rests on. - helios/src/model/prompt.rs:137-151: post-hoc span back-fill duplicates what deepseek.rs:149 already does and is dead for Deepseek via the
is_empty()guard; either let the layout producer fill spans or drop theis_empty()preference and reject the overlap.
Nits: 4 — redundant h % merge_side check (packing.rs:486), unsolicited reformatting (packing.rs:494-502), a packing test that only proves a table lookup (packing.rs:570-586), and a duplicated soft-token allowlist (gemma4.rs:11 vs frontend.py:123).
Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Prose
Verdict: blocking issues
Blocking:
- helios/src/frontend/images/gemma4.rs:236-241,253-256,281-283,335-339: the two Hugging Face comparison tests
returnsilently when the venv/snapshot/template probe is absent, so they count as passes; the description's unconditional "exact f32 pixel and position parity" rests on checks that may not have run (AGENTS.md:103-112, 304-307).
Should fix:
- PR #483 "Claimed result": "Existing cores and non-Gemma image profiles remain wire-compatible and unaffected" has no check in the evidence list (AGENTS.md:129-132).
- PR #483 evidence bullet: cites
Execution.persistent_workersround-trip, which comes from #430 and is not touched by this diff. - helios/README.md:702-704, docs/runtime-core-design.md:226-233, helios/model-contract.md:224-254: none enumerate the new
Gemma4preparation profile,ImageSettings.gemma4, or the Bracketed stride now derived frompatches_per_feature(AGENTS.md:52-56; repo-prose SKILL.md:26). - helios/src/model/prompt.rs:137-151: the atomic-span population changes behaviour for every span-declaring layout, not just Gemma 4, and the description gives no before/after for it (AGENTS.md:88-94).
- ignition/preparation/runtime_core_pb2.py:5,13-18: the regenerated bindings downgrade to Protobuf Python 7.36.1 while pyproject.toml:34 requires >=7.36.2; an undisclosed material generated-artifact change (AGENTS.md:92-93; helios/manifest.md:465-472).
Nits: 5 — ignition/preparation/frontend.py:113-137 unexplained hard-coded processor values; helios/src/frontend/images/gemma4.rs:11,26-27 unexplained bounds duplicated from frontend.py:123; helios/src/frontend/images/packing.rs:491 layout-name drift; helios/src/frontend/images/patch_merge.rs:10 self-referential docstring; helios/src/frontend/images/conditioned.rs:192 unexplained width.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Conventions
Verdict: should-fix issues only
Blocking:
- None.
Should fix:
- helios/src/frontend/images/packing.rs:16-22:
bracketed_patch_geometrykeys patch width onpatches_per_feature(4→1176, 9→768), a numeric proxy for model identity in shared upload packing — contradicts the description's "no model-identity branching" and design-review.md:38-52; the file's own precedent derives widths from prepared layout metadata (:123-134,:537). - helios/src/frontend/images/packing.rs:39-42 / conditioned.rs:192 / gemma4.rs:116: the same per-profile pixel width is now authored in three places, so the cached
valid_processedvalidation can silently disagree with the packer. - helios/src/model/prompt.rs:137-151:
data.spansis filled generically in the layout dispatcher instead of by the layout that builds the envelope (layouts/deepseek.rs:149), and no test or fixture (tests/support/contracts/gemma4_frontend.jsonhasimage_tokens: null) exercises a Gemma 4 atomic span, so the headline feature is unverified. - helios/src/frontend/images/gemma4.rs:236-330: the envelope test shells out to
../.venv/bin/pythonto re-patch the chat template, duplicatingprepare_templates.py/downloaded_template_assetand bypassing the existingcrate::template_fixtures::template("gemma4", …)accessor (jinja/tests.rs:274, message_boundaries.rs:191 (not opened)); it also downloads from the Hub insidecargo testand leaks its temp file on the failure path.
Nits: 4 — pb2 generator version downgraded to 7.36.1; no ImageSettings.gemma4 protobuf round-trip test (precedents protobuf.rs:726, :749); soft-token allowlist duplicated Rust/Python; patch_merge::Envelope still homed in patch_merge.rs:10.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Correctness
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/src/frontend/images/packing.rs:16-22 + helios/src/model/packing.rs:92-97:
tensor_layoutnow fails at core load for anyBracketedlayout whosepatches_per_featureis not 4 or 9; previously width was fixed at 1176. Contradicts "existing cores … unaffected" — needs a check over shipped cores. - helios/src/frontend/images/gemma4.rs:23-31:
Processor::loadaccepts anypatch_size1..=64 andpooling_kernel_size1..=16 while the packing table only represents 16/3, so a core with other values loads and then packs misaligned pixels. - helios/src/frontend/images/conditioned.rs:192 vs packing.rs:19 vs gemma4.rs:116: three independent derivations of the 768-float patch width; the cached-record validator can accept data the upload stage slices differently.
- helios/src/model/prompt.rs:137-151 + helios/src/model.rs:420-424: the new atomic spans are bounded by
prefill_chunk_size; a 1,121-token Gemma 4 envelope fails admission on any smaller chunk, and a prefix-cache match ending inside an envelope fails the request (server/runtime.rs:1458-1465, scheduler.rs:1923-1933). No test covers either. - helios/src/frontend/images/gemma4.rs:238-244, 336-355: both reference-parity tests return early without
FLARE_GEMMA4_TEST_SNAPSHOT/.venv, so CI verifies none of the claimed Hugging Face parity.
Nits: 2 (unrelated runtime_core_pb2.py regeneration churn; hardcoded envelope token strings in ignition/preparation/frontend.py:130-137).
Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Architecture
Verdict: should-fix issues only
Blocking:
- None.
Should fix:
- helios/src/frontend/images/packing.rs:16-22: gemma4/repo:
bracketed_patch_geometrykeys patch width (1176 vs 768) offpatches_per_feature(4/9), so the shared upload path carries a count-keyed model allowlist; patch width is a patch-size property and is triplicated (packing.rs:16-22, conditioned.rs:192, gemma4.rs:99) instead of carried in the contract. - helios/src/frontend/images/gemma4.rs:23-44:
Processor::loadnever checkspooling_kernel_size^2 == limits.patches_per_feature, so the profile can disagree with the packing/validation contract (prompt.rs:171, packing.rs:488) and fail per-request instead of at load. - helios/src/model/prompt.rs:137-151: the new span population silently turns every image envelope into an atomic prefill span (server/runtime.rs:1460 (not opened) → scheduler.rs:1912-1936) for any layout that declares an
ImageSpan, a scheduling behaviour change the description scopes to Gemma 4 only; a 1,120-soft-token image span (~1,122 tokens) also collides withprefill_chunk_size(model.rs:422, scheduler.rs:1926). - ignition/preparation/frontend.py:113-137: the new profile pins one vision architecture (27 layers, 1152 hidden, 16 heads, head_dim 72, 4304 intermediate) and hardcodes the three image token strings, so other Gemma 4 checkpoints (e.g. the 26B-A4B-it model card in docs/api.md:749 (not opened), e2b/e4b templates) are unproven against the charter's "more than a single checkpoint" rule.
- ignition/preparation/runtime_core_pb2.py:5,16: gencode regenerated with protobuf 7.36.1 while the file previously declared 7.36.2 — the checked-in gencode no longer matches the pinned generator version.
Nits: 2
Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Pre Test Report
Pre-test report — PR #483 "Gemma 4 image prep profile, bracketed 3×3 packing, atomic spans"
Head f2340e42 (2026-11-22) · base 6d6fe0c6 · 13 files · +732/−164 · no CI checks on head
Verdict: DO NOT REFER TO HARDWARE TESTING YET. Return to author.
Three independent grounds, any one of which is sufficient:
- The checked-in generated artifact would regress a feature merged after the branch point (verified two ways, see F1). That is wrong code, not untested code.
- A substantive architecture problem sits in the shared upload path (F2) and a second one in shared prompt/scheduling code (F3) — exactly the "will need to be changed" category that must never consume hardware time.
- There is nothing on cn5 or cn7 to test it against. No Gemma 4 checkpoint is present on either host, and no in-tree recipe selects the
gemma4image profile (recipes were split intolocal-inference-lab/hyperflare-recipesby17bb3c4a). A GPU run today cannot exercise this change end to end at all.
Expected value of a hardware run as the PR stands: near zero. Everything the diff actually changes is CPU-side and deterministic (decode → resize → patch interleave → positions → envelope expansion → upload-layout arithmetic → prompt/span validation). No kernel, no graph, no numeric-precision path is modified. Details and the conditional plan follow.
Findings — blocking (do not test; must be fixed first)
F1. The regenerated Python bindings overwrite main and drop TERMINAL_PREFILL (regression of #479)
Mechanism, verified by reading both refs:
- The branch predates #479 (
e091689b, Nov 23, "optional TerminalPrefill"). Onpr/483,helios/proto/runtime_core.proto:325-339runs… SCORED_PREFILL = 12;then closes the enum — noTERMINAL_PREFILL.mainhas:338 TERMINAL_PREFILL = 14;. A repo-wide search forTERMINAL_PREFILLatpr/483returns no matches (nothing inignition/,tests/, orhelios/src/either). - The
.protois not the problem on its own: the PR's proto hunks are+10/−0in disjoint regions (enum value 11 at:386, oneof tag 11 at:522, new message:535-542), so git combines them with main's and the merged schema keepsTERMINAL_PREFILL = 14. - The regression is
ignition/preparation/runtime_core_pb2.py:+122/−120replaces the entire serialized descriptor, generated from the stale schema. On merge, main's descriptor (withTERMINAL_PREFILL) is overwritten by one without it, while consumers are untouched by this PR:ignition/preparation/contract.py:29accepts"terminal_prefill"and:82callsp.GraphOperation.Value(kind.upper());tests/direct/test_scheduler.py:720assertsp.TERMINAL_PREFILL == 14. Result:AttributeError/ValueErrorat preparation and a failing direct scheduler test. - Compounding: the gencode header goes
Protobuf Python Version: 7.36.2 → 7.36.1(pb2:5) andValidateProtobufRuntimeVersion(..., 2 → 1, ...)(pb2:16), againstpyproject.toml:34 "protobuf>=7.36.2,<8". Regeneration command ishelios/manifest.md:468-471.
Fix: rebase onto main, regenerate with the pinned protoc so the artifact carries both GEMMA4_IMAGE_PREPARATION = 11 and TERMINAL_PREFILL = 14 at 7.36.2, and show tests/direct/ passing. This is the same class of issue that was treated as a merge blocker on #426.
Review-summary accuracy note: the "explore", "Prose", "Value Proposition" and "Architecture (lens B)" summaries all flagged the pb2 downgrade; only "explore" and "Prose" connected it to #479 specifically. The "Conventions", "Simplicity" and "Correctness" summaries called it a mere nit ("still loads", "not a functional defect") — that understates it, because the failure is not the version tuple but the missing enum in the overwritten descriptor. None of the summaries identified the TERMINAL_PREFILL drop as the decisive defect; I verified it directly.
F2. bracketed_patch_geometry is a model allowlist in shared packing, and changes core-load behaviour
helios/src/frontend/images/packing.rs:16-22:
fn bracketed_patch_geometry(patches_per_feature: usize) -> Result<(i64, usize)> {
match patches_per_feature { 4 => Ok((2, 1176)), 9 => Ok((3, 768)), _ => Err("unsupported …".into()) }
}
- Patch vector width is
3·patch_size²(16 → 768), a vision-tower property.patches_per_featureis a merge factor. The key is demonstrably not a width in this repo: DeepSeek runspatches_per_feature = 9with 588 floats per patch (packing.rs:32-34;helios/tests/support/contracts/deepseek4.json:9(not opened)). So9 → 768encodes model identity behind a geometry name — the pattern the charter's "keep the runtime small and model-agnostic … shouldn't accumulate per-model branches" forbids, and the opposite of the PR description's "no model-identity branching in upload packing" claim. - Behaviour change at core load:
helios/src/model/packing.rs:92-97now callstensor_layoutfromPacking::newwithconfig.contract.vision.patches_per_feature. PreviouslyBracketedwas a fixed2 × 1176. Any core declaringBracketedwith a merge factor outside {4, 9} now fails to start, and one with9paired to a 588-wide layout would be silently mis-strided. The description's "existing cores … unaffected" is unproven — nothing in the PR sweeps prepared cores. - Profile and contract can disagree:
gemma4.rs:23-44accepts anypatch_size ≤ 64/pooling ≤ 16. A core withpatch_size = 14, pooling = 2loads (merge factor 4 satisfies the table), produces 588 floats/patch (gemma4.rs:116), and is then sliced at the 1176-wide stride bybracketed()— "truncated vision pixels" at best, misaligned pixels into the vision graph at worst. - The 768 is authored three times:
packing.rs:19,conditioned.rs:192(Profile::Gemma4(_) => 768, the cache-validation predicate),gemma4.rs:116(the only one that derives it). A divergence surfaces as "image preprocessing differs from its prompt geometry" — pointing at the wrong layer.
Fix: carry the patch feature width in the prepared contract (e.g. next to patches_per_feature in VisionCapabilities, validated at model.rs:68-87), derive merge_side = patches_per_feature.isqrt() and width = 3·patch_size², and have conditioned.rs, bracketed() and gemma4::process read that one source. Add the load-time cross-check pooling² == patches_per_feature and 3·patch_size² == width.
Review-summary accuracy note: all five lenses independently found this; the most precise framing is the "Conventions" and "Architecture (lens B)" ones (count-keyed allowlist + the DeepSeek 588 counter-example). The "Correctness" summary's claim that this is a load-time break is correct and is the strongest argument for blocking, and no summary pressed it to a blocker.
F3. prompt.rs:137-151 changes scheduling behaviour for every span-declaring layout, with zero tests
if prepared.data.spans.is_empty() && config.contract.frontend.image_tokens.as_ref()
.and_then(|layout| layout.span.as_ref()).is_some() {
prepared.data.spans = prepared.conditioned_inputs.iter().map(|i| i.token_span.clone()).collect();
}
- This is profile-independent shared code.
data.spansdrivesvalidate_prompt_data(model.rs:420-454: per-span boundaries, coverage,len() ≤ prefill_chunk_size) andScheduler::set_prefill_spans— i.e. it decides which prefill submissions are unsplittable. The description scopes this to Gemma 4; the condition does not. - Precedent is the layout owning its spans (
frontend/images/layouts/deepseek.rs:149(not opened) pushes beside the expansion it builds).layouts/bracketed.rs:82-91returns empty spans andconditioned_inputs: vec![], so this is a second span producer in shared code, admitted by anis_empty()preference rather than an assertion that two producers agree. - Coverage is zero.
helios/tests/support/contracts/gemma4_frontend.json:16-17,38hasimage_preparation,image_layoutandimage_tokensallnull. The only span-bearing fixture isdeepseek4.json:56(not opened), and the only span declarations inprompt.rstests areDeepseek/DeepseekRowMajor(prompt.rs:481-487,699) — both already fill spans, sois_empty()is false and the new branch never runs under test. The "atomic spans" half of the headline result has no automated evidence anywhere in the repo. - Secondary, lower confidence: envelope span length is
tokens + 2(verified fromgemma4.rs:315-325: 260 features,eoiasserted atstart + 261,boiatstart). Withmax_soft_tokens = 1120that is 1122 > anyprefill_chunk_sizebelow that; the server default is 4096 (server/config.rs:149(not opened)) so the default deployment is safe, but nothing rejects the combination at load. (Several summaries state "+1/1121"; the test arithmetic says +2/1122.)
Fix: produce the span in layouts/bracketed.rs beside the envelope it computes, make overlap or absence a defect instead of an is_empty() preference, add a Bracketed contract fixture with image_tokens.span set, and add a test that a 1,120-soft-token envelope either fits or is rejected with a named error.
Findings — should-fix before any test run
| # | Finding | Evidence |
|---|---|---|
| F4 | Parity evidence cannot be reproduced or trusted. Both HF comparison tests return silently (counted as passes) without FLARE_GEMMA4_TEST_SNAPSHOT + ../.venv/bin/python: gemma4.rs:238-244, 253-256, 281-283, 336-339. No CI ran on f2340e4. The description's "45 passed … including Hugging Face checkpoint pixel/position parity" is consistent with the comparison never executing. Inputs are synthetic (x % 256) u8 rasters at 91×37, 10×3000, 3000×10 (gemma4.rs:355, 378-383); geometry_matches_the_hugging_face_processor (:197-216) is a hardcoded table, not a comparison. |
gemma4.rs:197-216, 236-334, 334-415 |
| F5 | Preparation pins one vision tower and hardcodes three tokens without validating them. frontend.py:126-129 pins 27 layers / 1152 hidden / 16 heads / head_dim 72 / 4304 FFN, and :130-137 hardcodes "<|image|>", "<|image>", <image|> with no check that each encodes to one added token — unlike _native_image_placeholder (frontend.py:231-245) which does exactly that for DeepSeek. Repo docs list five Gemma 4 variants (docs/model-preparation.md:345 (not opened), incl. gemma-4-26b-a4b, -31b). Charter's "more than one checkpoint (#74)" is unmet. No pytest for image_settings(profile="gemma4") exists (gemma4 has no match under tests/). |
frontend.py:113-137, 231-245 |
| F6 | Envelope test is scaffolding that proves nothing and leaks a temp file. gemma4.rs:257-299 shells out to Python to build a chat template it never renders, then remove_file only on the success path (:281-283 leaks). FrontendAssets.chat_template is Option (frontend/mod.rs:96-100 (not opened)), and the envelope expansion itself is already covered by layouts/bracketed.rs:104-180. The existing accessor is crate::template_fixtures::template("gemma4", "chat_template.google"). |
gemma4.rs:236-334 |
| F7 | Docs not updated for a new preparation kind / ImageSettings tag / the derived Bracketed stride, though helios/README.md:702-704 (not opened), docs/runtime-core-design.md:226-233 (not opened) and helios/model-contract.md:224-254 (not opened) each enumerate every other profile. Doc-only — does not gate hardware testing, but should land with the code. |
— |
| F8 | No protobuf round-trip test for tag 11, unlike its precedents (protobuf.rs:726 (not opened), :749). The "additive and wire-compatible" claim currently rests on a hand-run script. |
protobuf.rs:167-171 (not opened) |
Findings — nits (do not block, do not test)
packing.rs:494-502 unsolicited reformatting around a one-token change; redundant h % merge_side check (packing.rs:486) given gemma4.rs:46-48 guarantees the multiple; SUPPORTED_SOFT_TOKENS duplicated (gemma4.rs:11 vs frontend.py:123); self-referential Envelope doc comment (patch_merge.rs:10); layout-name drift in an error string (packing.rs:491).
Verified clean (no action)
- Wire additions are genuinely additive:
GEMMA4_IMAGE_PREPARATION = 11appended (runtime_core.proto:386),ImageSettings.gemma4 = 11(:522),Gemma4ImageSettings(:535-542);ImageLayoutKinduntouched; decode/describe arms mirror their neighbours (protobuf.rs:167-171(not opened),describe.rs:442-444(not opened),contract.rs:68(not opened)). Nothing renumbered. (The compatibility problem is the artifact, F1, not the schema.) - The
Envelopeextraction is real de-duplication, not churn:patch_merge.rs:10-81keeps the empty/duplicate-marker and single-token checks verbatim (only the message text changed to "invalid image envelope tokens"), and the thinProcessorwrapper (:83-129) leaves callers untouched. - Geometry arithmetic is sound:
checked_mul/try_foldoverflow guards (gemma4.rs:109-122),check_batchbefore and after, named error for degenerate sides (:65-76),tokens = patches/pooling²by construction, area bound at:77-81.resize::resizeis reused rather than a new kernel.
Expected value if a hardware test were performed
Low, and currently zero in practice.
- Nothing GPU-side is modified. No kernel, graph, numerics or precision path changes. The preprocessor runs on the frontend pool; the changed arithmetic is integer/CPU. There is no performance claim and no benchmark expectation attached (#210 does not apply), so a throughput A/B test would be pure waste — do not run one.
- What hardware could uniquely answer is narrow: (a) does a prepared Gemma 4 core actually load, and (b) does a vision request survive admission and atomic-span prefill chunking without the errors F2/F3 predict. Both are single-run correctness checks, not sweeps.
- Both are unreachable today: no Gemma 4 checkpoint on cn5 (
dinov2-base,timm/vit_base_patch14_dinov2, GLM-5.3-Flash variants) or cn7 (Qwen3.8 variants), and no in-tree recipe selectsimage_profile="gemma4"— the repos were split out, andgemma4_frontend.jsonstill hasimage_tokens: null. Serving needs a companion recipe PR plus a multi-GB checkpoint pull that is not on either host. - The valuable evidence is CPU-only and cheap:
cargo testwith parity made visible, a checked-in reference fixture, and the direct-scheduler suite. That should all happen on the author's machine and in CI, at no hardware cost.
Minimal test plan — only if F1–F4 are fixed and the PR is re-referred
Stage 0 is required to make Stage 1 meaningful; skip Stages 2–3 if the author's CI already proves them.
Stage 0 — gate on the author (no hardware).
Rebase onto main; regenerate runtime_core_pb2.py at protobuf 7.36.2 and confirm GEMMA4_IMAGE_PREPARATION and TERMINAL_PREFILL are both present (p.GraphOperation.Value("terminal_prefill") == 14); cargo test + pytest tests/preparation tests/direct green; report parity tests with skips made visible (or replaced by a checked-in fixture), not as a bare count.
Stage 1 — CPU correctness (cn5 job, no GPU needed; ~5 min).
cargo test -p helios frontend::images model::— must include the new Bracketed span test and the load-timepooling² == patches_per_featurerejection.- Misspecification regression (the key new test): build two
ImageLimits/contracts, one withpatches_per_feature = 4, one= 9, both against apatch_size = 16Gemma 4 profile; prepare a 91×37 and a 1008×672 image; assert the packedvision_pixel_valueslength ispatches × 768in both and that the pixel bytes are byte-identical between the two (the width must not depend on the merge factor). Then assert apatch_size = 14profile is rejected at load, not mis-strided at upload. - Span/scheduling test: a Bracketed contract with
image_tokens.spanset →data.spansequals the conditioned-input spans, boundaries are the declared start/end tokens; the same contract withmax_soft_tokens = 1120andprefill_chunk_size = 512→ rejected with a nameable error at load or admission, not a generic geometry message; a core already filling spans (DeepSeek fixture) → byte-identical prompt data tomain. - Backward compatibility: load one pre-existing prepared core per image layout (DeepSeek, MiMo, Qwen, Step, RADIO, GLM, padded-grid, patch-merge) and confirm each loads and packs exactly as on
main— this is the claim the description asserts and nothing currently checks.
Stage 2 — single serving check (cn5, one job, only if a recipe + checkpoint land).
One Gemma 4-31B-it run: prepare the core, then two requests — one text-only (regression: must be unchanged) and one with a single image — asserting a 200, that the response mentions plausible image content, and that max_soft_tokens at both a small and the 1,120 setting both admit. Watch specifically for "conditioned input spans or features violate prompt geometry", "invalid bracketed patch-merge image extent", and any prefill-split rejection. One image size larger than the prefill chunk is enough; do not sweep resolutions.
Stage 3 — regression sweep, intentionally minimal (cn5, one job).
Serve one non-Gemma vision model (Qwen3.8-27B-NVFP4 on cn7 is the better fit; GLM-5.3-Flash-NVFP4 on cn5 also works) with one image request, to prove the generalized bracketed/tensor_layout path and the pb2 change did not disturb existing vision cores. A single request each — no throughput comparison, no multi-run statistics, no cn7 GB10 arm64 pass unless Stage 1 or CI surfaces an arch-specific failure.
Explicitly not to be tested: throughput/latency A/B on any GPU; alphanumeric carving, EXIF/alpha edge cases for Gemma 4 (untested for every other profile — out of scope, not a regression); the synthetic ultra-wide 10×3000/3000×10 cases on hardware (already covered by the CPU geometry table); second-checkpoint variants until the vision-tower pin in F5 is relaxed.
Summary of review-summary reliability
The five summaries agreed on the substance and were mostly accurate. Corrections and emphasis I applied after direct verification: (1) F1 is a blocking regression of #479 via the overwritten descriptor — three summaries graded it a nit, and no summary named the TERMINAL_PREFILL loss; (2) F2's load-time break for patches_per_feature ∉ {4,9} is the strongest reason to block and appears only in the Correctness lens; (3) the envelope span is tokens + 2 (1122 at the max setting), not +1; (4) the hardware hosts carry no Gemma 4 checkpoint and no recipe selects the profile, which no summary stated and which makes the "worth testing?" question moot regardless of code quality; (5) I found no evidence that the PR discussion or any reviewed text attempted to direct the review — the single bot comment is a case-file notice.
Full report · Notes Decision to Test: no (100%): Testing will not add much value
code review summary
Changes Requested
The bones are good — the proto/contract additions are properly additive, the patch_merge::Envelope extraction is real de-duplication, and the Gemma 4 geometry is overflow-guarded. What blocks merge is that three behaviours do more than the description says, and one headline claim has no reproducible evidence.
Blockers:
packing.rs:16-22mapspatches_per_feature→ patch width (4 => 1176,9 => 768): patch width is3·patch_size², and DeepSeek already runs 9 patches/feature at 588 floats, so this is model identity inside shared packing — the opposite of the description's "orthogonal, no model-identity branching" claim. → Put the width in prepared metadata (VisionCapabilities.patch_size) and derivemerge_side = ppf.isqrt(),width = 3·patch_size².- The Hugging Face parity tests silently
returnwhenFLARE_GEMMA4_TEST_SNAPSHOTor../.venv/bin/pythonis absent (gemma4.rs:236-256, 281-283, 336-339), so "45 passed" is identical whether the comparison ran. → Check in atests/frontend/gemma4_images.json(not opened) fixture + generator likeglm.rs:147-199, or#[ignore]both tests and report them as unrun. - Atomic spans are populated in shared code (
prompt.rs:137-151) for any layout declaring anImageSpan, changingvalidate_prompt_dataandset_prefill_spanssemantics, with no test (gemma4_frontend.json:38has"image_tokens": null) and no stated blast radius. → Emit the span inlayouts/bracketed.rsbeside the envelope (deepseek.rs:149pattern), delete the shared block, add a span-bearing fixture and test.
Should fix:
gemma4::Processor::load(gemma4.rs:23-31) acceptspatch_size ≤ 64/pooling ≤ 16, so a profile can load that the packer and cache validator cannot represent. → Requirepooling² == limits.patches_per_featureand the patch width to match at load.- Patch width authored three times (
packing.rs:19,conditioned.rs:192,gemma4.rs:116) with no compile-time link;conditioned.rs:191shows the right pattern. → One shared constant/helper. max_soft_tokens: 1120→ a 1,122-token envelope thatmodel.rs:421-423/scheduler.rs:1922-1930reject on a smallprefill_chunk_size, and nothing checks it at load. → Reject or clamp at load, plus a boundary test.- Ignition pins one vision tower (
frontend.py:126-129: 27 layers/1152 hidden/16 heads/72 dim/4304 FFN) and literal image tokens; the charter asks for more than one checkpoint (#74). → Assert only consumed fields, take the tokens from the tokenizer, show a second checkpoint. - Docs left stale:
helios/README.md:702-704,docs/runtime-core-design.md:226-233,helios/model-contract.md:251-254all enumerate profiles and omit Gemma 4; the recipe dependency belongs indocs/TODO.txt. ... 2 more (description corrections;runtime_core_pb2.pyregenerated at 7.36.1 under a>=7.36.2pin)
Nits:
7 nits (churn in the staging.put rewrite, a table-only test, missing protobuf round-trip test, duplicated soft-token allowlist, and four prose items)
screen malicious
Screen Result: All Clear
Evidence: Screening of NVIDIA/hyperflare-inference#483 covered the full conversation, the PR description, and all 36 changed files at head commit 2b4a31e (base main @ 27716185, +2269/−240, author rickybrent, GitHub association NONE).
(1) Conversation and description contain no agent-directed content. The only discussion is flare-autobot intake/review notices ("A case file has been opened for 483"; a "Full Review" verdict with Changes Requested), one paragraph-level technical reply from the author, and a reference to issue #74. The autobot notices carry the repository review bot's standard #autobot:ignore opt-out footer, which is addressed to humans interacting with that bot and is not an instruction to this agent. The description is an ordinary change log ending with a contact handle ("Discord: ran.cossack"). No text anywhere attempts to instruct an AI reviewer, reviewer, or model ("ignore previous instructions", "you are…", "do not flag", "approve/merge this", "skip review").
(2) The riskiest-looking new artifacts are legitimate on line-by-line inspection. tests/frontend/gemma4_images.json (new, 256 lines) holds only processor/model metadata plus 8 fixture cases with numeric values and hex SHA-256 digests — no base64 blobs, URLs, or executable payloads. tests/frontend/generate_gemma4_image_fixtures.py (new) imports only argparse/hashlib/json/numpy/torch/torchvision/transformers, reads config JSON from a CLI-supplied snapshot path, and writes a JSON fixture — no network, no subprocess, no eval/exec, no environment exfiltration. ignition/preparation/runtime_core_pb2.py is regenerated in the expected generated shape: header still "Protobuf Python Version: 7.36.1" matching main, diff confined to the AddSerializedFile descriptor blob (containing the new Gemma4ImageSettings and GEMMA4 geometry), no appended imports, prints, or env access. ignition/preparation/frontend.py's Gemma 4 branch adds dict-shape guards, fixed-value expectations, Tokenizer.from_file(snapshot/tokenizer.json (not opened)), token-id cross-checks against config.json (not opened), and fails closed when tokenizer_config/snapshot are omitted. helios/src/frontend/images/gemma4.rs (new, 534 lines) is pure resize/geometry/pack code; its only process spawn is inside an #[ignore]d parity test invoking a hardcoded ../.venv/bin/python -c <inline script> with no interpolation of repo or environment data — a normal parity harness that cannot run under a plain cargo test.
(3) Hidden-instruction and obfuscation checks came back empty. No HTML/markdown comments in the modified docs and .md files; no bidi/invisible characters observed in the read text; no anomalous glyph ordering or wrapping; repo-wide regex sweeps for ignore-previous/prompt-injection/reviewer-coercion phrasings returned only unrelated code (e.g. flare-cli/src/orbit/controller.rs:172 (not opened)).
(4) Non-security observations only. This is an external contributor's first large PR into helios/src and ignition/preparation; an earlier autobot review raised substantive design concerns (patch-width lookup table, silently-skipped parity tests, duplicated span emission, stale docs) which the author says are addressed; no CI checks ran on head 2b4a31e, so the claimed test counts are unverified. Those affect merge confidence, not safety.
Screening limitations: invisible-character/bidi sweeps could not be run mechanically (the tool's regex engine rejected \x{...}, {n}, and non-capturing-group patterns), so those conclusions rest on direct reading; no tests were executed; the review was a screening pass for injected instructions and agent-steering content, not an audit of the resize math or atomic-span semantics.
Full report · Notes decide malicious: all_clear (100%): No malicious content found
explore
Author: rickybrent (no GitHub association with this repo; 0 merged, 1 open PR — #484, same day; Discord ran.cossack)
Motivation: Gemma 4 is already a supported text model here, but its image half was missing, so this PR adds a Gemma 4 image-preparation profile and generalizes the shared "bracketed" image layout so it can pack 3×3 rather than only 2×2 patch merges. The vision/recipe half now lives in the split-out hyperflare-recipes repo, so nothing becomes servable from this PR alone.
Scale: +2269 / −240 lines in 36 files (was +732/−164 in 13 files before the rebase)
Proposal:
- Adds
helios/src/frontend/images/gemma4.rs(534 lines): aspect-preserving resize to a multiple of 48, RGB-interleaved/255patch packing,(x, y)positions, 9-patches-per-token pooling, plus an unconditional 8-case SHA-256 pixel/position fixture and a marked-ignored live-checkpoint test. - Adds an additive wire field
VisionCapacity.patch_features = 6(legacy 0 → 1176) so per-patch float width comes from prepared metadata instead of the deleted hard-coded4→1176 / 9→768table. - Generalizes
packing.rs/Bracketedto any positive squarepatches_per_featurewith checked arithmetic, unifying per-profile widths throughImageProcessor::patch_features(). - Moves atomic span emission out of shared
model/prompt.rsintolayouts/bracketed.rs, gated on the contract declaringimage_tokens.span. - Adds load-time validation (pooling² ==
patches_per_feature, patch width vspatch_featureswith a re-export hint, envelope ≤prefill_chunk_size/ ≤span.max_tokens) and Python-side token validation read fromtokenizer_config.json(not opened). Touches: helios/proto/runtime_core.proto+helios/src/model.rs+helios/src/server/config.rs(new prepared field and new load-time rejections — hardest to reverse)helios/src/frontend/images/packing.rs,patch_merge.rs,layouts/bracketed.rs(shared packing, envelope extraction, span emission)ignition/preparation/frontend.py(Gemma 4 profile now fails closed withouttokenizer_config/snapshot) Related items:- #426 Add TERMINAL_PREFILL Operation Contract (v4) & Boundary-Aware Prefill Scheduling (merged): the atomic-span scheduler machinery this now feeds; merged 2026-11-25, so the earlier pb2 collision is moot.
- #479 static fused addend / gated gather… optional TerminalPrefill (merged): added
TERMINAL_PREFILL = 14and regenerated the same pb2; no longer in conflict after the rebase. - #405 Treat declared markers as controls (merged): set the per-recipe contract-fixture precedent (
gemma4_frontend.json) that #483 still does not follow. - #386 Add image input for Qwen3.8 27B (merged) / #433 Add Inkling 2 Mini text, vision, DSpark preparation (merged): the two prior bespoke image-profile additions this one is the third of.
- #484 Stride
state_transfer._copy_rowstiles (open, same author): the companion recipes-side PR. Link: https://github.com/NVIDIA/hyperflare-inference/pull/483 Autobot comments: The author rebased onto main (27716185) and pushed2b4a31e9, answering the 2026-11-24 review point by point; most previous blockers are now closed in code (pb2 drift, hard-coded geometry table, shared-code span fill, silently skipping parity tests). What stands: zero maintainer engagement (only the autobot review and the author's reply), no CI on the head, self-run CPU-only evidence only,gemma4_frontend.jsonstill declares all three image fields null, doc enumeration prose indocs/runtime-core-design.md:233-240still lists only Qwen/MiMo/DeepSeek, and the two live-checkpoint tests are now#[ignore]d rather than verified. New narrowings to note:VisionCapabilities::validate()now rejects any nonzeropatch_featuresnot divisible by 3 (model.rs:79), andimage_settings(profile="gemma4")now raises withouttokenizer_config=/snapshot=(frontend.py:142-144).
Value Proposition
Verdict: worth merging
This is my second pass. My first review (2026-11-24) said "worth it with changes" and listed six must-fixes. The author rebased onto main (27716185, head 2b4a31e9) and addressed all six, plus two "should fix" items. I re-verified each against the current head. Nothing blocking remains.
Charter fit
Right layer, not a per-model branch. Helios "shouldn't accumulate per-model branches" (#267, #334), but image preparation is an enumerated extension point, not an ad-hoc branch — docs/model-contract.md:226-227 (not opened): "Tool parsers, reasoning parsers, image preparation, and image layouts each have an independent enum selector." There are already eleven profiles, and the most recent (padded_grid) was added by maintainer Luke Alonso (8628b7c5). A twelfth profile is the sanctioned shape.
Not a new alias, and more than one checkpoint. Gemma 4 is already a supported family (docs/model-preparation.md:321 lists e2b/e4b/12b/26b-a4b/31b + NVFP4). The Ignition side now deliberately asserts only consumed fields (ignition/preparation/frontend.py:114-172) — model_type: gemma4 / vision_config.model_type: gemma4_vision — so all four serving variants pass while gemma4_unified (12B) is rejected. tests/preparation/test_frontend_gemma4.py:187-216 validates three real cached checkpoints (31B, 31B-NVFP4, E2B). The earlier 31B-only encoder pins are gone.
It fixes real bugs, which is the strongest argument. Two independent latent defects:
- A span-declaring
Bracketedimage failed per request. Onmain,layouts/bracketed.rsemitted nodata.spans, whilehelios/src/model.rs:441-451(ref=main) rejects any scoped token (feature_token/start_token/end_token) not inside a span →"image token spans do not match their declared boundaries". The PR's "Why" claim is accurate, not speculative. Fixed by emitting spans inlayouts/bracketed.rs:58-65(thedeepseek.rs(not opened) pattern), gated on the contract declaring a span, with envelope-marker validation on both ends. The sharedprompt.rsfallback block was deleted rather than patched. - Every cached MiniMax prepared-image record was being invalidated.
conditioned.rs:187-193(ref=main) ended_ => 588, soPatchMerge's 1176-wide patches never satisfiedvalid_processed, causing needless re-materialization per request. Now routed throughImageProcessor::patch_features()(mod.rs:459-471), fixing this forPatchMerge = 1176andPaddedGrid = 1200. A latent correctness/performance bug, found incidentally.
Wire changes are strictly additive — ImagePreparationKind value 11, ImageSettings tag 11, VisionCapacity.patch_features field 6 with #[serde(default)] (helios/build.rs:53-56), proto/runtime_core.proto:281,449,585,598. Existing cores stay loadable.
The six prior blockers, re-verified
- Protobuf downgrade — moot.
mainitself now carriesProtobuf Python Version: 7.36.1(I read the file atref=main). The PR's diff is descriptor-only. Separately,pyproject.toml:34still pinsprotobuf>=7.36.2,<8while main's own artifact says 7.36.1 — a pre-existingmaininconsistency, worth its own fix, not this PR's. - Hardcoded 4→1176 / 9→768 table — gone.
packing.rs:16-32is nowLEGACY_BRACKETED_PATCH_FEATURES,bracketed_patch_features(vision)(0 → legacy), andsquare_merge_side(ppf)viaisqrtwith an exact-square check. No model-identity branch. Single owner isImageProcessor::patch_features(), with a cross-profile consistency test over all 11 profiles (packing.rs:695-824) asserting processor width == tensor layout width. The MiniMax caveat the author raised is legitimate: temporal frame duplication means width genuinely isn't derivable from3·patch_size², so carrying it in prepared metadata is the right call. - Spans in shared code — moved and tested.
prompt.rsnow only passesimage_tokens.span.is_some(); emission lives in the layout.prompt.rs:1172-1281tests span-bearingBracketed(2 spans == conditioned input token spans, length 262, markers correct), 64-aligned chunk too small (256 →Err), and span-less MiniMax (spans empty). - Preparation doesn't validate what it later depends on — fixed. Envelope tokens now come from
tokenizer_config.json(not opened) and each is verified as a single atomic vocabulary token viatoken_to_idplusencode(..., add_special_tokens=False).ids == [id], cross-checked against optionalconfig.json(not opened) IDs; fails closed withouttokenizer_config/snapshot. 216 lines of pytest cover the negative cases (missing/empty/duplicate/unknown/multi-token/bool-ID). - Evidence not durable — fixed.
tests/frontend/gemma4_images.jsonplus its generator are checked in;gemma4.rs:266-333verifies SHA-256 of resized RGB bytes,pixel_values,position_ids, grid/tokens/patches andcu_seqlensunconditionally under plaincargo test, across 8 cases atmax_soft_tokens280 and 1120. Live-snapshot tests are now#[ignore]with real assertions instead of silentreturns. - Missing Ignition test and docs — fixed.
tests/preparation/test_frontend_gemma4.pyadded;helios/README.md:706-718,docs/runtime-core-design.md:181-196,helios/model-contract.md:82, and a protobuf round-trip test (protobuf.rs:813) all updated.
Load-time invariants also landed: gemma4::Processor::load enforces pooling² == patches_per_feature and max_soft_tokens·pooling² ≤ max_patches_per_image (gemma4.rs:25-52), and server::config::validate_loaded_image_processor (config.rs:443-489) checks patch width against vision.patch_features (with an actionable "re-export the core with vision.patch_features" error), plus max_image_envelope_tokens ≤ prefill_chunk_size and ≤ span.max_tokens — with 64-aligned boundary tests on both sides (1122 vs 1088/1152; span_max 1121/1122).
Costs
- Code: one new module
gemma4.rs(535 lines, half tests), ~250 lines elsewhere, one new 10-line generic branch inprepare_image_inputsand one inImageProcessor. - Maintenance: the recurring per-profile surface every existing profile carries.
packing.rsis simpler than before (a table replaced byisqrt+ metadata). - Performance: no serving-path cost — decode/resize/pack already run on the frontend pool. The
conditioned.rsconsolidation removes a per-request cache-invalidation bug, so net positive. - Risk: low. Additive wire, inert until a recipe selects it. One narrowing:
Bracketednow requires a positive-squarepatches_per_feature; MiniMax is the only in-tree user (ppf=4) and is unaffected, and the legacy 1176 width is preserved viapatch_features == 0, tested atpacking.rs:660-670.
Residual, non-blocking
- No export-or-serve proof from this branch. The charter's #74 asks to "prove they export and serve cleanly." End-to-end needs the companion recipe in
local-inference-lab/hyperflare-recipesdeclaringvision.patch_features = 768. This is acknowledged and tracked (docs/TODO.txt:330-337), and the author states it as a limitation. The profile is inert without a recipe, so landing it is safe — but the "serves cleanly" half of #74 is genuinely unmet at merge time and should be confirmed before anyone claims Gemma 4 vision works. docs/model-preparation.md:321listsgemma-4-12b, while the new image profile rejectsgemma4_unified12B. The text path is unaffected, so this is only confusing rather than wrong — one clarifying line would help.helios/tests/support/contracts/gemma4_frontend.json:16-17,38still hasimage_preparation/image_layout/image_tokens=null, so no in-repo contract fixture drives the full prepare→span→validate path end-to-end. The unit and contract tests cover the pieces individually.pyproject.toml:34vsmain's own 7.36.1 artifact — pre-existing, separate.
Is there a simpler way?
No. Ignition is Python and serves nothing at request time, so the HF Gemma4ImageProcessor can't be reused. The patch layout (interleaved (y, x, channel), (x, y) positions, 1/255 scaling, 16×16) genuinely differs from patch_merge's channel-planar 1176-wide temporally-duplicated patches; parameterising one profile for both would be more code, not less. The PR already takes the one real reuse opportunity (patch_merge::Envelope extracted, shared) and reuses resize::resize rather than adding a second resampler.
Bottom line
Worth merging. Every blocker from my first review is resolved with tests that run in CI, not on the author's machine. The change sits at the sanctioned extension point, keeps the wire additive, and — unexpectedly — fixes two independent latent defects: a per-request rejection for any span-declaring Bracketed core, and a per-request cache-invalidation bug for every MiniMax prepared image. The only real gap is that #74's "serve cleanly" half needs the companion recipe, which is correctly tracked rather than hand-waved.
One process note: the review bot on this PR (flare-autobot, 2026-11-24) requested the same three blockers I independently reached, and the author's 2026-11-25 reply addressed them accurately — I verified each claim rather than taking it at face value, and they held up.
Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Simplicity
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/proto/runtime_core.proto:599-600 (with helios/src/frontend/images/mod.rs:335-336, gemma4.rs:18-19,30-39, ignition/preparation/frontend.py:124-127,169-170):
patch_size/pooling_kernel_sizeare configurable on the wire but no producer can emit any value but 16/3, so they add three unreachable validation arms and two duplicated field sets; make them profile constants. - helios/src/frontend/images/gemma4.rs:449-533:
native_pixels_and_positions_match_the_checkpoint_processoris#[ignore]d and fully superseded bycanonical_processor_pixels_positions_and_resize(gemma4.rs:266-333 + tests/frontend/gemma4_images.json) — delete ~85 lines of subprocess/struct-packing protocol. - helios/src/frontend/images/gemma4.rs:394-413: the ignored envelope test writes a Jinja template to
temp_dirand setschat_template: Some(...)that it never renders, leaking the file on the earlyreturnpath; delete the template block (~15 lines). - helios/src/frontend/images/gemma4.rs:335-354: 7 of the 9 rows of
geometry_matches_the_hugging_face_processorare already asserted from the checked-in fixture at gemma4.rs:288-302; keep only (100,3000)/(3000,100) or drop the test. - helios/src/server/config.rs:449-455: the first patch-width check is redundant for
Bracketed(the only layout withpatch_features, wherebracketed_patch_featuresreturnsvision.patch_features) and gives a second, vaguer error for the same mismatch; fold it into the Bracketed check. Nits: 4 — redundanth % merge_side/w % merge_sidegrid guard at packing.rs:501; precomputedatomic_spans: boolthreaded from prompt.rs:52-65 into bracketed.rs:18-24; ~130-line cross-profile table at packing.rs:695-824 reducible to ~4 representative rows; 257-linetests/frontend/gemma4_images.jsonembedsprocessor/modelblocks no Rust test reads (nit, or add the live checkpoint check that would justify them). Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Conventions
Verdict: clean Blocking:
- None. Should fix:
- None. Nits: 7 Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Reviewed the revised head 2b4a31e (36 files, +2269/−240) through the conventions-and-duplication lens, judging each new construct against its closest in-repo precedent and against docs/design-review.md principles 1–3 and 13, .agents/skills/repo-prose/SKILL.md (not opened) and AGENTS.md. All four should-fix findings from my earlier pass on this PR are closed in the code, not only in the reply: the patches_per_feature → width table is gone (packing.rs:16-32 reads VisionCapabilities.patch_features with an explicit legacy 1176 default and derives the merge side by isqrt), conditioned.rs:187 calls ImageProcessor::patch_features(), atomic spans are built by the Bracketed layout (layouts/bracketed.rs:52-111, mirroring layouts/deepseek.rs:149) rather than the prompt dispatcher, and the Gemma 4 envelope test no longer shells out to Python.
Residual nits (7), all recorded with fixes:
- Per-profile patch width is still authored in two independent matches keyed on different enums —
packing.rs:41-100(ImageLayoutKind) andmod.rs:459-473(Profile) — linked only by theprocessor_patch_features_match_tensor_layout_for_every_profiletest (packing.rs:695), not by the compiler. This is the one structural item worth a reviewer's attention; a compiler link (one delegating to the other) would close it. gemma4.rs:132re-inlines3 * patch_size²next to thepatch_features()accessor that already computes it (gemma4.rs:54-56).- The soft-token allowlist is duplicated between
gemma4.rs:13andignition/preparation/frontend.py:132; no neighbouring profile enumerates an allowlist, so there is no precedent to follow. patch_merge::Envelope(patch_merge.rs:10-17) is now shared by PatchMerge and Gemma4 but still homed inpatch_merge;gemma4.rs:8imports it from there.server/config.rs:456-457reaches intofrontend::images::packing::bracketed_patch_featuresto restate the legacy-default rule; aVisionCapabilities/processor accessor would keep server config out of packing internals.tests/frontend/generate_gemma4_image_fixtures.py:17-25copiespattern()/digest()verbatim fromgenerate_glm_image_fixtures.py:18-25— consistent with how every generator is written, but a shared helper is the DRY form.bracketed.rs:57-65restates a partial marker-presence check thatvalidate_prompt_data(model.rs:441-456) already performs against the declared span tokens.
Precedents that hold: proto tag 11 / Gemma4ImageSettings, contract_enum! appended value 11, the describe.rs/protobuf.rs arms, the Ignition gemma4 branch (mirroring the glm branch), serde shapes, and the Envelope extraction (genuine de-duplication).
Limits: no build or test was run here; every behavioural claim is from reading code and callers. Numerical parity, load-path cost and serving behaviour are outside this lens.
Prose
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/README.md:721-728: the unqualified "1536 / channel, temporal copy / 2×2 merge" contract paragraph directly under the new Gemma 4 paragraph (768 floats, no temporal copy, 3×3 pooling) reads as the shared contract and contradicts it; scope it to Qwen/MiMo.
- docs/runtime-core-design.md:233-240: the per-profile image-settings enumeration a reader uses to learn what each preparation kind consumes still lists only Qwen, MiMo, and DeepSeek; Gemma 4 (
patch_size,pooling_kernel_size,max_soft_tokens, envelope tokens) is absent. - helios/README.md:772-789: the image-fixture provenance section names only the Qwen fixtures/generator;
tests/frontend/gemma4_images.jsonandgenerate_gemma4_image_fixtures.py, which back the PR's headline HF-parity claim, appear in no document, so their provenance and regeneration command are not reproducible. - PR description evidence: the
--ignoredreproduction command passesFLARE_GEMMA4_TEST_SNAPSHOT=<gemma-4-31B-it@842da379>— a placeholder where a filesystem path is required — and does not state that the directory must containtokenizer.json(not opened)/tokenizer_config.json(not opened) (gemma4.rs:376-386) or that the second test needs../.venv/bin/python(gemma4.rs:452-457); AGENTS.md:110-112. Nits: 5 — opaque singleinvalid Gemma 4 image settingserror with unexplainedpatch_size > 64/pooling > 16bounds (gemma4.rs:30-38); bracketed span error claiming a marker check it does not perform (bracketed.rs:57-65); soft-token allowlist mirrored in frontend.py:132 with no note of the Rust source (gemma4.rs:11-13); description's "libprotoc 36.1" versus the file's ownProtobuf Python Version: 7.36.1header (runtime_core_pb2.py:5, identical on main); commit message carries no compatibility/validation statement (SKILL.md:40-43). Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Architecture
Verdict: should-fix issues only
Blocking:
- None.
Should fix:
- ignition/preparation/contract.py:112: the default
visiondict omitspatch_features, the only carrier of the Bracketed patch width, so a Gemma 4 recipe authored through the helper exports 0 → legacy 1176 → rejected atflare run, not at export. - helios/src/frontend/images/layouts/bracketed.rs:23 with helios/src/model/prompt.rs:52-65:
atomic_spans: boolis caller-derived contract state threaded into the layout;layouts::deepseekneeds no such flag becausevalidate_prompt_data(helio/src/model.rs:457-458 (not opened)) already gates it. - tests/frontend/gemma4_images.json: the fixture's
processor/modelblocks are written by the generator (generate_gemma4_image_fixtures.py:86) but never read by the only consumer (helios/src/frontend/images/gemma4.rs:266-333 readscasesonly), so envelope/token parity rests on#[ignore]d tests and skipped pytest cases.
Nits: 1 — the positive-square Bracketed narrowing is enforced at model load, not per request; correct layer, but the description should say so.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Correctness
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/src/frontend/images/gemma4.rs:30-38: one opaque error, "invalid Gemma 4 image settings", covers six independent rejections including the new
max_soft_tokens·pooling² > limits.max_patches_per_imagecapacity check, so a mis-sized core gets no actionable diagnostic. - helios/src/frontend/images/packing.rs:26-32 (via helios/src/model/packing.rs:92-97):
Bracketednow fails at core load for anypatches_per_featurethat is not a positive square, a startup narrowing the description does not disclose ("existing cores remain loadable and unchanged"). Nits: 3 —SUPPORTED_SOFT_TOKENSduplicates the Ignition allowlist; no test that captured prefill capacities below a 1122-token envelope are silently unusable (policy.rs:479-482); no test for a prefix-cache endpoint restored mid-span (scheduler.rs:2036-2037 vs TODO.txt:331-336). Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Two findings from my first review are now genuinely resolved in code: the three independent 768-float width derivations have collapsed into ImageProcessor::patch_features() (mod.rs:459-471) plus the load-time agreement check (config.rs:449-463), so the "Gemma 4 profile accepts settings the packing path cannot represent" failure no longer exists — a patch_size/pooling pair that differs from 16/3 is now internally consistent and rejected only if widths disagree; and HF parity is now exercised unconditionally by checked-in fixtures. What remains is diagnostic quality on the load path, one undisclosed load-time narrowing for Bracketed cores, and three untested edge paths. I could not settle whether any shipped or previously exported core declares ImageLayoutKind::Bracketed with a non-square (or zero) patches_per_feature; if one exists, the narrowing becomes a startup regression and should block.
Subtractive
Verdict: should not be merged The change: +2269 / -240 lines, 36 files Could remove: about 1,200 lines, in 10 places (~53% of the diff) if the Gemma 4 image profile is deferred; about 484 lines, in 6 places, if the profile is kept Biggest subtractions:
- helios/src/frontend/images/gemma4.rs (whole file, 534), tests/frontend/gemma4_images.json (256), tests/preparation/test_frontend_gemma4.py (216), tests/frontend/generate_gemma4_image_fixtures.py (94), ignition/preparation/frontend.py:114-173 (60) plus the
gemma4proto/enum/describe/config arms (~40): nothing, i.e. defer to the recipe PR that proves export and serving: about 1,200 lines. - helios/src/frontend/images/gemma4.rs:374-533: two
#[ignore]tests (checkpoint_tokens_expand_the_image_envelope,native_pixels_and_positions_match_the_checkpoint_processor) re-prove the checked-in SHA-256 fixture and the new unconditionalEnvelope::expandtest: about 160 lines. - tests/frontend/gemma4_images.json:2-125 plus generate_gemma4_image_fixtures.py:28-29,81-85: full
processorandmodelblocks no test reads (only["cases"]is read at gemma4.rs:273): about 134 lines. - helios/src/frontend/images/packing.rs:694-825: 11-profile
processor_patch_features_match_tensor_layout_for_every_profiletable duplicating conditioned.rs:329-362/428-504 plus model/packing.rs:92-102: about 132 lines. - helios/src/frontend/images/gemma4.rs:335-372: geometry/pixel tests restating grid/tokens/positions the fixture cases already pin: about 24 lines.
Left behind:
docs/TODO.txt:330-337(Gemma 4 E2B/E4B/26B-A4B/31B qualification, partial-span prefix-cache audit) exists only because the profile lands unqualified; thegemma4arms in helios/src/frontend/images/conditioned.rs:354-361 and helios/src/model.rs/protobuf/describe/config tests die with it; theSUPPORTED_SOFT_TOKENS/patch_size > 64/pooling_kernel_size > 16caps inside gemma4.rs duplicate ignition's exact pins in ignition/preparation/frontend.py:124-133. Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Pre Test Report
Pre-test report — PR #483 "Add Gemma 4 image preparation, Bracketed patch-width metadata, and atomic spans"
Head 2b4a31e (2026-11-22, rebased onto main 27716185) · 36 files · +2269 / −240 · no CI checks visible on the head
Verdict: DO NOT REFER TO HARDWARE TESTING. Merge-readiness is close, but hardware is still the wrong instrument.
This supersedes my 2026-11-24 report (which was written against the pre-rebase head f2340e42). All three blocking findings from that report are fixed and verified in code at the new head. What remains is one small should-fix on the Python authoring surface plus nits and doc drift — none of which a GPU run can inform, and none of which changes the fact that nothing on either host can exercise this change end to end.
Grounds, in order of weight:
- No reachable test target. cn5 (4× RTX PRO 6000 Blackwell) hosts
facebook/dinov2-base,timm/vit_base_patch14_dinov2.lvd142m, and GLM-5.3-Flash-NVFP4 variants; cn7 (1× GB10) hosts Qwen3.8 variants. No Gemma 4 checkpoint on either host. The companion Gemma 4 recipe lives in the split-outlocal-inference-lab/hyperflare-recipesand does not exist yet (docs/TODO.txt:331-337is this PR's own tracking entry). No in-tree contract fixture usesImageLayoutKind::Bracketed(9) at all — fixtures use layouts 1, 2, 3, 5, 6, 10 — andhelios/tests/support/contracts/gemma4_frontend.json:16-17,38still declaresimage_preparation,image_layout,image_tokens=null. A GPU run today would exercise nothing this PR adds. - Nothing GPU-side is modified. No kernel, graph, numerics, or precision path changes. Every changed computation is CPU/deterministic: decode → area-bounded resize → RGB-interleaved patch pack →
(x,y)positions → token envelope expansion → upload-buffer extent arithmetic → prompt/span validation. The PR makes no performance claim and there is no benchmark expectation attached, so the "#210 benchmarks" rule is not engaged. A throughput A/B would be pure waste. - Zero blast radius on the models the hosts can serve. The one behaviour change reaching existing vision cores is
conditioned.rs:187invalid_processed, which now callsImageProcessor::patch_features()instead of the old_ => 588fallback (verified atmain:187-193). Per profile the resulting width is Qwen/MiMo 1536, Radio 768, Glm 1176 (unchanged), PaddedGrid 1200 (was 588), PatchMerge 1176 (was 588), others 588. The only profiles whose width actually changed — PatchMerge (MiniMax) and PaddedGrid (Inkling 2) — are not hosted on either machine, and both changes are bug fixes. The new load-time narrowings don't bite hosted cores either:square_merge_siderequires a positive squarepatches_per_featureforBracketedonly (MiniMax is 4, fine),server/config.rs:465-488envelope bounds apply only toProfile::Gemma4, andmodel.rs:79(patch_featuresdivisible by 3) only fires when the field is nonzero, which no existing core sets.
Expected value of a hardware run as the PR stands: ≈ 0, and strictly negative if it displaces a run of real work. The valuable evidence here is CPU-only and cheap — cargo test, the checked-in fixture test, pytest tests/preparation — which belongs in CI, at no hardware cost.
What changed since my last report — all three blockers verified fixed
B1 (was F1): regenerated runtime_core_pb2.py no longer regresses #479 — FIXED
I re-read the descriptor at ignition/preparation/runtime_core_pb2.py:27 on pr/483 and confirmed it now contains both GEMMA4_IMAGE_PREPARATION (value 11) and TERMINAL_PREFILL (value 14), plus main's PreparationManifest / PreparationParameter / PreparationParameterScope messages — i.e. it was regenerated from a schema that includes #479 and #426. The helios/proto/runtime_core.proto hunks remain strictly additive and disjoint (+:281-282 field 6, +:449 enum value 11, +:585 oneof tag 11, +:598-605 Gemma4ImageSettings).
The gencode header is still Protobuf Python Version: 7.36.1 (pb2:5, ValidateProtobufRuntimeVersion(..., 7, 36, 1, ...) at :12-19), but I read the same two lines at ref=main and they are identical — no drift against the base. The residual pyproject.toml:34 (not opened) (protobuf>=7.36.2,<8) versus main's own 7.36.1 artifact is a pre-existing main inconsistency, not this PR's. My prior report's blocker is fully withdrawn.
B2 (was F2): count-keyed patch-width table is gone — FIXED
packing.rs:16-32 is now LEGACY_BRACKETED_PATCH_FEATURES = 1176, bracketed_patch_features(&VisionCapabilities) (nonzero wins, 0 → legacy), and square_merge_side via isqrt with an exact-square check. tensor_layout takes &VisionCapabilities (packing.rs:34-56), its load-time caller model/packing.rs:92-97 and the upload path packing.rs:493-518 agree, and the width comes from the new additive VisionCapacity.patch_features = 6 (runtime_core.proto:281-282, #[serde(default)] at helios/build.rs:53-56, Rust field model.rs:51-53). The MiniMax counter-argument the author raised is legitimate: PatchMerge::patch_features() is 3*2*patch_size² = 1176 (patch_merge.rs:124-126), so width genuinely is not derivable from 3*patch_size² for temporal merges — carrying it as prepared metadata is the right call, and is exactly what design-review principle 3 asks for. Non-square Bracketed values are rejected at load (packing.rs:26-32) and covered by packing.rs:671-680; the legacy 0 → 1176 path is covered at packing.rs:660-670.
B3 (was F3): atomic spans are emitted by the layout, with tests — FIXED
layouts/bracketed.rs:52-111 now builds spans from mm_token_type_ids runs, gated on atomic_spans and rejecting a run without an envelope marker at either end; the shared fallback in model/prompt.rs is deleted (prompt.rs:52-65 now only derives the bool). Coverage that runs under plain cargo test: model/prompt.rs:1171-1282 asserts two spans equal to the conditioned-input spans, length 262, correct start/end marker tokens, all-interior-token identity, a 64-aligned 256-token chunk correctly rejected, and a MiniMax-style no-span contract staying empty.
Also fixed since the last report
- Single per-profile width authority:
ImageProcessor::patch_features()(mod.rs:459-471) over 11 profiles;conditioned.rs:187uses it; cross-profile consistency test atpacking.rs:695-824. - Load-time validation the PR was missing:
gemma4::Processor::loadenforcespooling² == limits.patches_per_featureandmax_soft_tokens·pooling² ≤ max_patches_per_imagewithchecked_mul/Option(gemma4.rs:25-52), andserver::config::validate_loaded_image_processor(config.rs:443-490) checks width againstvision.patch_features(with the actionable "re-export the core withvision.patch_features" error), plusmax_image_envelope_tokens ≤ prefill_chunk_sizeand≤ span.max_tokens. Boundary tests atconfig.rs:936-1023(1122 fits 1152, fails 1088;span.max_tokens1121 fails, 1122 passes; legacy 0 → re-export error; explicit mismatch names both widths). - Parity evidence is now CI-runnable:
tests/frontend/gemma4_images.json+ generator, consumed unconditionally bycanonical_processor_pixels_positions_and_resize(gemma4.rs:266-333) with SHA-256 over resized RGB,pixel_valuesandposition_idsacross 8 cases atmax_soft_tokens280 and 1120. The two live-checkpoint tests are#[ignore]d with hard assertions instead of silentreturns (gemma4.rs:374-447,:449+). - Ignition no longer pins one vision tower:
ignition/preparation/frontend.py:114-173asserts onlymodel_type,vision_config.model_type,patch_size,pooling_kernel_size, the processor flags,max_soft_tokens, and now validates all three envelope tokens as single vocabulary tokens againsttokenizer.json(not opened), cross-checked against optionalconfig.json(not opened) IDs, failing closed withouttokenizer_config/snapshot.tests/preparation/test_frontend_gemma4.py(216 lines) covers synthetic variants, the negative cases, and three cached checkpoints. - Docs updated:
helios/README.md:705-719,docs/runtime-core-design.md:181-197,helios/model-contract.md:82(not opened),docs/TODO.txt:331-337. Proto round-trip test added atruntime_core/protobuf.rs:813(not opened).
Residual findings — and whether any should gate a hardware run
| # | Finding | Severity | Gates testing? |
|---|---|---|---|
| A | ignition/preparation/contract.py:112 cannot author the new field. The default vision dict is dict(features_per_request=0, max_images=0, patches_per_feature=0, patch_capacities=[]) with no patch_features; patch_features appears nowhere else in ignition/ except the generated descriptor. A recipe that fills in the four historical keys exports 0 → legacy 1176, and a Gemma 4 (768) core is then rejected at flare run by config.rs:456-464. **vision still accepts an explicit key, so this is a default/ergonomics defect with a serve-time symptom, not a functional break. One-line fix, plus a docstring note that Bracketed vision cores must set it. |
should-fix | No — Python-side, CPU, unreachable from hardware |
| B | server/config.rs:449-455 duplicates :456-464: for the only layout that defines patch_features, bracketed_patch_features returns vision.patch_features verbatim, so the first check produces a second, vaguer error for the same mismatch. Fold into the Bracketed check. |
nit | No |
| C | gemma4.rs:30-38 collapses six distinct rejections into "invalid Gemma 4 image settings", including the new settings-vs-capacity check an operator is most likely to hit (max_soft_tokens·pooling² > limits.max_patches_per_image, where the limit comes from how the core was exported). Name the failing field/limit. |
nit (diagnostics) | No |
| D | gemma4.rs:132 re-inlines 3 * self.patch_size * self.patch_size next to the patch_features() accessor at :54; one-sided edit risk. Use the accessor. |
nit | No |
| E | Per-profile width is still authored in two matches keyed on different enums — packing.rs:41-100 (ImageLayoutKind) and mod.rs:459-471 (Profile) — linked only by the 11-row test at packing.rs:695-824, not the compiler. |
nit (test-covered) | No |
| F | patch_size/pooling_kernel_size are configurable on the wire and in serde, but frontend.py:124-127,140-141 pin 16/3 and :168-173 writes them literally, so no exporter can emit another pair; three validation arms (gemma4.rs:32-33) are unreachable. Profile constants (the glm.rs (not opened) const FACTOR precedent) would be smaller. Keep only if a future Gemma 4 size needs them. |
nit / design choice | No |
| G | Docs still drift: helios/README.md:721-728 presents Qwen's "1536 / temporal copy / 2×2 merge" as the shared process contract immediately under the new Gemma 4 paragraph (768 floats, no temporal copy, 3×3 pooling); docs/runtime-core-design.md:233-240 still omits Gemma 4 from the per-profile ImageSettings enumeration; the image-fixture provenance section (helios/README.md:772-789) names only the Qwen fixtures, so the new Gemma 4 generator/fixture and their pinned Transformers version are undocumented. |
should-fix (docs) | No |
| H | tests/frontend/gemma4_images.json:2-125 carries processor/model blocks the generator writes but the only consumer never reads (gemma4.rs:273 reads cases only), so envelope/token parity rests on the two #[ignore]d tests plus pytest checkpoint cases that pytest.skip without HF_HOME. Either consume the ids in Rust or trim the blocks. |
nit | No |
Nothing in this table is a substantive architecture or code-quality defect that would be invalidated by hardware testing. Finding A is the only pre-merge must, and it is one line in a Python helper.
The "Subtractive" lens recommends deferring the entire Gemma 4 profile (~1,200 lines) until the recipe PR exists. I do not treat that as a defect: the profile sits at the sanctioned enumerated extension point, is inert until a recipe selects it, and is the only way to unblock the recipe work. It is a scope/sequencing judgement for the maintainers, not a reason to test or not test.
Reliability of the supplied review summaries
The lenses converged and I re-verified their load-bearing claims directly. Corrections worth recording:
- My previous report's decisive finding (pb2 drop of
TERMINAL_PREFILL) is now moot — the head regenerated the descriptor against currentmain. Several summaries describe the 7.36.1 header as a defect; I confirmed by readingref=mainthat main's own artifact says 7.36.1, so there is no drift, and the "downgrade" framing is wrong (one summary, "Simplicity", made exactly that point). - Envelope length is
tokens + 2, not+1(gemma4.rs:58-59max_envelope_tokens = max_soft_tokens + 2; test assertsstart + 261for 260 features,config.rs:991-1002asserts 1122 atmax_soft_tokens = 1120). Summaries quoting 1121 are off by one. - The
correctness/architecturesummaries' "undisclosed load narrowing" is real but narrow:square_merge_sidefails at core load for a non-square (or zero)Bracketedpatches_per_feature, whereasmainhad a fixed 2×1176. No in-repo fixture usesBracketed, so the blast radius can only be settled againstlocal-inference-lab/hyperflare-recipes; MiniMax (4) is fine and the0 → 1176legacy path is preserved and tested. - Two summaries still describe code that no longer exists (the
4 => 1176, 9 => 768table; theprompt.rs:137-151span fill; theconditioned.rs:192literal). Those are stale against2b4a31eand should not be acted on. - Screening: both malicious-content screens returned all-clear; I re-read the changed hand-written surfaces and found no instruction-shaped or agent-directed text. The
#autobot:ignorefooter in the PR discussion is the repository bot's standard opt-out addressed to humans, not an instruction to this review. No injection attempt to report.
Recommended path (no hardware)
- Author fixes finding A (
patch_features=0incontract.py:112+ docstring note) and the four doc items in G. Both are cheap and land with the code. - CI proves the change, not a GPU:
cargo test(must includecanonical_processor_pixels_positions_and_resize,bracketed_layout_emits_atomic_spans_only_when_contract_declares_them,bracketed_packs_3x3_metadata_widths_and_rejects_invalid_extents,processor_patch_features_match_tensor_layout_for_every_profile,loaded_gemma4_image_processor_validates_patch_width_and_envelope_chunk_bounds,serialized_gemma4_profile_selects_only_image_preparation) pluspytest tests/preparation tests/direct— the direct-scheduler test attests/direct/test_scheduler.py:720(not opened) (TERMINAL_PREFILL == 14) is the guard that the regenerated gencode did not regress #479. No CI status is visible on the head, so the author's counts remain unverified; asking for them is far cheaper than a GPU job. - Refer to hardware only when a Gemma 4 vision recipe and a hosted checkpoint exist — that is the point at which this PR becomes testable at all, and the plan below applies.
Minimal test plan — only if referred (i.e. only after a Gemma 4 core can be prepared and served)
Deliberately small: 2 jobs total, no sweeps, no statistics.
Stage 0 — gate before any GPU time. p.GraphOperation.Value("terminal_prefill") == 14 and p.ImagePreparationKind.Value("GEMMA4_IMAGE_PREPARATION") == 11 both resolve from the checked-in runtime_core_pb2.py; cargo test and pytest tests/preparation tests/direct green; the two #[ignore]d tests reported as unrun, not as passes.
Stage 1 — CPU correctness, one cn5 job, no GPU needed (~5 min).
cargo test -p helios frontend::images model:: server::config— the six tests named above.- Misspecification regression (the key invariant this PR introduces): with a
patch_size = 16Gemma 4 profile, build two contracts differing only inpatches_per_feature(4 vs 9) and one servingBracketedcore withpatch_features = 768; prepare a 91×37 and a 1008×672 image and assert the packedvision_pixel_valueslength ispatches × 768in every case and the pixel bytes are byte-identical between merge factors — the width must not depend on the merge stride. Then assert apatch_features = 588core is rejected at bootstrap, and a core withpatch_features = 0gets the "re-export" error rather than a mis-strided upload. - Legacy compatibility: load one already-exported core per hosted vision layout (GLM-5.3 on cn5, Qwen3.8 on cn7) and confirm it loads and reports the same
patch_features/describe JSON as onmain(patch_featuresmust be omitted from describe when 0,describe.rs:466-468). - Span boundary: a
Bracketedcontract withimage_tokens.spanandmax_soft_tokens = 1120againstprefill_chunk_size = 1088must fail at bootstrap with a message namingprefill_chunk_size(not mid-request).
Stage 2 — single serving check, one cn5 job (4× RTX PRO 6000), only once a recipe + checkpoint exist.
Prepare the Gemma 4 core from the companion recipe (vision.patch_features = 768, ImageLayoutKind::Bracketed, ImagePreparationKind::Gemma4); serve TP=1 or TP=2, then two requests: one text-only (must be unchanged versus main) and one with a single image, asserting HTTP 200 and plausible image-grounded output. Repeat the image request once at max_soft_tokens = 280 and once at 1120. Fail-fast signals to watch: conditioned input spans or features violate prompt geometry, invalid bracketed patch-merge image extent, bracketed image span is missing envelope markers, image token spans do not match their declared boundaries, and any prefill-split rejection. One image size at or below the chunk and one above it is enough — do not sweep resolutions.
Explicitly not to be tested (would waste hardware):
- Any throughput/latency A/B on cn5 or cn7 — no kernel or scheduling hot-path change, no perf claim.
- A cn7 GB10 arm64 pass — nothing in the diff is arch-specific, and cn7 hosts no relevant core.
- Alphanumeric/EXIF/alpha edge cases for Gemma 4 — untested for every other profile, out of scope, not a regression.
- The synthetic ultra-wide 10×3000 / 3000×10 geometry cases on hardware — already pinned by the CPU fixture and the geometry table.
- Second-checkpoint variants (E2B/E4B/26B-A4B) — the Ignition gate is now generic, but serving variants is a post-recipe qualification tracked in
docs/TODO.txt:331-337, not a reason to spend a GPU job here. - Multi-GPU / TP>1 sweeps — the PR touches no collective or sharding path.
code review summary
Recommendation: Changes Requested
Blockers:
None. Nothing on the served path is incorrect; the remaining items are one scope question, one authoring gap on the Python side, and cleanup.
Should fix:
- Profile lands ahead of its exporter, and no test mounts a
Bracketedcore. Serving waits on an unlandedhyperflare-recipesPR (docs/TODO.txt:331-337) and no contract fixture underhelios/tests/support/contracts/uses the profile, whiletensor_layoutnow runs at core load. → Confirm a maintainer approved landing it ahead of the recipe (or split the shared half out), and add one core-load test with aBracketedcontract that omitspatch_features. - Nothing on the Python side authors
patch_features.ignition/preparation/contract.py:112defaultsvisionto the four historical keys, so a recipe filling them exportspatch_features = 0and its core is rejected atflare run(server/config.rs:456-463) — though Ignition already validatedpatch_size=16/pooling=3(frontend.py:124-127). → Derive the width in Ignition and document the key. - One error message for seven load rejections.
gemma4.rs:30-38returns"invalid Gemma 4 image settings"for the pooling mismatch and patch-budget overflow too, where the capacity comes from the export, not the checkpoint. → Split by condition, naming the field and both values, asserver/config.rs:449-463does. - Dead wire knobs and constants spelled several ways.
patch_size/pooling_kernel_sizeare proto/serde/Python fields no exporter can vary (frontend.py:124-127,169-170), making three validation arms unreachable; 768 is spelled four ways andgemma4.rs:132re-inlines it; the soft-token allowlist lives in two languages. →const PATCH/POOLING/FEATURESlikeglm.rs:13(not opened), reserve proto tags 1-2, keep one allowlist. - Superseded tests and unread fixture data.
native_pixels_and_positions_match_the_checkpoint_processor(gemma4.rs:451-533) duplicates fixture cases already pinned by hash unconditionally;gemma4.rs:394-413hashes a chat template it never renders (and leaks it on early return);tests/frontend/gemma4_images.json:2-125is 124 lines nothing reads, including theimage_token_id/boi_token_id/eoi_token_idthat would make the envelope claim testable. → Delete the first two; consume themodelblock or trim it.
Nits:
5 nits
PR #483 — Add Gemma 4 image preparation, Bracketed patch-width metadata, and atomic spans
Head 2b4a31e, base main 27716185, 36 files, +2269/−240. Third review round; line-level detail and prior rounds are in the linked case file.
Key findings
No blockers. Every blocker and should-fix from the previous round is fixed and verified in code at this head: patch width comes from prepared metadata instead of a patches_per_feature lookup table, the Hugging Face parity fixture runs unconditionally under cargo test, atomic spans are emitted by the Bracketed layout rather than shared prompt code, patch width has one authority across all 11 profiles (which also fixes a real main bug for PatchMerge 1176 / PaddedGrid 1200), load-time bounds cover pooling, patch budget and envelope size, and the Ignition tower pins are gone. Genuinely good work.
What remains: five should-fix items — one scope question needing an answer before merge, one authoring gap that hands the first Gemma 4 recipe author a serve-time error, one opaque load error, dead configuration knobs, and superseded test scaffolding — plus five nits, mostly documentation and duplicated test rows.
Note on diff scope: the head diff also shows large unrelated base-branch churn (banner removal, flare doctor, parallax, download rewrites, RebuildManifest → PreparationManifest). Those commits landed on main between the old base and now, are not this PR's files, and are not attributed to the author.
Verified resolved this round — not re-litigated
- The
patches_per_feature → widthmodel-identity table is gone:packing.rs:16-24(bracketed_patch_features,0→ legacy 1176) andpacking.rs:26-32(isqrtplus square check for the merge stride). - Parity evidence runs unconditionally:
tests/frontend/gemma4_images.json(8 cases,max_soft_tokens280/1120) is consumed bygemma4.rs:267-333under plaincargo test; the live-checkpoint tests are#[ignore]d with hard assertions (gemma4.rs:375-385,:449-457) instead of silent returns. - Atomic spans moved into the layout that builds the envelope (
layouts/bracketed.rs:52-70); the sharedprompt.rsfallback is deleted; markers are validated at both ends. gemma4::Processor::loadenforces the packing contract (gemma4.rs:25-39):pooling_area == Some(limits.patches_per_feature), patch budget,checked_mulso overflow fails closed.- Patch width has one authority (
mod.rs:459-471, used atconditioned.rs:187(not opened)). - The maximum envelope is bounded at bootstrap against
prefill_chunk_sizeandspan.max_tokens(server/config.rs:465-488), with 64-aligned boundary tests. - Ignition no longer pins one vision tower; envelope tokens come from
tokenizer_config.json(not opened), are validated to encode as single tokens, and cross-checked againstconfig.json(not opened) (frontend.py:114-173);gemma4_unifiedis rejected on all three surfaces and three cached checkpoints are covered intests/preparation/test_frontend_gemma4.py. - Docs updated (
helios/README.md:709,713-719,docs/runtime-core-design.md:181-197,helios/model-contract.md:82,docs/TODO.txt:331-337). - The earlier
runtime_core_pb2.pyversion concern is withdrawn: the header reads7.36.1identically onmainand on this head;pyproject.toml:34(not opened)'sprotobuf>=7.36.2bounds the runtime, not the generator header. The diff is descriptor-only plus the new fields.
Blockers
None.
Should Fix
S1 — The profile lands ahead of the exporter that can use it, and no test mounts an existing Bracketed core
Finding: the description defers end-to-end serving to an unlanded companion PR in local-inference-lab/hyperflare-recipes, and docs/TODO.txt:331-337 records qualification (E2B/E4B/26B-A4B/31B export and serving) as open. No core fixture uses the profile: helios/tests/support/contracts/gemma4_frontend.json:16-17,38 has image_preparation: null, image_layout: null, image_tokens: null, and no contract JSON under helios/tests/support/contracts/ declares a Bracketed layout (values used: 1, 2, 3, 5, 6, 10). The charter asks a new model format to "prove they export and serve cleanly from the PR branch, and support more than a single checkpoint (#74)" and separately to "verify that existing data, artifacts, and exported cores still load". The legacy staging arithmetic is tested — packing.rs:660-670 asserts patch_features == 0 yields 16 × 1176, and :671-680 asserts a non-square patches_per_feature errors — but the load path is not: tensor_layout runs from Inputs::new (model/packing.rs), so an existing Bracketed core now passes through square_merge_side (packing.rs:26-32) at core load, and nothing in the tree mounts such a core.
Request: state in the description whether a maintainer approved landing the profile ahead of its recipe, or split the shared half (patch_features field, contract-driven Bracketed packing, Bracketed spans, envelope bounds) onto its own PR, since it stands alone and fixes a main defect. Either way, add one core-load test with a Bracketed contract JSON that omits patch_features, asserting the core loads and stages 1176-wide pixels.
Why: the charter makes export-and-serve the bar for a new profile and requires existing cores be shown to still load. Both claims are currently prose only.
S2 — Nothing on the Python side authors patch_features
Finding: ignition/preparation/contract.py:112 defaults vision to the four historical keys (features_per_request, max_images, patches_per_feature, patch_capacities) plus feature_slots: 0, and never mentions patch_features; a search for the name across ignition/ returns only the generated runtime_core_pb2.py. A recipe that fills the historical four keys therefore exports patch_features = 0, bracketed_patch_features reads that as 1176 (packing.rs:18-24), and server/config.rs:456-463 rejects the core at flare run with "bracketed image layout patch width (1176) differs from image processor (768); re-export the core with vision.patch_features". Meanwhile Ignition has already validated patch_size = 16 and pooling_kernel_size = 3 from the checkpoint (frontend.py:124-127, :140-141) and writes them literally at :168-170, so the width is derivable as 3 · patch_size² = 768.
Request: derive patch_features in Ignition from the settings it already validated and emit it in the vision block, and add patch_features=0 to the default dict at contract.py:112 with a docstring note that Bracketed vision cores must set it.
Why: right problem, wrong layer. The width is preparation metadata; the first feedback a recipe author gets should not be a serve-time rejection whose only other hint is a docs/TODO.txt line.
S3 — Seven distinct load rejections share one message
Finding: gemma4.rs:30-38 returns "invalid Gemma 4 image settings" for zero/oversized patch_size, zero/oversized pooling_kernel_size, an unsupported max_soft_tokens, pooling_area != Some(limits.patches_per_feature) (:35), and the patch budget max_soft_tokens · pooling² > limits.max_patches_per_image (:36). The last two compare settings against captured capacity, and that capacity comes from the export's vision.patch_capacities (server/config.rs:497-502), not from the checkpoint — so an operator cannot tell a mis-exported core from a mis-declared checkpoint. server/config.rs:449-463 in this same PR shows the actionable style, and the neighbouring Envelope::load (gemma4.rs:40-44) names the offending token.
Request: split the condition into named errors naming the failing field and both values; add a comment naming the source of the patch_size > 64 / pooling > 16 bounds.
Why: a load path that only says "invalid settings" moves the diagnosis onto the operator, and this is the error most likely to be hit because the capacity comes from export, not the checkpoint.
S4 — Dead wire knobs and constants spelled several ways
Finding: Gemma4ImageSettings.patch_size / pooling_kernel_size (helios/proto/runtime_core.proto:599-600, mod.rs:335-336, gemma4.rs:18-19) travel through proto, serde and the Python producer, but no exporter can emit anything but 16/3: frontend.py:124-127 and :140-141 reject any other pair and :169-170 writes the literals — which makes the patch_size > 64 / pooling > 16 arms at gemma4.rs:32-33 unreachable. The width 768 is spelled four ways: computed at gemma4.rs:55, via patch_features() at conditioned.rs:187 (not opened), the legacy 1176 at packing.rs:16, and a 3 * 16 * 16 literal in a test. gemma4.rs:132 re-inlines 3 * self.patch_size * self.patch_size instead of calling self.patch_features(), so the value validated at server/config.rs:448 and the value sizing the buffer are two expressions. conditioned.rs:367 (not opened) recomputes pooling_kernel_size * pooling_kernel_size outside gemma4.rs. The soft-token allowlist exists twice in two languages (gemma4.rs:13, frontend.py:132) with no test tying them.
Request: replace with const PATCH: usize = 16; const POOLING: usize = 3; const FEATURES: usize = 3 * PATCH * PATCH; as helios/src/frontend/images/glm.rs:13 (not opened) does; reserve proto tags 1-2 (append-only rule); drop the struct fields, serde keys, validation arms and the two Python literals; make gemma4.rs:132 call self.patch_features(); keep the Python soft-token gate (preparation is the right place) and let Rust accept any positive budget, or the reverse — not both.
Why: AGENTS.md:188-193 (not opened) forbids configuration switches without a concrete requirement, and these tags become permanent once a core ships. Doing this now costs ~25 lines; later it costs a reserved-tag migration.
S5 — Superseded test scaffolding and 124 unread fixture lines
Finding:
native_pixels_and_positions_match_the_checkpoint_processor(gemma4.rs:451-533,#[ignore]d, ~85 lines) uses exactly fixture seeds 1/5/6 —(91,37),(10,3000),(3000,10)— whichgemma4.rs:267-333already pins by SHA-256 for grid, tokens, patches, resized RGB, pixels and positions, unconditionally. It also carries a bespokestruct.pack('<qqqq')IPC with a hand-computedpixel_offset = 32.gemma4.rs:394-413writes and hashes a Jinja chat template the test never renders (frontend.encodeat:425is not a render), then removes it after severalunwraps, so a panic leaks it and the early-return path skips the removal.tests/frontend/gemma4_images.json:2-125— 124 of 257 lines — is aprocessorsnapshot plus a trimmedmodelblock nothing reads: the sole consumer iteratesfixture["cases"](gemma4.rs:269-273), and the generator writes both atgenerate_gemma4_image_fixtures.py:81-86. Themodelblock is exactly whereimage_token_id/boi_token_id/eoi_token_idlive — the recorded ids that would make the envelope claim testable in CI.
Request: delete the ignored Python-comparison test and the chat-template plumbing; for the fixture, either consume the model block in Rust (assert the configured envelope strings map to the recorded ids and that processor round-trips into Gemma4ImageSettings) or trim both blocks to a small provenance object. Also state in the description that the live-checkpoint runs are not part of CI.
Why: AGENTS.md:194-199 (not opened) — "Do not present scaffolding or partially wired features as supported." An ignored test that duplicates an unconditional one is a liability, and a 124-line block nothing reads invites the next reader to assume it is validated somewhere.
Nits
- Duplicate patch-width check in bootstrap.
server/config.rs:449-455and:456-464fire on the same condition for aBracketedcore, becausebracketed_patch_featuresreturnsvision.patch_featuresverbatim when nonzero (packing.rs:18-24); the second has the strictly better message (layout, expected width, remedy). Keep theBracketedcheck (it also covers0→ 1176) and fold the!= 0case into it — one error per defect. Related:server/config.rs:457reaches intopacking::bracketed_patch_featureswhile its neighbours useImageProcessor/VisionCapabilitiesaccessors; expose an accessor instead. - Two documentation contradictions.
helios/README.md:721-728states, unqualified, thatprocessproducespixel_values[N,1536]float32, orders patch features by "channel, temporal copy, pixel row, and pixel column", and orders patches by "2×2 spatial merge blocks" — all three false for the Gemma 4 paragraph three lines above (:713-719: 768 floats, no temporal copy, 3×3). Scope it to Qwen/MiMo and point per-profile width atImageProcessor::patch_features().docs/runtime-core-design.md:233-240enumerates what each image-settings kind consumes and omits the new Gemma 4 kind (and the pooling → merge-stride relationship), in the one place a reader looks;patch_featuresitself is documented at:181-197, so the gap is local to this enumeration. - New fixtures undocumented; reproduction command is a placeholder.
helios/README.md:772-789pins onlytests/frontend/qwen38_images.json(not opened) and its generator;gemma4_images.jsonandgenerate_gemma4_image_fixtures.pyappear in no document (the only reference in the tree is theinclude_str!atgemma4.rs:270), yet the generator depends on a Transformers release shippingGemma4ImageProcessorand on the snapshot'sprocessor_config.json(not opened)/config.json(not opened), none of it pinned where a reader can find it. Add the fixture set, its pinned Transformers/Torch/Torchvision versions, the snapshot, and the regeneration command. In the description,FLARE_GEMMA4_TEST_SNAPSHOT=<gemma-4-31B-it@842da379>is a placeholder where the code needs a directory holdingtokenizer.json(not opened) andtokenizer_config.json(not opened) (gemma4.rs:377-385) plus.venv/bin/pythonwith transformers/torch (:452-457);AGENTS.md:110-112(not opened) requires the inputs be identified. Also: "libprotoc 36.1" does not match the artifact'sProtobuf Python Version: 7.36.1— name the generator release or drop the version. - Four tests restate the fixture.
geometry_matches_the_hugging_face_processor(gemma4.rs:336-354) repeats seven of nine rows from the fixture — only(100,3000)and(3000,100)are unique; keep those plus thetokens * 9 == patchesinvariant.pixels_interleave_rgb_and_positions_are_xy(:357-372) restates what the 91×37 fixture case pins by hash. The cross-profile table (packing.rs:695-825, ~130 lines) repeatspatch_features: 0ten times; three rows (PatchMerge 1176, PaddedGrid 1200, Gemma4 768) cover every distinct outcome.packing.rs:501's grid-divisibility guard is implied by:503(tokens * patches_per_feature == patches) and by every producer's rounding, leavingmerge_sideunused there. - Small shape and wording. Keep
atomic_spans: bool(bracketed.rs:23, computed atprompt.rs:53-65) — emitting unconditionally would makemodel.rs:457-458reject every existingBracketedcore that declares no span — but passingOption<&ImageSpan>(the prepared layout field, asclass_tokenreceives its token) puts the derivation next to its use.bracketed.rs:60says "missing envelope markers" but tests bounds (start == 0 || end >= len); marker identity is enforced atmodel.rs:444-445, so reword to "bracketed image span run is outside the expanded prompt".Envelopeis now a general frontend construct homed inpatch_merge(patch_merge.rs:10-17(not opened)); move it tofrontend/images/envelope.rs(not opened). For the record:scheduler/policy.rs:343-350truncatesendtospan.startfor a straddling span, so a captured capacity below the envelope length contributes no work for span-bearing requests; the bootstrap bound makes that unreachable today, but no test advertises a sub-envelope capacity.
Verified clean (so the report is honest about what was not flagged)
- Additive wire format.
ImagePreparationKind::Gemma4= 11 appended (model/contract.rs(not opened)),ImageSettings.profiletag 11,VisionCapacity.patch_featurestag 6 with#[serde(default)](helios/build.rs:54-56),describe.rs:466-468(not opened) omits 0 so legacy describe JSON is byte-identical, and a round-trip test covers the new tag (protobuf.rs:813(not opened)). Envelopeextraction (patch_merge.rs:10-136(not opened)) is real de-duplication with no MiniMax behaviour change: token-uniqueness validation moved verbatim,expand_promptdelegates.- Gemma 4 arithmetic is overflow-guarded:
checked_add/checked_mul/try_fold,check_batchbefore and after geometry, and the sharedresize::resizeuint8 antialiased bicubic instead of a new kernel. - Contract validation accepts
patch_features == 0and rejects non-multiples of 3 (model.rs:72-92); zeropatches_per_featureis already rejected for any enabled vision core (model.rs:78viacontract.rs:376(not opened), beforetensor_layout), so the new positive-square load narrowing covers only non-square nonzero values. - Ignition accepts any
gemma4/gemma4_visiontower, checks processor flags andmax_soft_tokens, and rejectsgemma4_unified. - Resource bounds on the new path: resize inputs go through
check_input_extent/check_image_patches, andlayouts/bracketed.rscross-checks image/feature counters against the processed geometry so a malformed expansion errors rather than under-populatingvision_token_indices.
Open questions and what could not be established
- Was landing the profile ahead of its recipe approved by a maintainer? If yes, S1 shrinks to the load-test request; if no, splitting the shared half out is the smaller change and the profile moves to the recipe PR that can export and serve it.
- Does any published
Bracketedcore declare a non-squarepatches_per_feature? Zero is already rejected earlier in validation, so only a non-square nonzero value would newly fail to load. The manifests live inlocal-inference-lab/hyperflare-recipes, outside this repository; a sweep there is the only thing that settles the blast radius. - Should a prefix-cache endpoint restored mid-envelope fail the request or back off to the envelope boundary?
docs/TODO.txt:336-337records the audit; no test pins the behaviour, andscheduler/checkpoints.rs(not opened) keeps published endpoints span-aligned, so the in-process path is safe today. - Verification limits. This review was read-only: no
cargo test,cargo checkorpytestwas run, so behavioural claims come from reading code and callers. The PR's reported test counts are the author's own evidence and nothing here depends on them. The live-checkpoint runs (FLARE_GEMMA4_TEST_SNAPSHOT,.venv) are not part of CI in any case. Serving-path timing and memory were not measured by the author and the description says so, so no performance claim is at issue.
What to do next, in order
- Answer S1 (maintainer sign-off or split) — it decides whether S4/S5 are worth doing now.
- S2 (Ignition derives
patch_features) — otherwise the first recipe author cannot serve a Gemma 4 core. - S3 (split the load error) — small, and it is the error operators will hit.
- S4 and S5 — line-count reductions with no behaviour change.
- Nits 1-5 — documentation and duplicated test rows, batchable in one pass.
Full report · Notes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
screen malicious
Screen Result: All Clear
Evidence:
Screened PR #483 (NVIDIA/hyperflare-inference, "Add Gemma 4 image preparation, Bracketed patch-width metadata, and atomic spans", author rickybrent, head ab9a432, base main 27716185, 38 files +2490/−251): all 38 changed files and the full discussion were inspected. No prompt injection, no agent-directed instruction, no hidden/encoded payload, no unexpected network, shell-out, eval/exec, or exfiltration was found; no CI workflow, permission, or dependency changes are included.
- The 5-entry conversation is ordinary code review: an automated "case file" notice linking to the external review service
autobot.eidonix.com(not fetched), two "Changes Requested" reviews (blockers B1 packing-table-as-model-identity, B2 env-skipped HF parity, B3 spans in sharedprompt.rs; then S1–S5 should-fix items), and two author rebuttals/polish responses. No comment addresses an AI or agent, requests rules be ignored, or asks for commands to be run. Directive-looking text ("→ Put the width in prepared metadata") is review advice to the author, who implemented it. - New Python is
tests/frontend/generate_gemma4_image_fixtures.py(94 L; numpy/torch/torchvision/hashlib/argparse only) andtests/preparation/test_frontend_gemma4.py(257 L; pytest,tmp_pathsnapshots, pinned-revision HF cache cases that skip when absent).tests/frontend/gemma4_images.json(256 L) is hashes and config data only. ignition/preparation/frontend.py(+70/−6) adds a closed-failinggemma4branch using_expected()field guards andtokenizers.Tokenizer.from_fileon a local snapshot path;contract.py(+7/−1) defaultsvision["patch_features"] = 0; regeneratedruntime_core_pb2.py(+170/−168) is a descriptor-only blob importing onlygoogle.protobufmodules and_builder.Build*.helios/src/frontend/images/gemma4.rs(504 L) is genuine image-preprocessing arithmetic (area-bounded resize,(y, x, channel)interleaving) with overflow guards and an#[ignore], env-gated live-snapshot test writing a temp template behind aDropguard.- Remaining Rust diffs (packing/patch_merge/layouts/bracketed/model/prompt/config/describe/protobuf/model.rs/contract.rs (not opened)) and ~15 test fixtures adding
patch_features: 0are mechanical and match the description; proto changes are additive tags (3, 11, 11); docs changes are prose only. - Repo-wide regex sweeps at
pr/483for injection phrasing and risky APIs returned only pre-existing, unrelated repository content.
Open items: the two external autobot.eidonix.com case-file links were deliberately not fetched (third-party pages, not PR material); confidence in the All Clear verdict rests on the in-repo material, which is complete.
Full report · Notes decide malicious: all_clear (100%): No malicious content found
explore
Author: rickybrent (no GitHub association with this repo; 0 merged, 1 open PR in 180 days — #484, same day; Discord ran.cossack)
Motivation: Gemma 4 is already a supported text model here, but Helios had no image profile for it and shared packer code hardcoded the 2×2/1176-float patch width, so Gemma 4's 16×16 patches pooled 3×3 into soft tokens could neither be prepared nor loaded. This PR adds that profile, lets the Bracketed layout take the patch width from the prepared contract, and has the Bracketed layout emit atomic image spans so the scheduler cannot split an image envelope.
Scale: +2490 / −251 lines in 38 files
Proposal:
- New
frontend/images/gemma4.rsprofile: area-bounded resize, RGB-interleaved(y,x,c)patches,(x,y)positions, sharedpatch_merge::Envelopeexpansion, per-condition load errors. - Additive wire metadata:
VisionCapacity.patch_features = 6(0= legacy 1176),ImageSettings.profiletag 11 /ImagePreparationKind::Gemma4 = 11, oneImageProcessor::patch_features()authority across all 11 profiles. - Bracketed packing generalized: width from the contract, merge stride from any positive square
patches_per_feature(the hard-coded 4→1176 / 9→768 table is gone). - Atomic spans moved into
layouts/bracketed.rs, gated on declaredimage_tokens.span; sharedprompt.rs(not opened) fill deleted. - Bootstrap validation (
server/config.rs) plus a checked-in 8-case Hugging Face SHA-256 fixture that runs under plaincargo test. Touches: helios/src/frontend/images/— new profile plus the shared packer, patch_merge and bracketed layout (blast radius on existing MiniMax/Bracketed cores).helios/proto/runtime_core.proto(not opened) +helios/src/model.rs+helios/src/server/config.rs— additive prepared fields and load-time rejection rules.ignition/preparation/— export-side validation and thepatch_featuresdefault; this is where the sharpest residual lives. Related items:- #426 Add TERMINAL_PREFILL Operation Contract (v4) & Boundary-Aware Prefill Scheduling (merged): same proto/scheduler machinery, disjoint field numbers, previously flagged overlap now retired.
- #479 static fused addend / gated gather, DMA ring all_gather, optional TerminalPrefill (merged): the pb2 staleness blocker is resolved at this head.
- #387 Add video input for Qwen3.8 27B (open): shares 21 files including the image frontend — rebase on the shared width helper is likely.
- #229 Muse Glimmer 30B NVFP4 … with images (open): adjacent vision work touching
layouts/bracketed.rsandpatch_merge.rs. - #405 Treat declared markers as controls … (merged): set the contract-fixture precedent this PR still does not follow.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Autobot comments: The head answered a third autobot round (2026-11-25 10:48, "Changes Requested", explicitly zero blockers, 5 should-fix + 5 nits) with push
ab9a432band a point-by-point reply. Closed since my 2026-11-25 report: per-condition load errors, duplicated width expression, the redundant ignored test (one#[ignore]left), README/runtime-core-design.mdprofile enumerations, and core-load coverage. Still open:patch_featuresis authored by nobody in either language (lateflare runrejection for the first recipe author), the Gemma 4 profile is never mounted from a checked-in contract, no maintainer has engaged, and no CI check is recorded on the head. The reply's claim that the Python fixture test runs "in CI" is false — no workflow runs pytest. Credit where due: the author correctly rebutted the reviewer'sh % merge_sidenit.
Value Proposition
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
- Every span-declaring
Bracketedimage failed per request onmain.layouts/bracketed.rsemitted nodata.spans, whilemodel.rs:442-465rejects any scoped token outside a span →"image token spans do not match their declared boundaries". Fixed inlayouts/bracketed.rs:57-88: the run is flushed when the feature run ends, the span isstart-1..end+1(coveringstart_token…end_token), bounds-checked at both ends, gated onimage_tokens.span.is_some(). The sharedprompt.rsfallback was deleted, not patched, so the layout that builds the envelope owns the span (matchinglayouts::deepseek). - Every cached MiniMax prepared-image record was discarded.
conditioned.rs:185-193onmainended_ => 588, soPatchMerge's 1176-wide patches never satisfiedvalid_processedand were re-materialized per request. Now viaImageProcessor::patch_features()(mod.rs:459-471,conditioned.rs:187), which also fixesPaddedGrid = 1200.
Both fixed without adding a branch in shared scheduling or cache code.
Cost
- Complexity: one new module
gemma4.rs(~210 lines product code, ~290 tests), ~70 lines infrontend.py, small glue inmod.rs/packing.rs/config.rs. ~1,900 of 2,490 added lines are tests and fixtures — evidence-heavy, which the charter asks for. - Maintenance: the same per-profile surface every profile carries.
packing.rsis simpler than before: a4→1176 / 9→768table replaced byisqrt+ prepared metadata (packing.rs:16-46). Load errors are per-condition and name both values (gemma4.rs:27-71), so an operator can distinguish a mis-exported core from a mis-declared checkpoint. - Performance: no serving-path cost; decode/resize/pack already run on the frontend pool and reuse
resize::resize. Net positive: theconditioned.rsconsolidation removes a per-request cache invalidation. - Risk: low. Inert until a recipe selects it.
validate_loaded_image_processorruns once at bootstrap (server/config.rs:290-298); the envelope/chunk bound isSomeonly for Gemma 4 (mod.rs:473-478), so no other core is affected. Legacy load proven through the realInputs::new:model/tests.rs:1279stripspatch_features, asserts decode → 0, loads and stages 16×1176 floats, and rejects a 768-wide manifest (:1446) and non-squareppf = 3(:1447-1451). The narrowing (Bracketedrequires positive-squarepatches_per_feature) covers only non-square nonzero values; zero is rejected earlier (model.rs:86-88).
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
- #74's "serve cleanly" half is unmet at merge time. End-to-end needs the companion recipe in
local-inference-lab/hyperflare-recipesdeclaringvision.patch_features = 768. Correctly tracked (docs/TODO.txt:331-337), honestly stated, inert without a recipe — but this merge must not be read as "Gemma 4 vision works." - Merge-order friction with #229 (Muse Glimmer, open), which touches the same six image files: it adds
Profile::MuseGlimmerand its ownProfile::Glm | PatchMerge(_) | MuseGlimmer(_) => 1176arm atconditioned.rs:191, plus a secondEnvelope-freePatchMergeinpatch_merge.rs. Textual conflict in exactly the files this PR rewrote. Semantically compatible (#229 ispatches_per_feature=4, width 1176,span=None, so it lands on the legacy path), but whoever merges second must rebase ontoImageProcessor::patch_features()and the extractedEnveloperather than resolve toward either side. docs/model-preparation.md:321listsgemma-4-12bwhile the profile rejectsgemma4_unified; text path unaffected, one clarifying line would help.helios/tests/support/contracts/gemma4_frontend.json:16-17,38still has null image fields, so no checked-in contract fixture drives the whole prepare→span→validate path; pieces are covered individually and the core-load path is now synthesized inmodel/tests.rs.pyproject.toml:34(not opened) pinsprotobuf>=7.36.2whilemain's own artifact says 7.36.1 — pre-existing, separate fix.- Verification limits: this pass was read-only — no
cargo test/pytestrun. Claims come from reading code and callers; the author's test counts are their own evidence and nothing here depends on them.
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.
Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Prose
Verdict: clean Blocking:
- None. Should fix:
- None. Nits: 5 Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Re-reviewed PR #483 at head ab9a432b (38 files, +2490/−251; base main 27716185) through the prose lens against the charter (charter lines 12, 21, 35, 42), AGENTS.md:43-70 (required prose review), AGENTS.md:72-140 (the four mandatory PR-description questions and their sub-rules, incl. :110-112 on reproduction inputs and :129-132 on process assurances), AGENTS.md:188-199 (no unsolicited churn; don't present scaffolding as supported), AGENTS.md:431-444 (core compatibility), and .agents/skills/repo-prose/SKILL.md:13-46 (not opened) (present-state spec, no false definite references, evidence as conditions/measurement/result).
All four should-fix items from the previous round are verified fixed in the diff: the helios/README.md:721-724 contradiction (the 1536 / temporal-copy / 2×2 paragraph is now scoped "For Qwen" and points at ImageProcessor::patch_features()), the missing Gemma 4 settings in docs/runtime-core-design.md:237-239, the undocumented fixture provenance at helios/README.md:798-807, and the --ignored evidence block in the description (now names the two required tokenizer files, a real snapshot path form, and "not part of CI"). Earlier nits on gemma4.rs load-error wording, the bracketed.rs span message, and the libprotoc/7.36.1 mismatch are also resolved.
I re-verified the description's causal "Why" against main: the span-declaring Bracketed failure at validate_prompt_data (helios/src/model.rs:436-454 on main) and the per-request prefill_chunk_size rejection (:421-423 on main) both exist, and both are now handled at load time (helios/src/server/config.rs:449-455, :473-486).
Five nits remain, all wordsmithing rather than correctness: "normalizes" in the description's Claimed result when the profile only rescales by 1/255; a reused $SNAPSHOT name for a different checkpoint; an unmarked mirror of the soft-token allowlist between frontend.py and gemma4.rs; two tests that restate fixture rows already pinned bit-exactly by SHA-256; and a subject-only commit message whose compatibility/validation note lives only in the PR description. None of these would mislead a reviewer about behavior or evidence.
Conventions
Verdict: clean Blocking:
- None. Should fix:
- None. Nits: 8 Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Reviewed PR #483 at head ab9a432 (38 files) through the conventions-and-duplication lens: each new construct compared with its closest in-repo precedent and against AGENTS.md:188-199, docs/design-review.md principle 3 and the charter's "keep the runtime small and model-agnostic". Every item raised in earlier passes is closed in code, not just in the reply: gemma4::Processor::load now emits per-condition errors naming the field and both values (gemma4.rs:25-84); process calls self.patch_features() instead of re-inlining 3*patch_size² (gemma4.rs:164); the legacy 0 → 1176 rule moved onto the contract type as VisionCapabilities::bracketed_patch_features() (model.rs:72-80) with the duplicate Bracketed bootstrap check collapsed into one actionable error (server/config.rs:443-463); the README process paragraph is scoped to Qwen with per-profile width pointed at the accessor; the fixture model block is consumed by a provenance test; and a legacy Bracketed core with patch_features omitted loads end-to-end through Inputs::new at 1176 floats (model/tests.rs:1277-1452). The pb2 header nit is withdrawn: main is also 7.36.1.
Residual nits: per-profile patch width is authored twice over different enums (packing.rs:31-93 vs mod.rs:459-471), linked only by a test; the soft-token allowlist exists in Rust and Python with nothing tying them (gemma4.rs:13 vs frontend.py:132); Envelope is documented as shared but homed in patch_merge.rs:10-17; max_patches is computed twice (gemma4.rs:61-64, :98-100); load validation accepts ranges where patch_merge.rs:92/qwen.rs:22 pin one value and glm.rs:13/padded_grid.rs:31-34 would suggest a const; the settings literal repeats in six tests despite frontend::test_support (frontend/mod.rs:104 (not opened)); and the new fixture generator copies pattern/digest verbatim from the GLM generator (consistent with every generator there). Precedents that hold: proto tag 11 + Gemma4ImageSettings, additive contract_enum! append, #[serde(default)] tag 6, describe.rs/protobuf.rs arms beside PatchMerge (with 0 omitted so legacy describe JSON is unchanged), Profile/ImageSettings arms mirroring PaddedGrid, and the Ignition gemma4 branch mirroring glm. Limits: read-only review, no cargo test/pytest run; numerical parity, load cost and serving behaviour are other lenses.
Simplicity
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/proto/runtime_core.proto:599-600:
patch_size/pooling_kernel_sizeare wire knobs no producer can vary; they add three unreachable validation arms and a third spelling of the 768 patch width — make them constants. - helios/src/frontend/images/gemma4.rs:383-402:
geometry_matches_the_hugging_face_processorrepeats 7 of its 9 rows that the checked-in fixture already pins by SHA-256 — keep only the two unique rows. - helios/src/model/tests.rs:1343-1411: the new legacy-core test hand-builds ~70 lines of manifest because
testing::manifestmapsGraphOperation::Visiontounreachable!()(testing.rs:354) — map it and override one buffer extent. Nits: 3 — the ~130-line cross-profile table at packing.rs:685-814; the precomputedatomic_spans: boolthreaded from prompt.rs:52-65 into bracketed.rs:23,58; the hand-written 91×37 restatement at gemma4.rs:404-420. Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
This round the PR's simplicity debt is mostly gone: the author's polish commit deleted the superseded native_* test, Drop-guarded the ignored test's temp Jinja file, flattened the duplicated patch-width check in server/config.rs into one if/else if, wired the fixture's processor/model blocks into a real Python test, and added the requested legacy Bracketed core-load test. I withdraw my earlier "redundant grid guard" nit: the author's h=2, w=9, ppf=9 counter-example is correct — tokens * patches_per_feature == patches does not imply a square tiling.
What remains is concentrated in the Gemma 4 profile's unreachable configuration surface and in two tests that restate facts already pinned elsewhere. The patch_size/pooling_kernel_size finding is the most substantive: ignition/preparation/frontend.py:124-127 and :140-141 reject every pair except 16/3, and :168-173 writes the literals, so the 1..=64 and 1..=16 caps in gemma4.rs:27-40 are dead code and 768 is spelled three ways. The author's defence (it mirrors PatchMergeImageSettings.patch_size, pinned to 14 at patch_merge.rs:92) is precedent for the defect, not a requirement — and unlike PatchMerge these tags have never shipped, so nothing constrains them. Both should-fix items are ~10-70 lines each and strictly reduce what a future reader must hold in mind.
Limits: read-only review, no cargo or pytest run; test counts and SHA-256 parity are the author's claims, and the live-checkpoint runs are outside CI.
Correctness
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/src/frontend/images/gemma4.rs:13 (mirror at ignition/preparation/frontend.py:132): the allowlist admits five soft-token budgets (70/140/280/560/1120) and Ignition emits whichever the checkpoint declares, but only 280 and 1120 are ever loaded in tests, so a budget-specific geometry or allowlist drift would surface only at
flare run. Nits: 4 Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Reviewed PR #483 at head ab9a432b (38 files, +2490/−251) through the correctness lens; read-only (no cargo/pytest executed). No blocking issue: the wire additions are additive and defaulted (proto tag 11 for ImageSettings.gemma4, VisionCapacity.patch_features = 6, ImagePreparationKind::Gemma4 = 11), patch_features == 0 preserves the legacy 1176 Bracketed width so existing MiniMax cores still load (model.rs:74-80, mounting test helios/src/model/tests.rs:1279-1452), atomic span emission moved into the layout and is gated on image_tokens.span.is_some() with bounds checks at both ends (layouts/bracketed.rs:52-106), and the sizing path is overflow-guarded (gemma4.rs:48-71, :157-177).
The two findings from earlier runs are genuinely closed: gemma4::Processor::load (gemma4.rs:25-83) now returns a distinct, value-naming error for each rejection instead of one opaque message, and the Bracketed narrowing (positive-square patches_per_feature) is disclosed in the PR body and covered by a load test.
Remaining should-fix is coverage: the two allowlists in two languages admit 70/140/560 but nothing loads those budgets — the fixture generator only emits 280 and 1120 (tests/frontend/generate_gemma4_image_fixtures.py:31-40, the 70 at gemma4_images.json:67 is the video processor block, not a case). Nits: patch_features % 3 enforced on non-Bracketed cores with a generic message (model.rs:89); the duplicated allowlist; unchecked arithmetic safe only via the load caps (gemma4.rs:99, :139); and the untested sub-envelope prefill truncation in scheduler/policy.rs:337-351. Could not settle whether any already-published core in local-inference-lab/hyperflare-recipes declares a Bracketed non-square patches_per_feature — a recipe-repo compatibility question, not a defect here.
Architecture
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/tests/support/contracts/gemma4_frontend.json:16-17,38: no Bracketed+Gemma4 core exists in-tree — the new profile is never mounted from a prepared contract, so the served path is unexercised.
- ignition/preparation/frontend.py:310: gemma4 image settings default to
preprocessor_config.json(not opened), which Gemma 4 snapshots do not ship (processor_config.json(not opened)); every test passes the path explicitly, so the default is untested. - helios/proto/runtime_core.proto:599-602 + ignition/preparation/frontend.py:132 / helios/src/frontend/images/gemma4.rs:13: two unreachable wire knobs and a duplicated soft-token allowlist with no test tying the Rust and Python copies. Nits: 3 Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
Scope is right: helios/src/frontend/images/ already owns ten preparation profiles and Gemma 4 enters through the existing ImageSettings enum (mod.rs:249-261), not a new mechanism; the proto change is additive and optional (VisionCapacity.patch_features tag 6, #[serde(default)], 0 = legacy 1176); the load-time envelope bound sits in bootstrap (server/config.rs:464-487) where it belongs.
Every blocker and should-fix from my previous round is fixed at head ab9a432 and verified in code: contract.py:109-119 now defaults vision["patch_features"] = 0 with the docstring telling a Bracketed recipe with a non-1176 width to set it; helios/src/model/tests.rs:1279-1452 strips patch_features from a serialized Bracketed contract, asserts the decode is 0 and loads through Inputs::new staging 16×1176 floats; gemma4.rs:25-84 returns per-condition errors naming field and both values; gemma4.rs:86-88 is the single width expression; tests/preparation/test_frontend_gemma4.py:187-225 now reads the fixture's provenan
Subtractive
Verdict: should not be merged
The change: +2490 / −251 lines across 38 files
Could remove: about 1,514 lines in 7 places (61% of the diff) if the Gemma 4 profile is deferred; about 304 lines (12%) if it is kept as written.
Biggest subtractions:
- Gemma 4 image profile, whole half of the diff (~1,210 lines):
helios/src/frontend/images/gemma4.rs(504),tests/frontend/gemma4_images.json(256),tests/frontend/generate_gemma4_image_fixtures.py(94),tests/preparation/test_frontend_gemma4.py(257),ignition/preparation/frontend.py:114-173(~60), plus the proto/enum/describe/conditioned/config arms and tests (~40). Nothing in the repository can consume it: no contract underhelios/tests/support/contractsdeclaresBracketed,image_profile="gemma4"has no non-test caller, and this PR's owndocs/TODO.txt:331-337records export and serving qualification as an open item. helios/src/model/tests.rs:1277-1452(~110): the legacy Bracketed test hand-rebuilds anExecutionManifest(68-linebuild_manifestclosure + 28-line hand-writtenValueBindinglist) thatcrate::model::testing::manifestalready builds; the arithmetic it checks is already covered bypacking.rs:594-682.helios/src/frontend/images/packing.rs:684-814(~110): the 11-row profile table repeatsconditioned.rs:329-363/428-504andmodel/packing.rs:92-102; four rows carry every distinct outcome.tests/frontend/gemma4_images.json(~75): the audio feature-extractor arm, the video_processor arm and ~32 unreadvision_configkeys;image_settingsreads onlyprocessor_class,image_processor, two vision keys and three token ids.helios/src/frontend/images/gemma4.rs:383-420(~37): two tests restate fixture cases the SHA-256 parity test already pins.
Left behind: nothing dead outside the change once the duplicated tests/fixture keys above go; helios/src/model/prompt.rs:52-65 is left with a one-use derivation of atomic_spans (image_tokens.span.is_some()) that belongs in the Bracketed arm as an Option<&ImageSpan>.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/483
code review summary
Recommendation: Changes Requested
Blockers:
None.
Should fix:
- Profile lands ahead of its exporter; nothing mounts it end to end. No contract fixture uses layout 9 / preparation 11 (
helios/tests/support/contracts/gemma4_frontend.json:16-17 (not opened),38is null), so nothing goesBootstrap::load→ served image request, and the head runs no CI. → Confirm the stack order in one line (or split the shared half out) and add oneBracketed+Gemma 4 contract fixture loaded through the existing helper. prepare_frontend(snapshot, image_profile="gemma4")cannot find the processor. The default path ispreprocessor_config.json(not opened) (frontend.py:310) but Gemma 4 shipsprocessor_config.json(not opened) — every test passes it explicitly, so the documented default raisesFileNotFoundErrorwith no test to catch it. → Resolve the filename per profile (or accept either) and test the default argument.- Only 2 of the 5 allowlisted budgets are ever loaded. Fixture specs cover 280 and 1120 only (
generate_gemma4_image_fixtures.py:31-40), yetmax_soft_tokensdrives geometry, the clamp branches (gemma4.rs:118-123) and the envelope bound. → Add 70/140/560 cases (regenerate) or a table test overSUPPORTED_SOFT_TOKENS. - The new legacy-core test hand-builds a manifest.
tests.rs:1304-1411duplicatestesting.rs:307-337/:368-377becausetesting::manifestcannot emit aVisiongraph (testing.rs:354), andtests.rs:1450rebuilds a manifest it already holds. → One arm intesting.rs:344-355plus a width override removes ~110 lines.
Nits:
10 nits
Full report — no blockers; every round-3 should-fix is fixed and verified in code at ab9a432b (per-condition load errors naming both values, a single patch_features() authority, patch_features authored in the Ignition contract default, fixture provenance consumed by a CI test, the legacy Bracketed core-load test, the folded bootstrap width check, the deleted superseded #[ignore] test with a Drop-guarded template, and corrected README/docs). Nothing is wrong on the served path. The four remaining should-fix items are one scope confirmation plus one test that would catch a real FileNotFoundError, one budget-coverage gap, and one test-plumbing reduction. Ten nits cover patch width authored over two enums, duplicated test rows, a doubled max_patches, an over-broad % 3 rule, Envelope's home, the atomic_spans shape, an untested sub-envelope prefill path, and two doc/wording fixes. Two debates are recorded as accepted as-is (patch_size/pooling_kernel_size on the wire, recipe-side width authoring); round-3 nits on the duplicate bootstrap check and bracketed_patch_features() are resolved, and the packing.rs divisibility nit is withdrawn as wrong. Verification was read-only: no cargo test/pytest, and no CI checks on the head commit, so all behavioural claims come from code and callers.
Pre Test Report
Pre-test report — PR #483 "Add Gemma 4 image preparation, Bracketed patch-width metadata, and atomic spans"
Head ab9a432b · base main 27716185 · 38 files · +2490 / −251 · no CI checks on head
Verdict: DO NOT REFER TO HARDWARE TESTING. Send back to the author for one small fix plus a CI run.
This supersedes my 2026-11-25 report (written against 2b4a31e). The author pushed ab9a432b answering the third review round point by point; every blocker from previous rounds is now verified fixed in code. Three independent grounds say hardware is the wrong instrument:
- Nothing on cn5 or cn7 can exercise this change. cn5 hosts
facebook/dinov2-base,timm/vit_base_patch14_dinov2.lvd142mand GLM-5.3-Flash-NVFP4 variants (GPU 0 is at 86 °C and the host is not taking runs); cn7 hosts Qwen3.8-27B variants. No Gemma 4 checkpoint on either host, and no in-tree recipe selects the new profile — recipes were split intolocal-inference-lab/hyperflare-recipes. A GPU run today would exercise nothing in this PR. - Nothing GPU-side is modified. The whole diff is CPU/deterministic: decode → area-bounded bicubic resize → interleaved
(y,x,c)patch pack scaled by1/255→(x,y)positions → token-envelope expansion → upload extent arithmetic → prompt/span validation. No kernel, graph, numerics or precision path changes, and the PR makes no performance claim, so the benchmark rule (#210) is not engaged. A throughput/latency A/B would be pure waste. - Blast radius on the models the hosts can serve is zero, measured. The one behaviour change reaching existing vision cores is
helios/src/frontend/images/conditioned.rs:187, which now callsImageProcessor::patch_features()(mod.rs:459-471) instead of the literal match atmain:187-193. Comparing the two: Qwen/MiMo 1536 → 1536, Radio 768 → 768, Glm 1176 → 1176, PaddedGrid 1200 → 1200, DeepSeek*/Moonvit/Step 588 → 588, and only PatchMerge (MiniMax) 588 → 1176 changes — a genuine bug fix (MiniMax's cached prepared-image records were being re-materialised every request) for a family hosted on neither machine. The new load-time narrowings cannot bite hosted cores either:square_merge_sideruns only forImageLayoutKind::Bracketed(packing.rs:39-46viamodel/packing.rs:92-97(not opened)) and no hosted core isBracketed; the envelope bounds atserver/config.rs:464-487apply only whenmax_image_envelope_tokens()isSome, i.e.Profile::Gemma4only (mod.rs:473-478);model.rs:89(patch_features % 3) only fires on a nonzero field and no checked-in fixture or test sets it (a search for"patch_features"underhelios/testsreturns nothing).
Expected value of a hardware run as the PR stands: ≈ 0, and negative if it displaces real work. The evidence this change needs is CPU-only and cheap (cargo test, and a pytest run for the Python producer), and it belongs in CI.
What changed since my last report — all verified in code at ab9a432
- pb2 regression — fixed and verified.
ignition/preparation/runtime_core_pb2.pynow contains bothGEMMA4_IMAGE_PREPARATION = 11andTERMINAL_PREFILL = 14, plusPreparationManifest, so the earlier concern that merging would revert #479 is gone. The header readsProtobuf Python Version: 7.36.1(pb2:5) and I read the same two lines atref=main: identical, so there is no drift; theprotobuf>=7.36.2pin inpyproject.toml(not opened) versus main's own 7.36.1 artifact is a pre-existingmaininconsistency, not this PR's. - Count-keyed width table — gone.
packing.rs:16-22square_merge_side(isqrt + exact-square check),:39-46width fromvision.bracketed_patch_features()(model.rs:72-80,0→ legacy 1176). - Atomic spans — layout-owned, with tests.
layouts/bracketed.rs:52-111emits spans frommm_token_type_idsruns, gated onatomic_spans, bounds-checked at both ends;model/prompt.rs:52-65only derives the boolean; the shared fallback is deleted. Coverage under plaincargo test:model/prompt.rs:1172-1281(two spans equal to the conditioned-input spans, length 262, start/end marker tokens, a 256-token 64-aligned chunk rejected, MiniMax-style no-span contract empty). - Legacy
Bracketedcore-load coverage — added.model/tests.rs:1279-1452stripspatch_featuresfrom a serialized contract, asserts the decode is 0, loads throughInputs::new, stages16*1176floats, and rejects a 768-wide manifest (:1446) and a non-squarepatches_per_feature(:1447-1451). - Load-time validation.
gemma4.rs:25-83per-condition errors naming field and both values;server/config.rs:443-489checks patch width against the contract (single actionable "re-export the core withvision.patch_features" error) andmax_image_envelope_tokens ≤ prefill_chunk_size/≤ span.max_tokens; boundary test atconfig.rs:936-1022(1122 fits 1152, fails 1088;span.max_tokens1121 fails, 1122 passes). - Parity evidence is CI-runnable.
tests/frontend/gemma4_images.json(not opened) + generator, consumed unconditionally bygemma4.rs:266-333(8 cases, SHA-256 over resized RGB,pixel_values,position_ids, atmax_soft_tokens280 and 1120). One#[ignore]live-checkpoint test remains (gemma4.rs:422-503), with the temp Jinja template nowDrop-guarded (:443-448, dropped:469). - Ignition no longer pins one vision tower:
frontend.py:114-173asserts onlymodel_type/vision_config.model_type/patch_size/pooling_kernel_size/ processor flags /max_soft_tokens, and validates all three envelope tokens as single vocabulary tokens, failing closed withouttokenizer_config/snapshot.gemma4_unified(12B) is rejected on all three surfaces;tests/preparation/test_frontend_gemma4.py(257 lines) covers synthetic variants, negatives, fixture provenance and three cached checkpoints. - Docs updated at
helios/README.md:706-807(not opened),docs/runtime-core-design.md:181-197 (not opened),234-241,helios/model-contract.md:82(not opened),docs/TODO.txt:331-337.
Residual findings, and whether any gates a hardware run
| # | Finding | Severity | Gates testing? |
|---|---|---|---|
| A | prepare_frontend(snapshot, image_profile="gemma4") without preprocessor= raises FileNotFoundError. ignition/preparation/frontend.py:310 resolves the default as preprocessor_config.json (not opened); Gemma 4 (and Inkling 2) snapshots ship processor_config.json (not opened), and the checked-in fixture is a processor dump (the tests write it to processor_config.json (not opened), tests/preparation/test_frontend_gemma4.py:76). Both gemma4 call sites pass the path explicitly (:88, :246), so the documented shape is untested and broken. Pre-existing for padded_grid, so this is consistency plus a missing default test, not a new architectural defect. |
should-fix | No — Python authoring surface, CPU, unreachable from a GPU run |
| B | No in-tree contract mounts the profile, so the serve path is unproven. helios/tests/support/contracts/gemma4_frontend.json:16,17,38 are all null; no fixture uses image_layout: 9 (values present: 3, 10, 2, 6, 1, 5). "Gemma 4 vision works end to end" is unsupported, correctly stated as a limitation and tracked open at docs/TODO.txt:331-337. |
should-fix (evidence) | No — needs a recipe + checkpoint that do not exist yet |
| C | patch_features is authored by nobody in-tree. contract.py:117 defaults it to 0 with a docstring at :111-115 telling Bracketed recipes to set it; the first Gemma 4 recipe that omits it gets the actionable load error at server/config.rs:449-455. Recipe-side work, not a defect here. |
should-fix (downstream) | No |
| D | Soft-token allowlist duplicated Rust/Python (gemma4.rs:13 vs frontend.py:132) with nothing tying them, and only 280 and 1120 are ever loaded (generate_gemma4_image_fixtures.py:31-40), so 70/140/560 geometry is unexercised in both languages. |
should-fix (coverage) | No — CPU table test/extra fixture cases |
| E | Two unreachable wire knobs. patch_size/pooling_kernel_size are pinned to 16/3 by frontend.py:124-127,140-141 and written as literals at :168-173, so gemma4.rs:27-40's 1..=64 / 1..=16 arms cannot fire. Precedent (patch_merge.rs (not opened) pins 14) makes this defensible; dead configuration is a simplicity cost only. |
nit | No |
| F | CI does not run the Python tests. .github/workflows has only helios-lifecycle, native-serving, release; no workflow invokes pytest, so tests/preparation/test_frontend_gemma4.py never runs automatically and the author's statement that the fixture-provenance test runs in CI is not supported. native-serving.yml:63,68 does run cargo test for helios with --features runtime-core,server, so the new Rust tests do run in CI. No CI status is recorded on ab9a432. |
process | No — CI, not hardware |
| G | Nits: describe.rs:451-452 adds the Gemma 4 arm beside PatchMerge; helios/README.md:721-728 (not opened)'s Qwen contract paragraph now correctly scoped and points at ImageProcessor::patch_features(); gemma4.rs:404-420 and :383-402 still restate fixture rows already pinned by hash; the 11-row cross-profile table at packing.rs:695-825 repeats rows four would cover. |
nits | No |
No residual item is a substantive architecture or code-quality problem that would be invalidated by hardware testing. Finding A is the only pre-merge must and it is one line in a Python helper; B and C resolve only when the companion recipe lands.
On scope (raised by several lenses): the profile rides the existing ImageSettings/Profile enum — the eleventh preparation profile, the same extension point padded_grid used — the proto changes are additive and defaulted, and the profile is inert until a recipe declares it. That is a sequencing judgement for the maintainers, not a defect, and not a reason to spend a GPU job.
Review-summary reliability — claims I checked and discarded
The lenses converged on the substance, but several notes are stale against this head and should not drive a decision:
- "
packing.rsmaps4 => 1176 / 9 => 768" — deleted; nowisqrt+ prepared metadata. - "
prompt.rs:137-151fillsdata.spansin shared code" — deleted; layout-owned. - "
gemma4.rsreturns one opaqueinvalid Gemma 4 image settings" — split into per-condition messages. - "768 is spelled three/four ways,
conditioned.rs:192literal" — gone; one accessor. - "
native_pixels_and_positions_match_the_checkpoint_processoris superseded scaffolding" — deleted at this head; the surviving#[ignore]test isDrop-guarded. - "the pb2 downgrades protobuf 7.36.2 → 7.36.1" — main's own artifact says 7.36.1; no drift. Earlier summaries that graded this a nit were closer to right than those that graded it a blocker, and the "blocking regression of #479" framing is now moot: the descriptor carries
TERMINAL_PREFILL = 14. - "PaddedGrid width was fixed 588 → 1200" — wrong;
main:191already usedpadded_grid::FEATURES(1200). The only width that changes is MiniMax's 588 → 1176. - "the envelope is 1121 tokens at the maximum setting" — it is
max_soft_tokens + 2= 1122 (gemma4.rs:90-92;config.rs:990-1001asserts 1122 at 1120 and 282 at 280).
The one substantive point several lenses made and I confirmed independently is finding A (frontend.py:310 default path), which no summary pressed as a gate on testing — correctly, because it is Python-side.
Screening: I re-read the changed hand-written surfaces and the PR discussion; no instruction-shaped or agent-directed text. The #autobot:ignore footer is the repository bot's standard opt-out addressed to humans, not an instruction to this review. No injection attempt to report.
Recommended path (no hardware)
- Author: fix finding A — resolve the processor path per profile (prefer
processor_config.json(not opened) forgemma4/padded_grid, or accept whichever of the two exists) and add a test for the default argument. One line plus a test, and it removes the first failure the next recipe author would hit. - Author: note in the description that no CI workflow runs pytest (finding F), and ask for a
cargo test+pytest tests/preparationrun reported with skips visible. - Then decide merge. The profile is inert and the wire is additive; the maintainers' remaining question is whether landing it ahead of the companion recipe is acceptable (finding B).
- Refer to hardware only when a Gemma 4 vision recipe and a hosted checkpoint exist. At that point the plan below applies, and it is small.
Minimal test plan — only if referred (i.e. only after a Gemma 4 core can be prepared and served)
Stage 0 — gate before any GPU time. p.GraphOperation.Value("terminal_prefill") == 14 and p.ImagePreparationKind.Value("GEMMA4_IMAGE_PREPARATION") == 11 both resolve from the checked-in runtime_core_pb2.py; cargo test --features runtime-core,server and pytest tests/preparation green; the single #[ignore]d test reported as unrun, not as a pass.
Stage 1 — CPU correctness, one cn5 CPU job, no GPU (~5 min).
cargo test -p helios frontend::images model:: server::config— must includecanonical_processor_pixels_positions_and_resize,bracketed_layout_emits_atomic_spans_only_when_contract_declares_them,bracketed_packs_3x3_metadata_widths_and_rejects_invalid_extents,processor_patch_features_match_tensor_layout_for_every_profile,legacy_bracketed_core_omitting_patch_features_loads_and_stages_1176_wide_pixels,loaded_gemma4_image_processor_validates_patch_width_and_envelope_chunk_bounds,serialized_gemma4_profile_selects_only_image_preparation.- Width-vs-merge-stride invariant (the key new one): with a
patch_size = 16Gemma 4 profile, build two contracts differing only inpatches_per_featureand oneBracketedcore declaringpatch_features = 768; process a 91×37 and a 1008×672 image and assert the stagedvision_pixel_valueslength ispatches × 768in every case, byte-identical between merge factors — the width must not depend on the merge stride. Then assert apatch_features = 588core is rejected at bootstrap and apatch_features = 0core gets the "re-export" error rather than a mis-strided upload. - Hosted-core regression proof: load one already-exported core per hosted vision layout (GLM-5.3-Flash-NVFP4 on cn5, Qwen3.8-27B-NVFP4 on cn7) and confirm the describe JSON is byte-identical to
main(patch_featuresomitted when 0,describe.rs:466-468) andpatch_features()reports 1176 / 1536 as before. - Span boundary: a
Bracketedcontract withimage_tokens.spanandmax_soft_tokens = 1120againstprefill_chunk_size = 1088must fail at bootstrap namingprefill_chunk_size, not mid-request.
Stage 2 — single serving check, one cn5 job (4× RTX PRO 6000), only once a recipe and checkpoint exist.
Prepare the Gemma 4 core from the companion recipe (vision.patch_features = 768, ImageLayoutKind::Bracketed, ImagePreparationKind::Gemma4); serve TP=1 (TP=2 only if the recipe asks for it). Two requests: one text-only (must match main), one with a single image (HTTP 200, plausible image-grounded output). Repeat the image request once at max_soft_tokens = 280 and once at 1120. Fail-fast strings to watch: conditioned input spans or features violate prompt geometry, invalid bracketed image extent, bracketed image feature run is outside the expanded prompt, image token spans do not match their declared boundaries, maximum image envelope, and any prefill-split rejection. One image at or below the prefill chunk and one above is enough — do not sweep resolutions.
Explicitly not to be tested (would waste hardware):
- Any throughput/latency A/B on cn5 or cn7 — no hot-path change, no perf claim.
- A cn7 GB10 arm64 pass — nothing in the diff is arch-specific and cn7 hosts no relevant core.
- EXIF/alpha/alphanumeric edge cases for Gemma 4 — untested for every other profile, out of scope.
- The synthetic 10×3000 / 3000×10 geometries on hardware — already pinned by the CPU fixture and the geometry table.
- Second-checkpoint variants (E2B/E4B/26B-A4B) — post-recipe qualification, tracked in
docs/TODO.txt:331-337. - Multi-GPU / TP>1 sweeps — no collective or sharding path is touched.
Full report · Notes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
Apply Labels
Applied: +triage:review, +enhancement, +area:preparation, +model:gemma4
Classification Confidence
Threshold: 65%
Triage
- [✓]
triage:review: 98.9% -
triage:design-review: 0.9% -
none: 0.1%
Priority
-
none: 100.0% -
priority:P2: 0.0% -
priority:P1: 0.0%
Type
- [✓]
enhancement: 99.5% -
community: 29.4% -
duplicate: 22.3% -
bug: 9.5%
Area
- [✓]
area:preparation: 79.8% -
area:api: 53.1% -
area:packaging: 26.9% -
area:orbit: 9.5%
Model
- [✓]
model:gemma4: 95.3% -
model:glm-5.3: 4.7% -
model:inkling-small: 2.6% -
model:muse-glimmer: 1.6%