#1 [high] should fix: patch_size/pooling_kernel_size are dead knobs; patch width duplicated 3x
Gemma4ImageSettings carries patch_size and pooling_kernel_size through proto (helios/proto/runtime_core.proto:535-542), Rust struct (helios/src/frontend/images/mod.rs:332-341), Python producer (ignition/preparation/frontend.py:113-137, which hard-codes 16/3 after _expected rejects anything else), and a validation in helios/src/frontend/images/gemma4.rs:23-44 (patch_size>0,<=64; pooling>0,<=16; SUPPORTED_SOFT_TOKENS allowlist).
Nothing else derives from them consistently:
- helios/src/frontend/images/conditioned.rs:192 hard-codes
Profile::Gemma4(_) => 768for the cached-image validity check, while gemma4.rs:116 computespatch_features = 3 * self.patch_size * self.patch_size. With patch_size != 16 (which load() accepts) valid_processed is always false -> every cached Gemma4 image is recomputed/invalidated silently. - helios/src/frontend/images/packing.rs:16-22 maps patches_per_feature 9 -> patch width 768 for the graph binding; a third copy of the same number.
Glm/padded-grid precedent: profile constants live in the module (glm.rs:13 const FACTOR: usize = 28). Fix: drop patch_size/pooling_kernel_size from the protobuf message, the settings struct, serde, and the Python producer; keep profile constants in gemma4.rs and one const FEATURES: usize = 3 * 16 * 16 used by conditioned.rs and packing.rs. Smaller diff, one source of truth, and removes the unreachable validation.
#2 [high] should fix: gemma4 envelope test shells out to Python for a chat template it never uses
helios/src/frontend/images/gemma4.rs:236-332 checkpoint_tokens_expand_the_image_envelope:
- requires FLARE_GEMMA4_TEST_SNAPSHOT, then bails silently if ../.venv/bin/python is missing;
- writes a temp jinja file (temp_dir + process id), spawns Python to call ignition.preparation.frontend.downloaded_template_asset on helios/tests/fixtures/templates/gemma4/chat_template.google.patch.json, hashes it, builds a Frontend with it, and removes the temp file only on the success path (early
returnat line 281-283 leaks it).
The assertions (lines 311-331) only exercise Envelope::expand with a prompt encoded by frontend.encode(...); chat-template rendering is never called. FrontendAssets.chat_template is an Option, so the whole subprocess block can go: load the tokenizer/tokenizer_config assets only, then encode "Look <|image|> now" and assert the envelope. Envelope::expand itself is already covered end to end by helios/src/frontend/images/layouts/bracketed.rs:104-180 (real rendered prompt, two images, feature order, start/end tokens, error on empty images) after this PR made both profiles share Envelope — so this test can shrink to a few lines or be dropped.
#8 [high] Report of 2026-11-25 (run 2): re-verified simplicity findings on head 2b4a31e
Review of PR #483 (simplicity lens, head 2b4a31e, rebased onto main 27716185)
Guidance: AGENTS.md:188-193 ("Do not add … configuration switches without a concrete requirement. Unsolicited formatting … are not contributions by themselves"), AGENTS.md:194-199 ("Tests must exercise the affected behavior or contract … Do not present scaffolding"), docs/design-review.md:16 ("Keep Helios as simple as possible").
Changes since my previous review (good, no finding): prompt.rs post-hoc span back-fill deleted and spans now emitted in layouts/bracketed.rs:52-88; conditioned.rs uses ImageProcessor::patch_features(); checked-in fixture tests/frontend/gemma4_images.json (8 cases) + generator; live tests marked #[ignore] with assertions instead of silent returns; unconditional pure-Rust Envelope test at patch_merge.rs:219-306; behavioral bracketed() test at packing.rs:604-692.
Findings this run
B1 (should fix) Dead patch_size/pooling_kernel_size. helios/proto/runtime_core.proto:596-603 keeps tags 1-2; helios/src/frontend/images/mod.rs:332-341 struct; gemma4.rs:18-19,26-39 stores/validates them (<=64, <=16); ignition/preparation/frontend.py:124-127 rejects everything but 16/3 and then writes patch_size=16, pooling_kernel_size=3 literally (frontend.py:167-172). No exported core can carry another pair, and only patch_size feeds anything (gemma4.rs:55 patch_features, :62 side_multiple, :67/:74 geometry). Smaller: profile constants const PATCH: usize = 16; const POOLING: usize = 3; const FEATURES: usize = 3*PATCH*PATCH; as glm.rs:13 does (const FACTOR: usize = 28), delete both proto fields (reserve 1,2 per AGENTS.md:431-444) and the >64/>16/nonzero validation arms. Also removes the duplicated allowlist: gemma4.rs:13 SUPPORTED_SOFT_TOKENS == frontend.py:132 tuple.
B2 (should fix) Helios/src/frontend/images/gemma4.rs:374-447 checkpoint_tokens_expand_the_image_envelope is #[ignore]d yet still writes a Jinja template to temp_dir (:394-402) and builds chat_template: Some(...) (:408) that the test never renders — FrontendAssets.chat_template is Option (frontend/mod.rs:99) and Default::default() template defaults are fine. Envelope::expand for two marker sets is now covered unconditionally by patch_merge.rs:219-306. Delete the template block (keep tokenizer loads + the four asserts) or delete the test: ~40 lines, and one cross-language fixture dependency.
B3 (should fix) helios/src/frontend/images/gemma4.rs:449-533 native_pixels_and_positions_match_the_checkpoint_processor is now #[ignore]d AND fully superseded: its three cases (91x37, 10x3000, 3000x10) are fixture cases seeds 1, 5, 6 in tests/frontend/gemma4_images.json:144-160,208-234, which additionally hash the resized RGB and cover max_soft_tokens=1120 (generator tests/frontend/generate_gemma4_image_fixtures.py:31-40). Delete the test: ~85 lines (struct-packing stdout protocol, pixel_offset=32 arithmetic, two element-by-element loops).
B4 (should fix) helios/src/frontend/images/gemma4.rs:335-354 geometry_matches_the_hugging_face_processor is a 9-row table whose 7 rows (1x1, 91x37, 672x672, 1008x672, 1920x1080, 10x3000, 3000x10) are asserted from the fixture at gemma4.rs:288-302. Shrink to the two rows the fixture does not carry ((100,3000), (3000,100)) or drop the test.
N1 (nit) helios/src/server/config.rs:449-455 and :456-464 are two overlapping patch-width checks: for Bracketed (the only layout that defines patch_features) bracketed_patch_features returns vision.patch_features when nonzero, so the second check already fires on any mismatch and the first is unreachable-except-for-a-second-error-message. Keep the Bracketed check (it also covers the legacy 0) and drop :449-455, or fold the 0-default into the first.
N2 (nit) helios/src/frontend/images/packing.rs:501 h % merge_side != 0 || w % merge_side != 0 is implied by gemma4.rs:62-99 (side_multiple) and by MiniMax's patches.rs:36-48 round-to-patch*MERGE; the neighbouring identity :503 (tokens*ppf == patches) already ties the grid to the merge. Keeping only :503 lets square_merge_side's merge side go unused in bracketed (still used at :50).
N3 (nit) helios/src/model/prompt.rs:52-65 passes a precomputed atomic_spans: bool into layouts/bracketed.rs:18-24 and refreshes it per call; bracketed already receives nothing else from the contract. Passing &FrontendContract/Option<&ImageSpan> keeps the derivation next to its only use.
N4 (nit) helios/src/frontend/images/packing.rs:695-824 the 130-line cross-profile table mostly repeats 0 patch_features rows; the only interesting pair is Gemma4 (9, 768) and PatchMerge (4, 0 -> 1176). It asserts processor.patch_features() == tensor_layout(..) for every profile, which is the property worth keeping, but could be four rows (Qwen/PatchMerge/Gemma4/PaddedGrid) without losing a distinct behaviour.
Checked and fine
- patch_merge.rs:10-136 Envelope extraction is real de-duplication; Processor stays a thin wrapper.
- describe.rs:466-468 omits patch_features when 0 (keeps legacy JSON identical); protobuf.rs:165-170 + round-trip test at :812-864 is additive only.
- server/config.rs:465-488 envelope vs prefill_chunk_size / span.max_tokens checks are one block used by both limits, not a parallel path.
- model.rs:79
patch_features.is_multiple_of(3)is one clause, not a new validation layer.
#9 [high] Research summary
Reviewed PR #483 at head 2b4a31e (rebased onto main 27716185) through the simplicity lens, re-checking every finding from my previous review against the new code.
Most of my earlier findings were addressed and are dropped: the prompt.rs post-hoc span back-fill is gone (spans are now emitted in layouts/bracketed.rs, deepseek-style), conditioned.rs uses ImageProcessor::patch_features() instead of a hard-coded 768, the checked-in tests/frontend/gemma4_images.json fixture plus generator replaces the venv-dependent parity evidence, and the live snapshot tests are now #[ignore]d with real assertions.
What remains is recorded in scratchpad entry #8: four should-fix simplifications (the dead patch_size/pooling_kernel_size config pair that no exported core can vary and that duplicates the soft-token allowlist; and three test files — checkpoint_tokens_expand_the_image_envelope, native_pixels_and_positions_match_the_checkpoint_processor, geometry_matches_the_hugging_face_processor — that are now ignored or fixture-duplicated and can be deleted or shrunk by roughly 150 lines), plus four nits: the two overlapping patch-width checks in server/config.rs:449-464, the redundant h % merge_side grid check in packing.rs:501, the precomputed atomic_spans: bool threaded through prompt.rs into bracketed::prepare_input, and the 130-line cross-profile table in packing.rs that could be four rows. Nothing blocking; no GPU kernel code was touched by this PR.
#10 [high] Verdict framing for report of 2026-11-25, run 2 (PR #483, simplicity lens)
Verdict to state: no blocking findings; 4 should-fix simplifications; 4 nits. Image-preparation core is worth merging once the deletions are taken; nothing here is a correctness or security objection.
How to frame it:
- The rebase resolved three of my previous should-fix items outright and they should be named as resolved, not repeated: (a) model/prompt.rs post-hoc
data.spansback-fill deleted, spans now produced in helios/src/frontend/images/layouts/bracketed.rs:52-88 beside the expansion (the deepseek.rs:149 pattern I asked for), with theatomic_spansflag threaded from prompt.rs:52-65; (b) helios/src/frontend/images/conditioned.rs:187 now callsImageProcessor::patch_features()(mod.rs:459-471) instead of a hard-codedProfile::Gemma4(_) => 768, so cache validation cannot silently invalidate; (c) the venv-only parity evidence is replaced by tests/frontend/gemma4_images.json (8 cases, seeds 0-7,max_soft_tokens280 and 1120) + tests/frontend/generate_gemma4_image_fixtures.py, verified unconditionally at gemma4.rs:266-333, and the two live tests are now#[ignore]d with explicit assertions rather than silentreturns. - I previously asked for load-time validation; it exists but split across gemma4.rs:25-52 (pooling² == limits.patches_per_feature, soft-token budget) and server/config.rs:443-490 (patch width, envelope vs prefill_chunk_size and span.max_tokens). Keep it; only the double patch-width check is a nit.
- The remaining should-fix set is small and mechanical (~150-200 lines removed, no behaviour change for any existing core), so phrase it as "merge after these deletions", not "rework".
Verification limits to state honestly:
- This run was read-only: I read each changed function in context (gemma4.rs, packing.rs, conditioned.rs, patch_merge.rs, layouts/bracketed.rs, model/prompt.rs, model.rs, server/config.rs, runtime_core/{describe,protobuf}.rs, ignition/preparation/frontend.py, tests/) but did not execute
cargo testorpytest, so the PR's stated pass counts are unverified by me; nothing in my findings depends on them. - The orchestration packet says no CI checks ran on 2b4a31e, so the claimed 47/54/28/3-pass sets and the ignored-test runs are the author's evidence only.
- Two of my findings (deleting
patch_size/pooling_kernel_size; deleting the two ignored tests) are pure deletions whose safety follows from call sites I did read; the only thing a test would add is confirming the ignored tests are not the sole coverage of anything — I checked that by locating the replacements (fixture cases for geometry/pixels/positions, patch_merge.rs:219-306 for Envelope) rather than by running them.
#12 [high] Report of 2026-11-25, run 3 (head ab9a432) — simplicity lens
Review of PR #483 (simplicity lens, head ab9a432, base main 27716185)
Rules: AGENTS.md:188-193 (no configuration switches without a concrete requirement; formatting/comment churn is not a contribution); AGENTS.md:194-199 (tests must exercise the behaviour; no scaffolding presented as supported); docs/design-review.md:16 ("Keep Helios as simple as possible"); charter line 12 (model-agnostic runtime).
Verdict: should-fix issues only. No blockers. The author's polish commit removed most of the earlier simplicity debt; what remains is ~120 lines of unreachable configuration and duplicated test rows.
Resolved this round (do not re-raise)
native_pixels_and_positions_match_the_checkpoint_processoris gone (gemma4.rs is now 505 lines; tests end at 503). Its struct-packing IPC and hand-computedpixel_offsetwent with it.- The ignored envelope test's temp Jinja file is now
Drop-guarded (gemma4.rs:443-458), so the leak on the error path is fixed; the template itself is genuinely required (frontend/mod.rs:1036-1043rejectsPromptEncoder::Jinjawithout one). - The duplicate patch-width check in
server/config.rs:449-463is nowif Bracketed {…} else if patch_features != 0 {…}— one message per layout, no reachable overlap. - The fixture's
processor/modelblocks are now read:tests/preparation/test_frontend_gemma4.py:187-225feeds both back throughimage_settings, includingimage_token_id/boi_token_id/eoi_token_id. - The
h % merge_sideguard atpacking.rs:491is NOT redundant — author is right:h=2, w=9withpatches_per_feature=9satisfiestokens*9 == patchesbut is not a 3×3 tiling. Finding withdrawn. - New legacy core-load test exists (
helios/src/model/tests.rs:1277-1452) and does what I asked: stripspatch_featuresfrom contract JSON,Inputs::newaccepts 1176 buffer, rejects 768 buffer and non-square ppf.
Should fix
S1. patch_size / pooling_kernel_size are still unreachable wire knobs (3 copies of 768)
helios/proto/runtime_core.proto:599-600; helios/src/frontend/images/mod.rs:335-336; gemma4.rs:18-19,27-40,52-59; ignition/preparation/frontend.py:124-127,140-141,169-170.
No producer can emit anything but 16/3: frontend.py:124-127 and :140-141 reject every other pair and :169-170 writes the literals. So gemma4.rs:27-40 (the 1..=64 / 1..=16 caps) can never fire, and pooling only restates limits.patches_per_feature, already cross-checked at :52. The width 768 is still spelled three ways: computed at gemma4.rs:86, the legacy 1176 fallback at model.rs:74-80, and 3 * 16 * 16 in gemma4.rs:412. SUPPORTED_SOFT_TOKENS (gemma4.rs:13) still duplicates frontend.py:132 with no test tying them.
Smaller version (as glm.rs:13's const FACTOR: usize = 28): const PATCH: usize = 16; const POOLING: usize = 3; const FEATURES: usize = 3 * PATCH * PATCH;; reserve proto tags 1-2; drop the struct fields, serde keys, three validation arms and the two Python literals; keep one soft-token allowlist (prefer the Python one, preparation is where the checkpoint is rejected).
Author's counter (matches PatchMergeImageSettings.patch_size, which patch_merge.rs:92 also pins to 14) is the precedent, not a justification — that is the same defect in the neighbouring profile, and here the tags have never shipped.
Also gemma4.rs:164/177 are consistent already; no change needed there.
S2. geometry_matches_the_hugging_face_processor repeats 7 of its 9 fixture rows
helios/src/frontend/images/gemma4.rs:383-402. Rows (1,1), (672,672), (1008,672), (91,37), (1920,1080), (10,3000), (3000,10) are pinned, with tokens/patches/resize hash, by canonical_processor_pixels_positions_and_resize (gemma4.rs:314-381) from tests/frontend/gemma4_images.json:126-256. Only (100,3000) and (3000,100) are unique. Smaller: keep those two plus the tokens * 9 == patches invariant; delete the other seven rows (~10 lines) or the test.
S3. The new legacy-core test hand-builds 70 lines of manifest because testing::manifest cannot emit a Vision graph
helios/src/model/tests.rs:1343-1411 (build_manifest) vs helios/src/model/testing.rs:344-355, where GraphOperation::Vision falls into _ => unreachable!(); the shared fixture also fixes every ImageTensor binding to width 1 (testing.rs:259-275) and to Dtype::Int64 unless listed (:276-293).
Smaller: map GraphOperation::Vision => GraphKind::Vision in testing::manifest and let the test override the one vision_pixel_values buffer extent; the strides/bindings/input_frame_bytes arithmetic at tests.rs:1355-1409 is a verbatim copy of testing.rs:307-337,368-377. Saves ~60 lines and makes future vision-core tests possible; also removes the redundant local base_manifest rebuild at tests.rs:1450.
Nits
helios/src/frontend/images/packing.rs:685-814(~130 lines) still assertsprocessor.patch_features() == tensor_layout(..)with ten rows ofpatch_features: 0. Four rows (Gemma4 9/768, PatchMerge 4→1176, PaddedGrid 1200, one 588 or 1536) cover every distinct outcome. ~100 lines removable.helios/src/model/prompt.rs:52-65computes…span.is_some()as a bareboolandlayouts/bracketed.rs:23,58consumes it. PassingOption<&ImageSpan>puts the derivation beside its only use and removes a positional boolean.helios/src/frontend/images/gemma4.rs:404-420pixels_interleave_rgb_and_positions_are_xyrestates the 91×37 fixture case by hand (grid_thw [1,30,78],patches * 3 * 16 * 16); the fixture already pins pixels and positions by SHA-256 for that shape. Either delete it or keep only theposition_ids[grid_w] == [0,1]ordering assertion that the hash cannot express (worth keeping — say so if kept).
Checked and fine
Envelope(patch_merge.rs:11-136) is real de-duplication;bracketed's span emission (layouts/bracketed.rs:51-88) is one closure and one loop, matchingdeepseek.describe.rs:466-467omitspatch_featureswhen 0, so legacy describe JSON is unchanged;server/config.rs:443-489is one function, two independent bounds.model.rs:89patch_features.is_multiple_of(3)is one clause.packing.rs:39-46square_merge_side+bracketed_patch_featuresis the small version of the deleted lookup table.
Limits
Read-only review: no cargo/pytest run. Test-count claims are the author's. Live-checkpoint runs are outside CI.
#13 [high] Research summary
Reviewed PR #483 at head ab9a432 through the simplicity lens, re-checking every finding from my previous round against the new code and reading each changed function with its callers. Full report is scratchpad entry #12.
Verdict: should-fix issues only, no blockers. The author's polish commit removed most of the earlier debt: the superseded native_pixels_and_positions_match_the_checkpoint_processor test is deleted, the ignored envelope test's temp Jinja file is now Drop-guarded (and the template is genuinely required by Frontend::load), the duplicate patch-width check in server/config.rs is now a clean if/else-if, the fixture's processor/model blocks are consumed by the new test_checked_in_gemma4_fixture_provenance_matches_image_settings, and the requested legacy Bracketed core-load test exists at model/tests.rs:1277-1452. I also withdraw my earlier "redundant grid guard" nit — the author's h=2,w=9 counter-example is correct.
Three should-fix items remain: patch_size/pooling_kernel_size are still wire knobs no producer can vary (three unreachable validation arms plus a third spelling of 768 and a duplicated soft-token allowlist), the 9-row geometry table repeats 7 rows the checked-in fixture already pins by hash, and the new legacy-core test hand-builds ~70 lines of manifest that testing::manifest could emit if it mapped GraphOperation::Vision instead of unreachable!(). Three nits: the 130-line cross-profile table, the precomputed atomic_spans bool threaded across the layout boundary, and one test that restates a fixture case by hand.
#3 [medium] should fix: gemma4 parity test needs an unpinned local venv; use a checked-in fixture like glm
helios/src/frontend/images/gemma4.rs:334-415 spawns ../.venv/bin/python and from transformers.models.gemma4.image_processing_gemma4 import Gemma4ImageProcessor inside the test, returning silently when the venv is absent — so on CI it proves nothing and locally it depends on an unpinned installed transformers version. Every other profile's parity evidence is a checked-in fixture (tests/frontend/glm53_images.json used by glm.rs:147-199; qwen38_images.json for decoding_tests.rs:60-92; tests/frontend/generate_glm_image_fixtures.py as the generator). Fix: add tests/frontend/gemma4_images.json plus a generator script and compare hashes as glm.rs does; that drops the struct-packing stdout protocol (lines 340-354, 365-404, all the offset arithmetic) and keeps parity evidence available without a network/venv. Note the same file also duplicates geometry expectations between geometry_matches_the_hugging_face_processor (lines 197-216) and the parity test, and (10,3000)/(3000,10) cases are claimed in the PR as unit-only.
#4 [medium] should fix: prompt.rs spans back-fill duplicates what layouts already do
helios/src/model/prompt.rs:137-151:
if prepared.data.spans.is_empty()
&& config.contract.frontend.image_tokens.as_ref()
.and_then(|layout| layout.span.as_ref()).is_some()
{
prepared.data.spans = prepared.conditioned_inputs.iter().map(|i| i.token_span.clone()).collect();
}
This runs for every image layout with a declared span, not just Gemma4. Only two layouts declare one today: Deepseek (helios/src/frontend/images/layouts/deepseek.rs:149 already pushes spans, so is_empty() is false and this is dead for it) and Gemma4 (Bracketed + PatchMerge profile). So the condition can be simply "the layout declares a span" and the is_empty() guard — which silently prefers the layout's own spans over the conditioned inputs rather than validating that they agree — disappears. Better: assert prepared.data.spans.len() == prepared.conditioned_inputs.len() and return an error if both produced spans, so an overlap is a defect rather than a silent preference. Both are then checked by validate_prompt_data (helios/src/model.rs:436-451) anyway.
Simpler still: have the two layout producers that know about the span (bracketed.rs prepare_input, which already computes token_expansions/conditioning per image) fill data.spans there, exactly as deepseek.rs:149 does, and delete the whole post-hoc block in prompt.rs. That also puts Gemma4's span production next to the expansion that produces it instead of in shared code with a model-shaped condition.
#5 [medium] nits: redundant merge_side check, unrelated reformatting, weak packing test, duplicated soft-token allowlist
-
helios/src/frontend/images/packing.rs:16-22
bracketed_patch_geometry(patches_per_feature) -> (merge_side, patch_width)maps 4->(2,1176), 9->(3,768), else error. It is called fromtensor_layout(line 39-42, uses only the width) and frombracketed(line 480-481, uses both). Two things to trim:merge_sideis redundant:bracketedline 486 requiresh % merge_side == 0 && w % merge_side == 0where merge_side comes from the same patches_per_feature. That check is implied by the neighbouringh*w == geometry.patchesplustokens * patches_per_feature == patches(line 488) only for the merge grid, but the essential invariant (grid divisible by the pooling side) is the frontend's job: gemma4.rs:46-47side_multiple()already guarantees every resize target is a multiple of patch_size*pooling, and the profile's own geometry is the only producer. Keeping the shape check inside the Gemma4 profile (it already errors there) is the smaller version; the packing side can keep just thetokens * patches_per_feature == patchesidentity it had before.
-
packing.rs:494-502: the reformatting of the
staging.put("vision_pixel_values", ...)call from one long line to six is unrelated churn in an otherwise mechanical change (AGENTS.md "Reject unsupported … churn. Unsolicited formatting … are not contributions by themselves"). Same for thestaging.put(...)/flat_mapreshape; it obscures that the only real change is1176 -> patch_width. -
packing.rs:570-586: the new test asserts only that tensor_layout returns patches768 for patches_per_feature=9 and errors for 16. It does not exercise
bracketed()'s validation (theh % merge_sidepath, the tokensppf identity, the truncated-pixel error) even though the PR's headline claim is that Bracketed now supports 9. Since helios/src/frontend/images/packing.rs tests are#[cfg(test)]in-crate and ProcessedImages is constructible there, a bracketed(...) test with a 48x48 patch grid (grid_thw [1,48,48], patches 2304, tokens 256) and a rejected 47-row grid would prove the behaviour; the current one only proves a table lookup. -
helios/src/frontend/images/gemma4.rs:11
SUPPORTED_SOFT_TOKENS: [usize;5] = [70,140,280,560,1120]is duplicated in ignition/preparation/frontend.py:123if image.get("max_soft_tokens") not in (70, 140, 280, 560, 1120). Two allowlists in two languages where nothing else in the profile varies with the value (geometry derives everything from max_soft_tokens via max_patches()). Either keep the Python check and let Rust accept any positive value, or drop both and let geometry's own budget check be the guard; the duplicated list is the piece to delete. The Rust-side check cannot be exercised anyway once patch_size/pooling are constants (see entry 1) because the Python producer rejects other values first.
#14 [medium] Citation sheet for report of run 3 (head ab9a432)
Supplementary citations for entry #12 (simplicity lens, PR #483, head ab9a432).
S1 — dead wire knobs
- No producer can vary them: ignition/preparation/frontend.py:124-127 pins
patch_size: 16, pooling_kernel_size: 3in the processor gate; :140-141 pins the same pair invision_config; :169-170 writes both literals into the returnedgemma4dict. - Unreachable arms: gemma4.rs:27-33 (
patch_size1..=64), :34-40 (pooling1..=16). The only producer sends 16/3. poolingis otherwise redundant withlimits.patches_per_feature, cross-checked at gemma4.rs:52-60.- 768 spelled three ways: computed at gemma4.rs:86-88 (
3 * self.patch_size * self.patch_size); legacy fallback 1176 at helios/src/model.rs:72-80 (bracketed_patch_features); test literal3 * 16 * 16at gemma4.rs:412. - Duplicated allowlist: gemma4.rs:11-13
SUPPORTED_SOFT_TOKENS: [usize; 5]vs frontend.py:132not in (70, 140, 280, 560, 1120). No test ties them. - Precedent for constants: helios/src/frontend/images/glm.rs (const FACTOR: usize = 28) and patch_merge.rs:92 (
settings.patch_size != 14— the same defect in the neighbouring profile, so the author's "matches PatchMerge" argument is precedent not justification).
S2 — geometry table duplication
- gemma4.rs:383-402
geometry_matches_the_hugging_face_processor, nine rows. - Fixture-pinned rows (grid+tokens+patches+resize hash) in gemma4.rs:314-381 from tests/frontend/gemma4_images.json:126-256: (1,1) :127-142, (91,37) :143-158, (672,672) :159-174, (1008,672) :175-190, (1920,1080)280 :191-206, (10,3000) :207-222, (3000,10) :223-238.
- Unique to the table: (100,3000)→[1,273,9]/273 and (3000,100)→[1,9,273]/273 (gemma4.rs:392-393).
S3 — hand-built manifest in the new core-load test
- helios/src/model/tests.rs:1277-1452
legacy_bracketed_core_omitting_patch_features_loads_and_stages_1176_wide_pixels;build_manifestclosure at :1343-1411 (~70 lines). - Root cause: helios/src/model/testing.rs:344-355 maps GraphOperation→GraphKind with
_ => unreachable!(), soVisioncannot be emitted; :259-275 fixes ImageTensor bindings to width 1; :276-293 leaves them Int64. - Duplicated arithmetic: tests.rs:1355-1409 vs testing.rs:307-337 (strides/address/offsets) and :368-377 (input_bindings).
- Redundant reconstruction at tests.rs:1450 (
base_manifest = build_manifest(1176)immediately before use).
Remaining nits
- packing.rs:685-814 cross-profile table (~130 lines, ten
patch_features: 0rows); four rows cover every distinct outcome. - prompt.rs:52-65 passes
…span.is_some()asbool; consumed at layouts/bracketed.rs:23,58; test call sites passfalseat bracketed.rs:175 and :199. - gemma4.rs:404-420
pixels_interleave_rgb_and_positions_are_xyrestates the 91×37 fixture case; onlyposition_ids[grid_w] == [0,1](:415-418) is not expressible by the hash.
Resolved / withdrawn (verify, then do not re-raise)
native_*test deleted: gemma4.rs now ends at line 503-505 (file 505 lines), fixture test at :314-381 covers the same three shapes.- Temp Jinja leak: gemma4.rs:443-458
struct TempFile(PathBuf)+Drop,drop(template)at :469. Template still required by helios/src/frontend/mod.rs:1036-1043 ("Jinja prompt encoding requires a chat template asset"). - server/config.rs:443-489
validate_loaded_image_processor: oneif Bracketed {…} else if patch_features != 0 {…}— no reachable duplicate anymore. - Fixture blocks now read: tests/preparation/test_frontend_gemma4.py:187-225 replays
fixture["processor"]andfixture["model"]throughimage_settings(including image_token_id/boi_token_id/eoi_token_id at :193-195). - Grid guard withdrawn: packing.rs (bracketed)
h % merge_side != 0 || w % merge_side != 0is not implied bytokens * patches_per_feature == patches—h=2, w=9, ppf=9satisfies the identity but is not a 3×3 tiling. Author correct. - Envelope extraction (patch_merge.rs:11-136) and layout-owned spans (bracketed.rs:51-88) are the smaller designs; describe.rs:466-467 omits 0 so legacy describe JSON is byte-identical.
#6 [low] checked and fine: Envelope extraction, pb2 regeneration noise
No finding, for honesty in the report:
Envelopeextraction in helios/src/frontend/images/patch_merge.rs:10-81 is a real de-duplication (patch_merge.rs:123-131 and gemma4.rs:160-167 now share one expand). KeepingProcessoras a thin wrapper delegating toEnvelope(patch_merge.rs:83-131) is also right: callers in mod.rs:900-918 stay untouched.Profile::Gemma4(_) => 768in conditioned.rs, the describe.rs/protobuf.rs one-line arms, theImagePreparationKind::Gemma4 = 11enum addition are the minimum needed for wire compatibility (AGENTS.md model-core-compatibility section requires additive tags with preserved defaults).- ignition/preparation/runtime_core_pb2.py:1-30 is generated; the diff includes a Protobuf Python Version 7.36.1 vs 7.36.2 revert plus regenerated descriptor. Worth flagging as review noise only: the header now claims a compiler version older than main's, so whoever regenerates next will flip it back. Not a functional defect (ValidateProtobufRuntimeVersion accepts it).
- The Rust raster loop in gemma4.rs:135-152 (y/x/channel) and the f32 1/255 scaling are required by the checkpoint layout; no simpler form without a lookup table, which would be churn.
- gemma4.rs:95-101
resized_rgbhas no in-tree caller for this profile (only tests/tools/test_images.rs uses the generic path for qwen fixtures), but every other profile implements it and mod.rs dispatches on it sym.flag; keeping it is consistent, not bloat worth blocking.