Code review summary scratchpad · NVIDIA/hyperflare-inference #483

Raw Markdown for agents: https://autobot.eidonix.com/p/15225852-6423-48d7-9015-57f70247a4cb.md

#1 [high] PR #483 overview, files, charter hooks

PR #483 "Add Gemma 4 image prep profile, bracketed 3x3 packing & atomic spans" by rickybrent, head f2340e42, base 6d6fe0c6, +732/−164, 13 files. No human review yet (only autobot case-file comment). Files: helios/proto/runtime_core.proto (+10), helios/src/frontend/images/{gemma4.rs new +416, mod.rs +20, conditioned.rs +9, packing.rs +45/−5, patch_merge.rs +61/−38}, helios/src/model/{contract.rs +1/−1, packing.rs +1, prompt.rs +15}, helios/src/runtime_core/{describe.rs +2, protobuf.rs +5}, ignition/preparation/frontend.py +25, ignition/preparation/runtime_core_pb2.py +122/−120. Claims: native Gemma 4 image prep with "exact f32 pixel and (x,y) position parity" vs HF Gemma4ImageProcessor; Bracketed now derives stride/width from patches_per_feature ("orthogonal, no model-identity branching"); atomic spans populated; "existing cores and non-Gemma image profiles remain wire-compatible and unaffected". Evidence claimed: 45 passed frontend::images (with FLARE_GEMMA4_TEST_SNAPSHOT=google/gemma-4-31B-it 842da379), 53 passed model::, cargo check flare-cli, 15 pytest. Charter (read_charter): "Keep the runtime small and model-agnostic… shouldn't accumulate per-model branches (#267, #334)"; "Bring real evidence"; "Be explicit and pin everything (#215)"; "New model recipes… must list supported checkpoints… and support more than a single checkpoint (#74)". design-review.md:38-52: input packing/frontend processing stays shared; "Enums, callbacks, schema names, and metadata fields cannot serve as alternative model allowlists"; admission/eviction must not branch on model identity. AGENTS.md:72-140 (required PR description: why/what/result/evidence; "Keep material failures, skipped checks… visible. Test counts and labels cannot stand in for the tested contract and result"; :306 "Report a skipped test as an unrun check"), AGENTS.md:188-199 (no churn/unsupported configuration switches; tests must exercise behavior), :431-444 (additive protobuf).

#2 [high] FULL REPORT — PR #483 Blockers / Should Fix / Nits

FULL REPORT CONTENT (for the case file / final write-up).

=== BLOCKERS ===

B1. Bracket patch width is looked up from patches_per_feature — a model allowlist in shared input packing.

B2. The headline HF-parity evidence cannot fail, and is not reproducible or checked in.

B3. Atomic spans are produced by shared code for every span-declaring layout, are untested, and their compatibility impact is undisclosed.

=== SHOULD FIX ===

S1. gemma4::Processor::load accepts settings that neither the packer nor the cache validator can represent.

S2. The patch width is authored three times with no compile-time link.

S3. Largest supported image cannot be prefilled atomically at a small chunk size, and nothing checks it.

S4. Ignition's Gemma 4 gate pins one vision tower and derives nothing from the checkpoint.

S5. Documentation the change makes stale was not updated.

S6. Description corrections (AGENTS.md:72-140).

S7. Regenerated Python bindings went backwards in generator version.

=== NITS === N1. packing.rs:494-502 turns the one-line staging.put into a six-line call whose only real change is 1176 → patch_width; keep the original line and change the constant (AGENTS.md:188-193 on churn). N2. packing.rs:574-585 asserts the table (4→161176, 9→630768, 16 errors) — it will keep passing through the B1 mistake. Test the behavior instead: bracketed() at patches_per_feature = 9 (tokensppf == patches identity, truncated-pixel error, odd-grid rejection), or assert the metadata path once B1 lands. Note bracketed() itself is untested at 9. N3. packing.rs:486 h % merge_side / w % merge_side is redundant with the geometry the only producer emits (gemma4.rs:46-48, :63-64 floor to multiples of patch_sizepooling); if the profile keeps that guarantee, bracketed_patch_geometry collapses to a width and this check can go. N4. Soft-token allowlist is written twice with no citation: gemma4.rs:11 SUPPORTED_SOFT_TOKENS = [70,140,280,560,1120] and ignition/preparation/frontend.py:123 not in (70, 140, 280, 560, 1120). The Python producer rejects everything else first, so the Rust copy is unreachable; keep one authority and name the upstream field (image_processor.max_soft_tokens) at both sites. N5. Missing protobuf round-trip test for the new tag: helios/src/runtime_core/protobuf.rs:167-171 mirrors the PatchMerge arm correctly, but GLM and padded-grid each have serialized_*_selects_only_image_preparation tests (protobuf.rs:726, :749). Add serialized_gemma4_profile_selects_only_image_preparation — it is the only automated evidence for the additive wire claim. N6. Small prose: conditioned.rs:192's bare 768 wants a comment ("3×3 pooling over 16×16×3 = 768 floats per feature"); patch_merge.rs:10's doc "shared by enveloped image layouts" is self-referential (say which layouts and what the three fields mean); the new frontend.py:113-137 branch has no comment saying the fixed dimensions/tokens are the checkpoint's canonical processor values validated by _expected below (siblings document themselves, e.g. :99); packing.rs:491's "bracketed patch-merge" mixes the enum name with the README's "patch-merge" label — pick one. N7. Duplicated base commit in the description ("Branch logistics" and "Verified on base 6d6fe0c6").

=== CHECKED AND CLEAN (do not report as findings) ===

#3 [high] SUMMARY REPORT (GitHub post) — PR #483

SUMMARY REPORT (for the GitHub post; 10 bullets max, kept short).

This PR is on the right track — the proto/contract additions are additive, the patch_merge::Envelope extraction is genuine de-duplication, and the Gemma 4 resize/pack arithmetic is self-consistent and overflow-guarded. Three blockers keep it from being mergeable, and the case file has the detail.

Blockers

Should Fix

Nits

#4 [high] Caveats and verified details for B1/B2/B3

Caveats to state honestly when presenting B1/B3 (verified this pass):

#5 [high] Amendments — severity framings for S3, B2, B1

Amendments after verification (use these framings in the report):

  1. S3 (envelope vs prefill chunk) is a latent, not live, defect at repository defaults: ignition/preparation/bootstrap.py:36 defaults prefill_chunk_size = 4096, and scheduler limits require ≥64 and 64-alignment (helios/src/scheduler.rs:67-73). So 1,122 ≤ 4096 passes today; the failure needs a deliberately small prefill chunk (e.g. 1024) on a Gemma 4 core. Frame it as "the invariant is unenforced and undocumented, so it breaks silently for a small-chunk deployment", with the fix being a load-time rejection or clamp plus a boundary test — not as a blocker.

  2. B2 severity framing: the parity tests are honest in intent (they compare against HF when the environment is present) and the skipped-return pattern is precedent in this repo (helios/src/frontend/images/layouts/bracketed.rs:104-111 uses the same FLARE_MINIMAX_M3_SNAPSHOT skip-return). What makes it blocking here is that (a) "45 passed" is presented as evidence for a headline parity claim that plain cargo test never executes, and (b) every other profile's parity evidence is a checked-in fixture (glm.rs:147-199 + tests/frontend/generate_glm_image_fixtures.py; qwen38_images.json). So the ask is "make the parity evidence reproducible/CI-visible or mark it unrun", not "the tests are dishonest".

  3. B1 note: today ImageLayoutKind::Bracketed has exactly one in-tree producer (patch_merge / MiniMax M3, patches_per_feature = 4). The 9 => 768 arm therefore has a single real consumer, Gemma 4 — i.e. it is a model branch wearing a geometry name, and it contradicts the description's orthogonality claim. It is not currently a correctness bug for other models.

#6 [high] Research summary

Reviewed PR #483 (Gemma 4 image prep profile, bracketed 3×3 packing, atomic spans) against its diff, the four prior lenses, and the charter/design-review/AGENTS rules, and prepared both deliverables.

Full report (scratchpad entry 2) is organised into Blockers / Should Fix / Nits, each with finding, file:line evidence, and the requested change. Three blockers: (B1) packing.rs:16-22 keys the Bracketed patch width off patches_per_feature (9 => 768), which is model identity inside shared packing and contradicts the PR's own orthogonality claim — DeepSeek already runs 9 patches per feature at 588 floats; (B2) the headline HF-parity evidence cannot fail, because both snapshot tests return silently without FLARE_GEMMA4_TEST_SNAPSHOT / ../.venv/bin/python, so "45 passed" is identical whether parity ran, and unlike every other profile there is no checked-in fixture; (B3) prompt.rs:137-151 populates atomic spans in shared code for any span-declaring layout, with no test (the only Gemma 4 contract fixture has image_tokens: null) and no disclosure of the scheduling blast radius — the span should be emitted by layouts/bracketed.rs as deepseek.rs:149 does. Six Should Fix cover the missing profile/contract cross-checks, the thrice-authored 768 width, the unenforced max_soft_tokens + 2 ≤ prefill_chunk_size invariant, ignition pinning a single vision tower (charter #74 wants more than one checkpoint), stale docs (helios/README.md:702-704, docs/runtime-core-design.md:226-233, helios/model-contract.md:251-254, docs/TODO.txt), description corrections, and the protobuf gencode regenerated with 7.36.1 under a >=7.36.2 pin. Seven nits cover churn, the table-only test, a missing protobuf round-trip test, the duplicated soft-token allowlist, and prose.

Summary for the GitHub post (scratchpad entry 3) is 10 bullets: 3 blockers, 5 should-fix, 2 nits, each one line of finding plus a tldr request.

Verified caveats are in entry 5: S3 is latent rather than live at the repo's 4096 default chunk, B2's skip-return pattern has in-repo precedent (the MiniMax test does the same) so the ask is reproducibility rather than honesty, and Bracketed currently has only one in-tree producer so B1 is a design violation rather than a present correctness bug. Envelope length is tokens+2 = 1,122 at the 1,120 setting.

#7 [high] Report assembly notes: ordering, exact edit sites, request one-liners

Assembly notes for the final report (entries 1-5 hold the content; this entry holds order + exact imperative requests).

Order the full report: Blockers B1, B2, B3 → Should Fix S1-S7 → Nits N1-N7 → short "verified clean" paragraph (from entry 2's last section) so the author knows what not to re-litigate. Every bullet keeps three parts: Finding (file:line), Request (imperative), Why (rule or failing workflow). Nits may omit Why.

Imperative one-liners to paste as the "Request" for each item:

B1 — "Move the Bracketed patch width into prepared metadata: add patch_size to VisionCapabilities (helios/src/model.rs:44-51), validate it beside patches_per_feature in VisionCapabilities::validate (helios/src/model.rs:68-87), then in packing.rs compute merge_side = patches_per_feature.isqrt() and patch_width = 3 * patch_size * patch_size; delete bracketed_patch_geometry (packing.rs:16-22) and thread the width from config, as class_token() already reads padded_grid::FEATURES (packing.rs:515)." B2 — "Replace the subprocess parity comparison with a checked-in fixture: add tests/frontend/gemma4_images.json + tests/frontend/generate_gemma4_image_fixtures.py (width, height, grid, tokens, SHA-256 of resized bytes / pixel_values LE / position_ids LE) and assert them in gemma4.rs the way glm.rs:147-199 does. Keep a snapshot test only if it is #[ignore = "..."], and report the ignore in the description." B3 — "Emit the span where the envelope is built: layouts/bracketed.rs:82-91 should push data.spans for the range it expanded (mirror layouts/deepseek.rs:149), delete helios/src/model/prompt.rs:137-151, add a Bracketed contract fixture with image_tokens.span set and a test that the span is produced, passes validate_prompt_data, and is rejected when longer than prefill_chunk_size." S1 — "In gemma4::Processor::load (gemma4.rs:23-31) reject unless pooling_kernel_size * pooling_kernel_size == limits.patches_per_feature, 3 * patch_size * patch_size equals the packing patch width, and max_soft_tokens * pooling² <= limits.max_patches_per_image." S2 — "Replace the three literals with one shared constant/helper derived from profile+contract metadata, used by conditioned.rs:192, bracketed() (packing.rs:479-481) and gemma4::process (gemma4.rs:116)." S3 — "Reject (or clamp with a named error) at load when max_soft_tokens + 2 > prefill_chunk_size, and add a boundary test at exactly the chunk size." S4 — "In ignition/preparation/frontend.py:113-137, assert only what the preprocessor consumes (image processor fields, model_type: gemma4_vision, patch_size, pooling_kernel_size, max_soft_tokens) and the three token strings taken from the tokenizer config with an assertion that each encodes to one added token; drop the 27/1152/16/72/4304 pin or move it to the recipe." S5 — "Add Gemma 4 to helios/README.md:702-704, docs/runtime-core-design.md:226-233, helios/model-contract.md:251-254 (16×16 patches, 3×3 pooling, soft-token set) and record the recipe dependency in docs/TODO.txt (style: docs/TODO.txt:1-30)." S6 — "Fix four description items: delete the orthogonality sentence or reword it to describe what packing.rs actually does; drop Execution.persistent_workers (it is #430 / commit 66bf6d03, not this diff); replace 'existing cores unaffected' with the concrete load-path narrowing (patches_per_feature must now be 4 or 9 at model/packing.rs:92-97) and say which cores were swept; state that no serving-path timing was measured and that the parity comparison does not run under plain cargo test." S7 — "Regenerate ignition/preparation/runtime_core_pb2.py with the tree's protoc (protoc --proto_path=helios/proto --python_out=ignition/preparation helios/proto/runtime_core.proto, helios/manifest.md:465-472) so the header returns to 7.36.2 and only descriptor bytes change."

Tone: the review is a request for changes, not a rejection; lead the summary with what is already good (additive proto, Envelope extraction, overflow-guarded geometry) before the blockers.

#9 [high] FULL REPORT — PR #483 round 3 (head 2b4a31e)

Review — PR #483, "Add Gemma 4 image preparation, Bracketed patch-width metadata, and atomic spans"

Head 2b4a31e, base main 27716185. 36 files, +2269/−240. Third round.

Verdict: no blockers. Every blocker and should-fix from the previous round is fixed in code at this head (verified, list below). What remains is one scope/compatibility question that needs an answer before merge, four quality items, and nits.

Verified resolved — do not re-litigate

Blockers

None.

Should Fix

S1 — The Gemma 4 profile lands with no in-tree consumer and no export/serve proof (scope; charter #74)

Finding: the PR's own Limitations section defers end-to-end serving to a companion local-inference-lab/hyperflare-recipes PR, and docs/TODO.txt:331-337 records the qualification work as open. No core fixture under helios/tests/support/contracts/*.json uses the profile, and image_profile="gemma4" has only test callers (tests/preparation/test_frontend_gemma4.py:204). Charter: new model recipes must "prove they export and serve cleanly from the PR branch, and support more than a single checkpoint (#74)". Also nothing exercises the compatibility claim in the same section: tensor_layout runs during Inputs::new (model/packing.rs:65,92-97), so an existing Bracketed core now hits square_merge_side (packing.rs:26-32) at load, and a legacy core with patch_features == 0 must still pack at 1176 — search finds no Bracketed mount test anywhere under helios/tests/. Request: state in the description whether a maintainer signed off on landing the profile ahead of its recipe (or split the branch: the shared half — patch_features, contract-driven Bracketed packing, Bracketed spans, envelope bounds — stands on its own), and add one load test proving (a) a legacy Bracketed core without patch_features still loads and stages 1176-wide pixels and (b) a non-square patches_per_feature fails at load with the new message. Why: the charter makes export+serve the bar for a new profile, and separately requires "verify that existing data, artifacts, and exported cores still load". Today both are asserted in 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) and never mentions patch_features; a repo-wide search for the name in ignition/ returns only the generated runtime_core_pb2.py. A recipe that fills in 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. 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 frontend.py:169-170, so the width is derivable (3 · patch_size² = 768). Request: derive patch_features in Ignition from the preparation settings it already validated (explicit only where the width is not 3 · patch_size², i.e. temporal-merge Bracketed), and add the key plus a "Bracketed vision cores must set this" note to contract.py:112. Why: "solve the right problem in the right place" — the width is preparation metadata, and the first feedback a recipe author gets should not be a serve-time error whose only other hint is a docs/TODO.txt line.

S3 — Processor::load collapses seven rejections into 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 max_patches > limits.max_patches_per_image (:36). The last two compare settings against captured capacity, and the capacity comes from the export's vision.patch_capacities (server/config.rs:497-502), not from the checkpoint — so an operator cannot tell a bad core from a bad checkpoint. server/config.rs:449-463 already shows the actionable style. Request: split by condition, naming the failing field and both values. Why: "Bug fixes need to address the root cause; don't just swallow … an unexplained error". A load path that only says "invalid settings" pushes the diagnosis into the operator's head.

S4 — Dead wire knobs and duplicated constants

Finding: Gemma4ImageSettings.patch_size / pooling_kernel_size (runtime_core.proto:599-600, mod.rs:335-336, gemma4.rs:18-19) are configurable across 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. That makes the patch_size > 64 / pooling > 16 arms at gemma4.rs:32-33 unreachable. The width 768 is also spelled four ways: computed at gemma4.rs:55, via patch_features() at conditioned.rs:187, the legacy 1176 at packing.rs:16, and the literal 3 * 16 * 16 at gemma4.rs:364. Separately 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 glm.rs:13 does, reserve proto tags 1-2, drop the fields, serde keys, validation arms and the two Python literals; keep the Python soft-token gate (preparation is the right place) and let Rust accept any positive budget, or vice versa — not both. Why: AGENTS.md:188-193 forbids configuration switches without a concrete requirement, and these tags become permanent once a core ships. Doing it now costs ~25 lines; doing it later costs a reserved-tag migration.

S5 — Superseded and dead test scaffolding, and 124 unread fixture lines

Finding: (a) gemma4.rs:449-533 (native_pixels_and_positions_match_the_checkpoint_processor, ~85 lines, #[ignore]d) uses exactly fixture seeds 1/5/6 — (91,37), (10,3000), (3000,10) — which gemma4.rs:266-333 already asserts by SHA-256 for grid, tokens, patches, resized RGB, pixels and positions, unconditionally. It carries a bespoke struct.pack('<qqqq') IPC with a hand-computed pixel_offset = 32. (b) gemma4.rs:394-413 writes and hashes a Jinja chat template the test never renders (frontend.encode at :425 is not a template render), then removes it after several unwraps, so a failure leaks it. (c) tests/frontend/gemma4_images.json:2-125 — 124 of 257 lines — is a processor snapshot and a trimmed model block that nothing reads: the sole consumer iterates fixture["cases"] (gemma4.rs:270-273) and the generator writes them at generate_gemma4_image_fixtures.py:81-86. The model block is precisely where image_token_id/boi_token_id/eoi_token_id live, i.e. the recorded ids that would make the envelope claim testable. Request: delete (a) and the template plumbing in (b); for (c), either consume the model block in Rust — assert the configured ImageSettings envelope strings map to the recorded ids and that processor round-trips into Gemma4ImageSettings — or trim both blocks to a small provenance object. Why: AGENTS.md:194-199 ("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.

Nits

Verified clean

Additive wire format (ImagePreparationKind::Gemma4 = 11, ImageSettings.profile tag 11, VisionCapacity.patch_features tag 6 with #[serde(default)] at helios/build.rs:54-56; describe.rs:466-468 omits 0; round-trip test). Envelope extraction is real de-duplication with no MiniMax behaviour change. Gemma 4 arithmetic is overflow-guarded (gemma4.rs:125-138 checked_add/checked_mul/try_fold, check_batch before and after geometry, shared resize::resize). Contract validation accepts 0 and rejects non-multiples of 3 (model.rs:72-92). Bootstrap bounds have 64-aligned boundary tests (server/config.rs:985-1023). Ignition accepts any gemma4/gemma4_vision tower and rejects gemma4_unified (frontend.py:114-141).

Open questions

#10 [high] SUMMARY REPORT (GitHub post) — PR #483 round 3

Gemma 4 image preparation and Bracketed packing — ready to merge after one answer

PR #483 at 2b4a31e. Every blocker and should-fix from the last review is fixed and verified in code: 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, 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. Nice work — the remaining items are about scope and cleanup, not correctness on the served path.

Should Fix

Nits

#11 [high] Corrections to the full report — load path and existing coverage

Corrections and verification confirmations for entry #9 (full report).

  1. patches_per_feature == 0 is NOT a new load-time hole. PreparedContract::validate calls self.vision.validate() (helios/src/model/contract.rs:376), which rejects patches_per_feature == 0 for any enabled vision core (helios/src/model.rs:78), and Inputs::new runs config.contract.validate(manifest) at model/packing.rs:66 before tensor_layout at :92. So the new narrowing from square_merge_side (packing.rs:26-32) is only the non-square nonzero value. Entry #9's open question should read "non-square (not zero)".

  2. The legacy patch_features == 0 path IS test-covered. packing.rs:660-670 (bracketed_packs_3x3_metadata_widths_and_rejects_invalid_extents) asserts tensor_layout(Bracketed, …, 16) == (Float32, 16 * 1176) for bracketed_config(4, 0), and :671-680 asserts a non-square patches_per_feature = 3 errors. That is the packing half of the compatibility claim. What is still missing is a core-load mount (no .json under helios/tests/support/contracts/ uses ImageLayoutKind::Bracketed; gemma4_frontend.json:16-17,38 has image_preparation: null, image_layout: null, image_tokens: null). So S1's request should be scoped: add a mount/load test, not "prove the staging arithmetic", which is already proven.

  3. VisionCapabilities::validate also rejects !patch_features.is_multiple_of(3) (model.rs:79); 768 and 1176 both pass, so no legacy core is affected by that clause.

  4. conditioned.rs:367 derives patches_per_feature as pooling_kernel_size * pooling_kernel_size from the settings — a second place the Gemma 4 pooling value is computed outside gemma4.rs, worth folding into S4's "one source of truth" request.

  5. Test-count sanity: the PR's "47 passed" for frontend::images and "3 passed" for server::config are plausible against what I read (gemma4.rs has 5 tests, packing.rs the profile table + bracketed behaviour test, config.rs:937 one new test) but were not executed here; nothing in the report depends on the counts.

#12 [high] FULL REPORT v2 — PR #483 round 3 (supersedes #9)

Review — PR #483, "Add Gemma 4 image preparation, Bracketed patch-width metadata, and atomic spans"

Head 2b4a31e, base main 27716185. 36 files, +2269/−240. Third round. Supersedes entry #9 (this version applies the corrections in entry #11).

Verdict: no blockers. Every blocker and should-fix from the previous round is fixed and verified in code at this head. What remains is one scope/compatibility question that needs an answer before merge, four quality items and a set of nits.

Verified resolved — do not re-litigate

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 PR's Limitations section defers end-to-end serving to an unlanded local-inference-lab/hyperflare-recipes PR, and docs/TODO.txt:331-337 records the qualification work 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 a repo-wide search for Bracketed under helios/tests/ returns nothing. The charter requires a new model profile 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 staging arithmetic for a legacy core is tested (packing.rs:660-670 asserts 16 × 1176 for patch_features == 0, :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:65,92-97), 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, contract-driven Bracketed packing, Bracketed spans, envelope bounds) onto its own, since it stands alone. Either way add one core-load test with a Bracketed contract JSON that omits patch_features, asserting it 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) 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". 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 :169-170, so the width is derivable as 3 · patch_size² = 768. Request: derive patch_features in Ignition from the settings it already validated, and add the key (plus a note that Bracketed vision cores must set it) to contract.py:112. Why: "solve the right problem in the right place". 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. Request: split the condition, naming the failing field and both values. Why: "Bug fixes need to address the root cause; don't just swallow … an unexplained error". A load path that only says "invalid settings" moves the diagnosis onto the operator.

S4 — Dead wire knobs and constants spelled several ways

Finding: Gemma4ImageSettings.patch_size / pooling_kernel_size (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, the legacy 1176 at packing.rs:16, and the literal 3 * 16 * 16 at gemma4.rs:364; 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 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 glm.rs:13 does, reserve proto tags 1-2, drop the struct fields, serde keys, validation arms and the two Python literals; 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 forbids configuration switches without a concrete requirement, and these tags become permanent once a core ships. Removing them now costs ~25 lines; later it costs a reserved-tag migration.

S5 — Superseded test scaffolding and 124 unread fixture lines

Finding: (a) gemma4.rs:449-533 (native_pixels_and_positions_match_the_checkpoint_processor, ~85 lines, #[ignore]d) uses exactly fixture seeds 1/5/6 — (91,37), (10,3000), (3000,10) — which gemma4.rs:266-333 already pins by SHA-256 for grid, tokens, patches, resized RGB, pixels and positions, unconditionally; it also carries a bespoke struct.pack('<qqqq') IPC with a hand-computed pixel_offset = 32. (b) gemma4.rs:394-413 writes and hashes a Jinja chat template the test never renders (frontend.encode at :425 is not a render), then removes it after several unwraps, so a panic leaks it. (c) tests/frontend/gemma4_images.json:2-125 — 124 of 257 lines — is a processor snapshot and a trimmed model block that nothing reads: the sole consumer iterates fixture["cases"] (gemma4.rs:270-273) and the generator writes them at generate_gemma4_image_fixtures.py:81-86. The model block is exactly where image_token_id/boi_token_id/eoi_token_id live — the recorded ids that would make the envelope claim testable. Request: delete (a) and the template plumbing in (b); for (c) 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 say in the description that the live-checkpoint runs are not part of CI. Why: AGENTS.md:194-199 ("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.

Nits

Verified clean

Additive wire format: ImagePreparationKind::Gemma4 = 11 and ImageSettings.profile tag 11 (runtime_core.proto:585), VisionCapacity.patch_features tag 6 with #[serde(default)] (helios/build.rs:54-56), describe.rs:466-468 omits 0 so legacy describe JSON is byte-identical, and a round-trip test covers the new tag (protobuf.rs:813). Envelope extraction is real de-duplication with no MiniMax behaviour change. Gemma 4 arithmetic is overflow-guarded (gemma4.rs:125-138: checked_add/checked_mul/try_fold, check_batch before and after geometry, shared resize::resize rather than a new kernel). Contract validation accepts 0 and rejects non-multiples of 3 (model.rs:72-92). Ignition accepts any gemma4/gemma4_vision tower and rejects gemma4_unified (frontend.py:114-141).

Open questions

#13 [high] SUMMARY REPORT v2 (GitHub post) — PR #483 round 3 (supersedes #10)

Replace the first Should Fix bullet of entry #10 with this corrected wording (zero patches_per_feature is already rejected at model.rs:78 via contract.rs:376, so the new narrowing is only the non-square value; the legacy 1176 staging path is already tested at packing.rs:660-670).

Gemma 4 image preparation and Bracketed packing — ready to merge after one answer

PR #483 at 2b4a31e. Every blocker and should-fix from the last review is fixed and verified in code: 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, 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. Nice work — the remaining items are about scope and cleanup, not correctness on the served path.

Should Fix

Nits

#14 [high] Research summary

Reviewed PR #483 at head 2b4a31e (rebased onto main 27716185) against the four prior lens reports, the charter, and the code itself. The full report is scratchpad entry #12 and the ready-to-post summary is entry #13 (both supersede #9/#10 after the corrections in #11).

Verdict: no blockers. Every blocker and should-fix from the previous round is genuinely fixed at this head — I verified each in code rather than taking the author's reply: the patches_per_feature → width model-identity table is replaced by prepared metadata (packing.rs:16-32), the Hugging Face parity fixture runs unconditionally (gemma4.rs:266-333 over tests/frontend/gemma4_images.json), atomic spans moved into layouts/bracketed.rs:52-88 with the shared prompt.rs fallback deleted, patch width has one authority across 11 profiles (mod.rs:459-471, which also fixes main's _ => 588 bug for PatchMerge/PaddedGrid), the maximum envelope is bounded against prefill_chunk_size and span.max_tokens at bootstrap (server/config.rs:465-488), and the Ignition tower pins are gone (frontend.py:114-173). I also confirmed the earlier runtime_core_pb2.py version concern was wrong and withdrew it — 7.36.1 is byte-identical on main.

Two corrections I made to the incoming lens findings, both material to severity:

Five should-fix items remain, the first of which needs an answer rather than a code change: the Gemma 4 profile lands with no in-tree consumer and no export/serve proof (charter #74 requires one), so the author should either say a maintainer approved that ordering or split the shared half onto its own branch. The others: nothing on the Python side authors patch_features, so a recipe filling the historical four keys exports 0 → legacy 1176 → rejected at flare run (contract.py:112 vs server/config.rs:456-463); seven load rejections share one opaque message (gemma4.rs:30-38); patch_size/pooling_kernel_size are dead wire knobs that duplicate the 768 constant four ways and the soft-token allowlist twice; and one #[ignore]d test duplicates the unconditional fixture, one ignores a template it never renders, and 124 fixture lines (including the token ids) are read by nothing.

The summary is organized into Should Fix (5) and Nits (5) only, per the instruction to drop the Blockers section when nothing blocks, and each bullet carries a one-line finding plus an imperative request.

#15 [high] Post-writing context: thread state, withdrawn items, tone, verification limits

Context for whoever writes the final report from entries #12 (full) and #13 (summary). Nothing here contradicts them; it records the surrounding decisions.

Thread state

Withdrawn prior findings — must NOT be re-raised

  1. runtime_core_pb2.py at 7.36.1 under a protobuf>=7.36.2 pin. The previous review made this a should-fix. It is withdrawn: main's own runtime_core_pb2.py:5,12-16 already declares 7.36.1, this head matches byte-for-byte, and the pin bounds the runtime rather than the generator header. The only residue is a nit — the description says "libprotoc 36.1" while the artifact records 7.36.1.
  2. "Make atomic_spans unconditional / drop the bool." The architecture lens recommended dropping the parameter and emitting spans unconditionally, citing layouts/deepseek.rs. That advice is wrong at this head: helios/src/model.rs:457-458 rejects a non-empty data.spans when the contract declares no ImageSpan, so emitting unconditionally would fail prompt validation for every existing Bracketed core without a span (MiniMax). Entry #12 and #13 keep the bool and only suggest passing Option<&ImageSpan> instead.
  3. patches_per_feature == 0 as a new load-time regression. Rejected: PreparedContract::validate → vision.validate() (model/contract.rs:376 → model.rs:78) already rejects zero for any enabled vision core, and runs before tensor_layout. Only a non-square nonzero value newly fails to load.
  4. Legacy 1176 staging arithmetic as untested. It is tested (packing.rs:660-670). Only a core-load mount is missing.

Format and tone decisions for the post

Author reply accuracy (checked)

Every specific code claim in the 2026-11-25 reply holds at this head: patch_features tag 6 additive with serde(default) (build.rs:54-56); Bracketed reads width from prepared metadata; gemma4::Processor::load checks pooling² and the patch budget; ImageProcessor::patch_features() covers all profiles; bootstrap bounds exist; spans moved to layouts/bracketed.rs; ignition tower pins dropped and three checkpoints covered; docs and TODO.txt updated; libprotoc claim matches main. No claim in the reply was false — the remaining items are things it did not address (Python-side patch_features, dead knobs, superseded tests) and one scope question it did not raise itself.

Verification limits to state honestly