#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.
- Finding: helios/src/frontend/images/packing.rs:16-22 fn bracketed_patch_geometry(ppf) { 4 => (2, 1176), 9 => (3, 768), _ => Err } used from tensor_layout (packing.rs:39-42) and bracketed() (packing.rs:479-481).
- Why it is wrong: patch width is 3·patch_size², a vision-tower property; the merge count is unrelated. The key is provably ambiguous in-tree: DeepSeek runs patches_per_feature = 9 with 588 floats/patch (packing.rs:35-38, and helios/src/frontend/images/deepseek*.rs produce 588), so
9 => 768is model identity, not geometry. docs/design-review.md:38-52 requires input packing to "stay shared; use prepared metadata", and states "Enums, callbacks, schema names, and metadata fields cannot serve as alternative model allowlists"; charter line "Keep the runtime small and model-agnostic … shouldn't accumulate per-model branches (#267, #334)". Every other arm of tensor_layout derives its width from a named constant/profile (qwen() packing.rs:123-134; class_token() uses padded_grid::FEATURES packing.rs:515). - It also contradicts the PR description's own claim ("derived … directly from patches_per_feature so ImageLayoutKind and ImagePreparationKind remain orthogonal with no model-identity branching in upload packing").
- Request: carry the vision patch width in prepared metadata (e.g.
VisionCapabilities.patch_size, validated next to patches_per_feature in helios/src/model.rs:68-87) and compute merge_side = ppf.isqrt(), patch_width = 3*patch_size²; or declare the per-layout feature width on the frontend/vision contract the way padded_grid::FEATURES is declared. Delete the table. - Evidence that nothing in-tree breaks: only PatchMerge/Minimax uses ImageLayoutKind::Bracketed today with patches_per_feature = 4 (helios/tests/message_boundaries.rs:494; layouts/bracketed.rs:104-180); Step's 16 (helios/tests/tools/test_step_images.rs:82) is a different layout.
B2. The headline HF-parity evidence cannot fail, and is not reproducible or checked in.
- Finding: helios/src/frontend/images/gemma4.rs:236-244 and :253-256 (checkpoint_tokens_expand_the_image_envelope) return silently unless FLARE_GEMMA4_TEST_SNAPSHOT and ../.venv/bin/python exist; :281-283 returns silently if the template subprocess fails; :336-339 (native_pixels_and_positions_match_the_checkpoint_processor) returns silently without ../.venv/bin/python. A silent return is a pass, so the reported "45 passed" is identical whether the Hugging Face comparison ran or not (AGENTS.md:103-109, :306 "Report a skipped test as an unrun check").
- Repo precedent is a checked-in fixture: helios/src/frontend/images/glm.rs:147-199 compares SHA-256 of resized bytes/pixels/positions from tests/frontend/glm53_images.json with generator tests/frontend/generate_glm_image_fixtures.py; Qwen does the same (qwen38_images.json). This PR adds no such fixture.
- Also: the parity inputs are synthetic rasters ((x%256) as u8, gemma4.rs:378-383) and only 3 sizes.
- Request: add tests/frontend/gemma4_images.json + a generator script (width, height, grid, tokens, hashes of resized/pixel_values/position_ids) and reduce the test to the glm.rs shape; or mark both snapshot-dependent tests #[ignore = "..."] and report them as unrun checks in the description. Either way, say in the description that plain
cargo testdoes not execute the parity comparison.
B3. Atomic spans are produced by shared code for every span-declaring layout, are untested, and their compatibility impact is undisclosed.
- Finding: helios/src/model/prompt.rs:137-151 fills prepared.data.spans from conditioned_inputs whenever
data.spans.is_empty()and the contract declares an ImageSpan — a profile-independent condition. Consumers: validate_prompt_data (helios/src/model.rs:436-451) and Scheduler::set_prefill_spans via helios/src/server/runtime.rs:1458-1465 → helios/src/scheduler.rs:1912-1936 (spans become unsplittable prefill units). - Precedent says the layout owns its spans: helios/src/frontend/images/layouts/deepseek.rs:149 pushes data.spans next to the token block it emitted; after this PR, layouts/bracketed.rs:82-91 still returns PromptData::default() (empty spans), so one field is owned centrally and the rest by the layout. The span is also re-derived from
additional + 1(prompt.rs:129-131, bracketed.rs:77-81), which equals the envelope length only by coincidence of howadditionalis defined. - No test covers the new branch: the only in-tree Gemma 4 contract fixture has "image_tokens": null (helios/tests/support/contracts/gemma4_frontend.json:38), and the layout matrix in helios/src/model/prompt.rs:481-487 declares a span only for Deepseek and DeepseekRowMajor (which already fill their own spans, so the new code never fires under test). No new test in the diff touches prompt.rs.
- The description's "Existing cores and non-Gemma image profiles remain wire-compatible and unaffected" is therefore unbacked and imprecise: any core whose layout declares a span and returns none previously failed validate_prompt_data ("image token spans do not match their declared boundaries") and now succeeds with atomic prefill.
- Request: emit the span in layouts/bracketed.rs beside the envelope it builds (deepseek.rs:149 pattern) and delete prompt.rs:137-151; add a Bracketed contract fixture with image_tokens.span set plus a test that the span is produced, accepted by validate_prompt_data, and rejected/truncated when it exceeds prefill_chunk_size. In the description, state the before/after for existing cores.
=== SHOULD FIX ===
S1. gemma4::Processor::load accepts settings that neither the packer nor the cache validator can represent.
- helios/src/frontend/images/gemma4.rs:23-31 only checks patch_size ∈ 1..=64, pooling_kernel_size ∈ 1..=16, and the max_soft_tokens allowlist; it never requires pooling² == limits.patches_per_feature (which prompt.rs:171 and packing.rs:488 both use) nor that 3·patch_size² equals the packing stride. With patch_size = 14, pooling = 3 the profile loads, emits 588 floats/patch (gemma4.rs:116) and packing.rs:497 slices at the 768-wide stride → silently misaligned tensors or "truncated vision pixels"; conditioned.rs:192's hard-coded 768 makes the cached-record check fail with no error (cache recomputed forever).
- Request: validate in load() that pooling_kernel_size² == limits.patches_per_feature and that 3·patch_size² equals the declared patch width, and that max_soft_tokens·pooling² ≤ limits.max_patches_per_image. (If B1 is done via a declared patch width, this becomes a single cross-check.)
S2. The patch width is authored three times with no compile-time link.
- packing.rs:19 (9 => 768), conditioned.rs:192 (Profile::Gemma4(_) => 768), gemma4.rs:116 (3·patch_size²). conditioned.rs:191 already shows the better pattern for PaddedGrid (padded_grid::FEATURES).
- Request: one shared constant/helper derived from the profile+contract metadata, used by conditioned.rs, bracketed() and gemma4::process. (Subsumed by B1's fix; list so the fix is complete.)
S3. Largest supported image cannot be prefilled atomically at a small chunk size, and nothing checks it.
- max_soft_tokens 1120 (gemma4.rs:11) expands to an envelope of tokens+2 = 1122 (expand: start + tokens image tokens + end, patch_merge.rs:58-69; test asserts start+261 for 260 tokens, gemma4.rs:318-320). validate_prompt_data rejects spans longer than config.limits.prefill_chunk_size (model.rs:421-423) and set_prefill_spans rejects s.end - s.start > capacity (scheduler.rs:1922-1930), and the server turns that into a failed request (runtime.rs:1458-1465). Nothing in load()/geometry() checks max_soft_tokens + 2 ≤ prefill_chunk_size.
- Request: reject the combination at load with a named error (or clamp max_soft_tokens to the largest value whose envelope fits), and add a boundary test. Note prefill_chunk_size must be 64-aligned ≥ 64 (scheduler.rs:67-73), so 1024-chunk deployments hit this.
S4. Ignition's Gemma 4 gate pins one vision tower and derives nothing from the checkpoint.
- ignition/preparation/frontend.py:126-129 asserts num_hidden_layers 27 / hidden_size 1152 / num_attention_heads 16 / head_dim 72 / intermediate_size 4304 — an architecture variant, not a preprocessor fact; the image tokens are literals (:134-136) rather than checked against the checkpoint's added tokens. Consequence: an otherwise identical Gemma 4 checkpoint with a different tower is rejected by preparation with "unsupported … vision configuration", and a checkpoint with different token spellings fails later at request time ("image envelope marker must encode one token", patch_merge.rs:46).
- Charter: "New model recipes … must list supported checkpoints from an official or widely used source … and support more than a single checkpoint (#74)". The evidence names one snapshot (google/gemma-4-31B-it 842da379) while docs/model-preparation.md:345 lists gemma-4-e2b/e4b/12b/26b-a4b/31b.
- Request: assert only the fields the preprocessor consumes (patch_size, pooling_kernel_size, max_soft_tokens, rescale/normalize/convert flags) and the vision model_type/patch/pooling; take the three token strings from the tokenizer config and assert each encodes to one added token; show a second checkpoint in the evidence or narrow the claim to one checkpoint.
S5. Documentation the change makes stale was not updated.
- helios/README.md:702-704 ("Profiles cover Qwen, MiMo, patch-merge, DeepSeek, DeepSeek row-major, Moonvit, Step, RADIO, and GLM inputs") — Gemma 4 missing.
- docs/runtime-core-design.md:226-233 (image settings enumeration per profile) — no Gemma 4 entry, nothing about Bracketed deriving its stride.
- helios/model-contract.md:251-254 (image token layout declares feature IDs and atomic spans; custom image layout code produces token positions) — a new preparation kind with geometry/pooling settings belongs here.
- docs/TODO.txt holds unrun checks and pending measurements (AGENTS.md:57-59); the recipe dependency ("end-to-end multimodal serving requires the companion recipe PRs") is exactly such an entry.
- Request: add Gemma 4 to the three enumerations (16×16 patches, 3×3 pooling, soft-token set) and record the recipe dependency in docs/TODO.txt.
S6. Description corrections (AGENTS.md:72-140).
- The orthogonality claim is contradicted by packing.rs:16-22 (see B1).
- The evidence bullet cites
Execution.persistent_workers(helios/proto/runtime_core.proto:739), which comes from #430 and is not in this diff. - "Existing cores … unaffected" is a process assurance with no check: state that Bracketed acceptance at core load is now narrower (patches_per_feature must be 4 or 9; model/packing.rs:92-97 calls tensor_layout during Inputs::new), and say which cores were swept.
- "Why" describes absences rather than the failing workflow: name the serve-time error without the profile (Helios cannot admit a Gemma 4 multimodal request) and without spans ("prefill splits an atomic image span", helios/src/model/packing.rs:624), and give the dataflow argument that makes the stride derivation model-agnostic.
- Say that no serving-path timing/memory was measured, and that the parity comparison does not run in a plain
cargo test.
S7. Regenerated Python bindings went backwards in generator version.
- ignition/preparation/runtime_core_pb2.py:5 "Protobuf Python Version: 7.36.2" → 7.36.1 and the ValidateProtobufRuntimeVersion minor arg 2 → 1, while pyproject.toml:34 pins "protobuf>=7.36.2,<8". Not a runtime break (the check rejects an older runtime, not an older gencode), but the checked-in artifact now records a generator older than the pin, and the description calls the change additive without mentioning it.
- Request: regenerate with the tree's pinned protoc (command documented in helios/manifest.md:465-472) so only the descriptor bytes change, or state the intended version change.
=== 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) ===
- Proto additions are additive and preserve wire ids: ImagePreparationKind::Gemma4 = 11 (contract.rs:68, runtime_core.proto:383-387), ImageSettings.gemma4 = 11 (runtime_core.proto:522), new Gemma4ImageSettings message (:535-542); decode/describe arms mirror PatchMerge (protobuf.rs:167-171, describe.rs:442-444); JSON uses deny_unknown_fields snake_case like neighbours (mod.rs:332-341).
- Envelope extraction from patch_merge::Processor is real de-duplication; Envelope::load keeps the token-uniqueness checks (patch_merge.rs:19-30) and expand keeps the one-token/marker-count checks (:38-57).
- gemma4 geometry arithmetic is self-consistent and overflow-guarded (checked_add/checked_mul/try_fold, gemma4.rs:103-129), resize reuses the shared resize::resize, and limits.check_batch/check_image_patches are applied on the new path.
- All non-Gemma widths and layouts are unchanged; no existing graph shape is resized.
- Wire compatibility direction: a core prepared on this branch is not readable by an older binary (expected), older cores still load.
#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
Bracketedpatch width is keyed onpatches_per_feature(packing.rs:16-22:4 => 1176,9 => 768). Patch width is3·patch_size²; DeepSeek already runs 9 patches per feature at 588 floats, so9 => 768is model identity inside shared packing — the patterndocs/design-review.md:38-52forbids. → Put the patch width in prepared metadata (e.g.VisionCapabilities.patch_size) and derivemerge_side = ppf.isqrt(),width = 3·patch_size².- The HF-parity evidence cannot fail. Both snapshot tests return silently without
FLARE_GEMMA4_TEST_SNAPSHOT/../.venv/bin/python(gemma4.rs:236-256, 281-283, 336-339), so "45 passed" is the same whether parity ran. → Check in atests/frontend/gemma4_images.jsonfixture + generator likeglm.rs:147-199, or#[ignore]both and report them as unrun. - Atomic spans are added in shared code with no test and no stated blast radius.
prompt.rs:137-151fires for any layout declaring anImageSpan, feedingvalidate_prompt_dataandset_prefill_spans; no fixture exercises it (gemma4_frontend.json:38has"image_tokens": null). → Emit the span inlayouts/bracketed.rsbeside the envelope (deepseek.rs:149pattern), delete the shared block, add a span-bearing Bracketed fixture/test.
Should Fix
Processor::loadaccepts settings the packer cannot represent (gemma4.rs:23-31allows anypatch_size ≤ 64,pooling ≤ 16): requirepooling² == limits.patches_per_featureand reject the rest at load, not per request.- Patch width authored three times (
packing.rs:19,conditioned.rs:192,gemma4.rs:116);conditioned.rs:191already shows the right pattern. → One shared constant/helper. - A 1,120-soft-token image (1,122-token envelope) cannot be prefilled atomically at small chunk sizes;
model.rs:421-423andscheduler.rs:1922-1930turn it into a failed request. → Reject or clamp at load, with a boundary test. - Ignition pins one vision tower (
frontend.py:126-129: 27 layers/1152 hidden/16 heads/…), so an identical-preprocessor checkpoint is rejected, and the charter asks for more than one checkpoint (#74). → Assert only consumed fields; take the tokens from the tokenizer; show a second checkpoint. - Docs left stale —
helios/README.md:702-704,docs/runtime-core-design.md:226-233,helios/model-contract.md:251-254all enumerate profiles and omit Gemma 4; the recipe dependency belongs indocs/TODO.txt.
Nits
runtime_core_pb2.py:5regenerated with 7.36.1 whilepyproject.toml:34pins>=7.36.2— regenerate with the tree's protoc.- The new
packing.rs:574-585test asserts the lookup table, not the behavior;bracketed()at 9 is untested, and aserialized_gemma4_profile_selects_only_image_preparationround-trip test (likeprotobuf.rs:726, :749) is missing.
#4 [high] Caveats and verified details for B1/B2/B3
Caveats to state honestly when presenting B1/B3 (verified this pass):
- B1: only PatchMerge/Minimax uses ImageLayoutKind::Bracketed in-tree today, always with patches_per_feature = 4 (helios/tests/message_boundaries.rs:479-495 sets patches_per_feature: 4 with patch_merge settings; layouts/bracketed.rs:104-180). So
9 => 768has exactly one consumer (Gemma 4) and the table is a de-facto single-model branch — which is the objection, not a live bug for other models. Step's patches_per_feature = 16 (helios/tests/tools/test_step_images.rs:82) is ImageLayoutKind::Step, untouched. - B2: glm.rs:147-199 is the reference pattern (include_str! fixture + SHA-256 of resized/pixels/positions; generator tests/frontend/generate_glm_image_fixtures.py). Confirmed the PR adds no tests/frontend/gemma4* fixture.
- B3: because model.rs:441-451 rejects any scoped image token that no span covers, a span-declaring layout that returned no spans previously failed prompt validation — so the new prompt.rs:137-151 block is likely a strict improvement for any such core, and possibly a no-op for every in-tree core except Gemma 4. Report it as "untested behaviour change in shared scheduling code with undisclosed blast radius", not as a proven regression. The requested fix (span in layouts/bracketed.rs + span-bearing fixture/test) is small.
- Envelope length: Envelope::expand pushes start_id + tokens image tokens + end_id (patch_merge.rs:58-69), and prompt.rs uses start..start+additional+1 with additional = tokens+1 (bracketed.rs:77-81), so the span is tokens+2 = 1,122 at max_soft_tokens 1,120. Two of the earlier lenses said 1,121; 1,122 is correct.
- prefill_chunk_size must be ≥64 and 64-aligned (scheduler.rs:67-73); a 1024 chunk cannot hold a 1,122-token envelope.
Execution.persistent_workerscomes from commit 66bf6d03 "Add Execution.persistent_workers green-context lifecycle (#430)", not this PR — confirms the description's stale evidence bullet.- AGENTS.md:57-59 confirms unrun checks/pending measurements go in docs/TODO.txt (existing entries at docs/TODO.txt:1-30 are in that style).
#5 [high] Amendments — severity framings for S3, B2, B1
Amendments after verification (use these framings in the report):
-
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.
-
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 testnever 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". -
B1 note: today
ImageLayoutKind::Bracketedhas exactly one in-tree producer (patch_merge / MiniMax M3, patches_per_feature = 4). The9 => 768arm 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.