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

Raw Markdown for agents: https://autobot.eidonix.com/p/51f19920-e16c-413b-b18d-a9f4cc500556.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

#17 [high] FULL REPORT — PR #483 round 4 (head ab9a432) — Blockers / Should Fix / Nits

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

Head ab9a432b (branch rickybrent:core/gemma4-image-frontend), base main 27716185. Round 4 (supersedes entries #12/#13, which reviewed 2b4a31e). Verified read-only against the head: I re-read every cited site. No cargo test / cargo check / pytest was run, and the head commit reports no CI checks, so every behavioural claim below comes from code and callers.

Verdict: no blockers. Every should-fix from the previous round is fixed and verified in code (list below). What remains is one scope/evidence question that needs an answer from a maintainer, three small code/test items, and ten nits.

Verified resolved this round — do not re-litigate

Blockers

None.

Should Fix

S1 — The profile lands ahead of the exporter that can use it, and nothing mounts it end to end

Finding: end-to-end serving is deferred to an unlanded companion PR in local-inference-lab/hyperflare-recipes, and docs/TODO.txt:330-337 records the qualification (E2B/E4B/26B-A4B/31B export + serving, plus the partial-span prefix-cache audit) as open. No prepared contract exercises the profile: helios/tests/support/contracts/gemma4_frontend.json:16-17,38 declares image_preparation: null, image_layout: null, image_tokens: null, and no contract JSON under helios/tests/support/contracts/ uses layout 9 (Bracketed) or preparation 11 — the layouts present are 1, 2, 3, 5, 6, 10. Gemma 4 is covered only by Rust-constructed configs (model/prompt.rs:1172-1281, server/config.rs:935-1023, frontend/images/gemma4.rs) and by Ignition-side tests, none of which goes through Bootstrap::load (server/config.rs:288-298) → served image request. The charter ("New model recipes, aliases, or formats: … prove they export and serve cleanly from the PR branch, and support more than a single checkpoint", #74) and "verify that existing data, artifacts, and exported cores still load" both apply. The compatibility half is now genuinely tested; the export/serve half is prose. Request: state in the description whether a maintainer approved landing the profile ahead of its recipe (the author's stack-order argument — recipes were extracted, so the core profile must land first — is plausible and needs only one line of confirmation), 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 contract fixture shaped like qwen38.json with image_layout: 9, image_preparation: 11, a declared image_tokens.span, vision { patches_per_feature: 9, patch_features: 768 }, loaded through the helper the other fixtures use; otherwise say plainly that Gemma 4 serving is unqualified. Why: the charter makes export-and-serve the bar for a new format. The author's own limitations paragraph covers unmeasured timing/memory but not that the profile has never been served. Also note the head has no CI checks, so even the author's unit evidence has not run in CI.

S2 — The Gemma 4 processor file is not where the default path looks

Finding: ignition/preparation/frontend.py:310 resolves the processor as snapshot / "preprocessor_config.json" when preprocessor is None. Gemma 4 snapshots ship processor_config.json — the fixture generator reads snapshot / "processor_config.json" (tests/frontend/generate_gemma4_image_fixtures.py:28) and every test passes the path explicitly (tests/preparation/test_frontend_gemma4.py:76,88,239,246). So the documented call shape prepare_frontend(snapshot, eos_token_ids=[…], image_profile="gemma4") raises FileNotFoundError, and no test covers the default argument, so CI cannot catch it. Pre-existing for padded_grid too (see the comment at frontend.py:100), so this is consistency plus a missing test rather than a new defect. Request: resolve the processor path per profile (try processor_config.json for gemma4/padded_grid, or accept whichever of the two exists), or make preprocessor required for those profiles and document it; add one test that calls prepare_frontend without preprocessor against a snapshot holding processor_config.json. Why: the first recipe author to follow the documented shape gets a FileNotFoundError instead of a prepared contract, and the failure is invisible to CI.

S3 — Only two of the five allowlisted soft-token budgets are ever loaded

Finding: helios/src/frontend/images/gemma4.rs:13 accepts [70, 140, 280, 560, 1120] and frontend.py:132 accepts the same five, but the fixture generator's specs are only 280 and 1120 (tests/frontend/generate_gemma4_image_fixtures.py:31-40), so processor_with_budget is only ever constructed with 280 (gemma4.rs:246-248) and 1120. max_soft_tokens drives max_patches() (:98-100), the target pixel budget (:106), the aspect-clamp branches (:118-123) and max_envelope_tokens() (:90-92), which feeds the new load-time bound against prefill_chunk_size and span.max_tokens (server/config.rs:464-487). Budget 70 in particular is what the checkpoint's own video_processor declares (fixture tests/frontend/gemma4_images.json, video_processor.max_soft_tokens), so the small-budget clamp branches are the untested edge. Request: add (91, 37, 70), (10, 3000, 140) and one 560 case to the generator specs and regenerate, or add a table test that constructs a processor for each SUPPORTED_SOFT_TOKENS entry and asserts geometry for one fixed shape. Why: a budget-specific geometry or parity defect would first appear at flare run on a real checkpoint rather than in cargo test.

S4 — The new legacy-core test hand-builds a manifest the shared builder could emit

Finding: helios/src/model/tests.rs:1343-1411 is a 68-line local build_manifest closure that repeats the descriptor/stride/address walk of helios/src/model/testing.rs:307-337 and the binding assembly of :368-377, plus nine hand-written ValueBindings at tests.rs:1304-1332. It exists because testing::manifest sends GraphOperation::Vision to _ => unreachable!() (testing.rs:354) and fixes every ImageTensor width to 1 (testing.rs:257), so a vision graph cannot be described. Line tests.rs:1450 (base_manifest = build_manifest(1176);) then rebuilds a manifest it already holds. Request: add GraphOperation::Vision => GraphKind::Vision at testing.rs:344-355 and let the width for vision_pixel_values come from vision.bracketed_patch_features(); the test then overrides one buffer extent to (16, pixel_width) and the local closure, the hand-written bindings and the :1450 rebuild all disappear. Why: ~110 lines of duplicated manifest arithmetic is a second source of truth for graph layout; when ExecutionManifest changes this test breaks for reasons unrelated to the behaviour it checks (a legacy core without patch_features loads and stages 1176-wide pixels).

Nits

  1. Per-profile patch width is still authored twice, over two different enums. frontend/images/packing.rs:32-49 maps ImageLayoutKind → float width (Qwen|Mimo → 1536, Deepseek*|Moonvit|Step → 588, Bracketed → vision.bracketed_patch_features(), Radio → 768, Glm → 1176, ClassToken → 1200), while frontend/images/mod.rs:459-471 maps Profile → the same numbers. They are linked only by the test at packing.rs:685-814. Fix: pass the processor width (or patches_per_frame+width) into tensor_layout from Inputs::new (model/packing.rs:92-97), so Profile stays the single authoring point.
  2. Duplicated and repeated test rows. gemma4.rs:386-396 repeats seven of the nine rows the fixture already pins by SHA-256 via canonical_processor_pixels_positions_and_resize (:314-381); only (100,3000) and (3000,100) are unique — keep those plus the tokens * 9 == patches invariant (:400). gemma4.rs:404-420 restates the 91×37 fixture case by hand; keep only the (x, y) ordering assertion (:413-418), which the hash cannot express. packing.rs:685-814 (~130 lines) repeats patch_features: 0 ten times where four rows (Gemma 4 9/768, PatchMerge 4→1176, PaddedGrid 1200, one of 588/1536) cover every distinct outcome.
  3. Two documentation/wording items. helios/README.md:806 regenerates the Gemma 4 fixture with "$SNAPSHOT", but the only prior definition of that name is the Qwen3.8 command at :787-789 pointing at a different checkpoint — use GEMMA4_SNAPSHOT or name the directory. The description's "decodes, resizes, normalizes, packs, and validates" overstates: the profile rescales by 1/255 only (gemma4.rs process loop; frontend.py:124-127 requires do_normalize: False, image_mean 0, image_std 1), as helios/README.md:716 correctly says — change to "rescales by 1/255".
  4. Duplicated or doubled constants. The soft-token allowlist exists twice in two languages (gemma4.rs:13 and frontend.py:132) with nothing tying them; the Rust comment says the duplication is deliberate, so add a cross-reference in both directions and a table test over the Rust list, or carry the set in the prepared settings. max_patches is computed twice — checked at gemma4.rs:61-64 and unchecked at :98-100 — so have load call max_patches() on the constructed value.
  5. Shape items. Envelope is now a shared frontend construct but is homed in frontend/images/patch_merge.rs:13 with the doc "shared by PatchMerge and Gemma4" — move it to frontend/images/envelope.rs. atomic_spans: bool (layouts/bracketed.rs:23, derived at model/prompt.rs:58-64) is correct and must stay gated (emitting unconditionally would make model.rs:451-469 reject every span-less Bracketed core), but pass Option<&ImageSpan> so the derivation sits with its use. Also: helios/src/model.rs:89 applies !patch_features.is_multiple_of(3) to every enabled vision core while only Bracketed consumes the field, and reports it through the generic "invalid prepared vision capabilities" (:99) — scope the rule to Bracketed or name the field; and scheduler/policy.rs:343-350 truncates end back to span.start for a straddling span, which the new bootstrap bound makes unreachable but no test documents — one sub-envelope capacity case would.

Accepted as-is (do not re-raise): Gemma4ImageSettings::patch_size / pooling_kernel_size staying on the wire. The author's reasoning holds — PatchMergeImageSettings.patch_size is likewise pinned (patch_merge.rs:92), the caps are documented as wire-level defence in depth (gemma4.rs:26), and removing the fields pre-merge would churn downstream recipe tests. The remaining ask is only the cross-reference for the allowlist and one test tying the two languages (nit 4).

Checked and clean

Additive wire format (ImagePreparationKind::Gemma4 = 11, ImageSettings.profile tag 11, VisionCapacity.patch_features tag 6 with #[serde(default)] at helios/build.rs:53-56, describe omitting 0, round-trip test); bracketed_patch_features() mapping 0 → 1176 (model.rs:72-80) with validate() accepting 0 (model.rs:82-102); envelope bounds checked at bootstrap where they belong (server/config.rs:464-487); bracketed() rejecting non-divisible grids and any token/patch mismatch (packing.rs bracketed arm); overflow guards (checked_mul gemma4.rs:48-51,61-64, try_fold :157-162, check_batch before and after geometry :152,:163); layout-owned spans validated at both ends (layouts/bracketed.rs:57-65,86-88) plus the image/feature counter cross-check (:89-93); Envelope extraction preserving MiniMax semantics (patch_merge.rs:13-136); mechanical patch_features: 0 struct fills across server/scheduler/flare-cli tests.

Open questions / cannot establish

#18 [high] SUMMARY REPORT (GitHub post) — PR #483 round 4 (head ab9a432)

Gemma 4 image preparation + Bracketed patch width — no blockers, four small items before merge

PR #483 at ab9a432b. Every should-fix from the last round is fixed and verified in code this time: per-condition load errors naming both values (gemma4.rs:25-84), one patch_features() authority (gemma4.rs:86-88), patch_features authored in the Ignition contract default with a docstring (contract.py:109-119), the fixture's processor/model blocks now consumed by a CI test (test_frontend_gemma4.py:187-225), the duplicate bootstrap width check folded into one Bracketed branch (server/config.rs:449-463), the superseded #[ignore]d test deleted with the temp template Drop-guarded, and the README/docs contradictions scoped and filled in. Nice work — nothing here is wrong on the served path.

Should Fix

Nits

Accepted as-is: keeping patch_size/pooling_kernel_size on the wire — precedent (patch_merge.rs:92), documented defence in depth, and removal would churn downstream recipe tests. Only the allowlist cross-reference is still asked for.

#19 [high] Amendments for round 4 — S2 acceptance, resolved and withdrawn nits

Two items that were should-fix in round 3 and are now downgraded/accepted — record them so the report does not silently drop them.

  1. Round-3 S2 ("Ignition derives patch_features") is now accepted as-is, with one residual nit. The author added "patch_features": 0 to the vision default dict and a docstring (ignition/preparation/contract.py:109-119) documenting that Bracketed recipes with a non-1176 width must set it, but declined to derive the width inside contract.py, on the grounds that width belongs with patches_per_feature / patch_capacities in the recipe. That is defensible (the earlier complaint — no authoring surface at all — is fixed), and the residual failure mode is one actionable load-time error, not a silent wrong result: server/config.rs:449-455 prints "bracketed image layout patch width (1176) differs from image processor (768); re-export the core with vision.patch_features". Report this as an accepted trade-off in the Nits "duplicated/doubled expressions" bullet or in the "Accepted as-is" paragraph, with the ask limited to naming the remedy in the recipe-author docs (e.g. alongside docs/TODO.txt:330-337 or the companion recipe PR). Do not present it as an open should-fix.

  2. Round-3 nits 1 and 5 are resolved and must not be re-raised: the duplicate bootstrap width check is folded into one Bracketed branch (server/config.rs:449-463), and VisionCapabilities::bracketed_patch_features() is now the accessor used there (model.rs:74-80) instead of reaching into packing.

Also: round-3 nit about packing.rs's h % merge_side != 0 || w % merge_side != 0 guard is withdrawn — it is not implied by tokens * patches_per_feature == patches (h=2, w=9, ppf=9 satisfies the identity but is not a 3×3 tiling), and the author's rebuttal is correct.

#20 [high] Research summary

Reviewed PR #483 at its new head ab9a432b against the five lens reports, the charter, and the code itself, then rewrote both deliverables for this round.

Round-4 verdict: no blockers. Every should-fix from round 3 is fixed and verified in code this time — split load errors naming both values (gemma4.rs:25-84), single patch_features() authority (:86-88), patch_features authored in the Ignition contract default with a docstring (contract.py:109-119), the fixture's processor/model blocks now consumed by a CI test (test_frontend_gemma4.py:187-225), the legacy Bracketed core-load test the last round asked for (model/tests.rs:1279-1452), the duplicate bootstrap width check folded into one branch (server/config.rs:449-463), the superseded #[ignore]d test deleted with the temp template Drop-guarded, and the README/docs contradictions scoped and filled in.

Four should-fix remain, all small and none on the served path: (1) the profile still lands ahead of its exporter and no contract fixture uses layout 9 / preparation 11, so nothing is exercised from Bootstrap::load to a served image request — needs either a one-line maintainer confirmation of the stack order or one Bracketed+Gemma 4 fixture; (2) prepare_frontend(snapshot, image_profile="gemma4") looks for preprocessor_config.json (not opened) while Gemma 4 ships processor_config.json (not opened), so the documented default raises FileNotFoundError and no test covers it; (3) only 2 of the 5 allowlisted soft-token budgets are ever loaded, leaving the small-budget clamp branches untested; (4) the new legacy-core test hand-builds ~110 lines of manifest that one arm in testing::manifest would remove.

Ten nits are grouped into five bullets: patch width authored over two enums, repeated test rows, two documentation/wording fixes, duplicated allowlist and doubled max_patches, and shape items (Envelope's home, Option<&ImageSpan> instead of a bare bool, the over-broad % 3 rule, the untested sub-envelope prefill path).

I also recorded the author's counter-argument as accepted as-is: keeping patch_size/pooling_kernel_size on the wire (PatchMerge precedent, documented defence in depth, downstream churn) and leaving width authoring to the recipe rather than deriving it inside contract.py — the residual ask there is only a cross-reference naming the remedy. Two round-3 nits are marked resolved and the packing.rs divisibility-guard nit is withdrawn, so the next report cannot re-raise them.

Full report is scratchpad entry #17; the ready-to-post summary is #18; the acceptance/withdrawal notes are #19. Verification was read-only — no cargo test or pytest, and the head commit reports no CI checks, which is stated in the report.

#21 [high] Final assembly instructions for the round-4 report and post

Where the deliverables live: entry #17 = full report (Blockers / Should Fix / Nits + verified-resolved + clean list + open questions), entry #18 = ready-to-post summary, entry #19 = acceptance, resolved-nits and withdrawal notes. Use #17/#18 verbatim where possible; #19 prevents re-raising closed items.

Diff facts for the header: PR #483, rickybrent:core/gemma4-image-frontend → main, head ab9a432b, base main 27716185, 38 files, +2490/−251 (lens reports agree on 36–38 files because two of them counted before the last push; prefer "38 files, +2490/−251" and do not attribute base-branch churn to the author — the head diff also carries unrelated main churn: banner removal, flare doctor, parallax, download rewrites, RebuildManifest → PreparationManifest).

Required shape of the output:

Order of the should-fix items is deliberate and should be preserved: S1 scope/evidence (decides whether the rest matters now), S2 the processor_config.json default (first thing a recipe author hits), S3 budget coverage, S4 the manifest duplication.