#1 [high] Merge blocker: PR pb2 drops TERMINAL_PREFILL and downgrades gencode
Verified: on pr/483 head, TERMINAL_PREFILL has zero matches anywhere in the tree (search_code pattern TERMINAL_PREFILL on ref pr/483 → no matches), including helios/proto/runtime_core.proto (line 337-339 ends after SCORED_PREFILL = 12) and ignition/preparation/runtime_core_pb2.py.
On main: helios/proto/runtime_core.proto:338 TERMINAL_PREFILL = 14; (from #479, commit e091689b, Nov 23 "optional TerminalPrefill"), ignition/preparation/contract.py:29 lists "terminal_prefill", and runtime_core_pb2.py descriptor blob contains it (search matched main pb2).
The PR diff to runtime_core_pb2.py is +122/−120 and replaces the whole serialized descriptor; it does not touch contract.py (unchanged by PR), so a merge yields main's contract.py calling p.GraphOperation.Value("terminal_prefill") (contract.py:82) against a binding with no such enum value → preparation of any core with terminal_prefill graphs fails. tests/direct/test_scheduler.py:720 on main asserts p.TERMINAL_PREFILL == 14 → AttributeError.
Also header regressed Protobuf Python Version: 7.36.2 → 7.36.1 and ValidateProtobufRuntimeVersion arg 2→1 (pb2:5, :16) while pyproject.toml:34 pins protobuf>=7.36.2,<8; regeneration command is helios/manifest.md:468-471.
Base commit is 6d6fe0c6; PR head f2340e42 dated Nov 22, older than #479. Branch is stale.
#2 [high] No hardware-reachable path: no Gemma 4 checkpoint or recipe
Hardware: cn5 (4× RTX PRO 6000 Blackwell, amd64) has facebook/dinov2-base, local-inference-lab/GLM-5.3-Flash-NVFP4, nvidia/GLM-5.3-Flash-NVFP4, timm/vit_base_patch14_dinov2.lvd142m. cn7 (1× GB10, arm64) has incoai/Qwen3.8-27B-DFlash2, nvidia/Qwen3.8-27B-NVFP4, nvidia/Qwen3.8-Flash-Next-FP4-Local. No Gemma 4 checkpoint on either host.
No in-tree recipe selects the profile: search_code gemma-4|gemma4 over ignition/ returns only ignition/preparation/frontend.py:113-137 and the pb2 blob — no recipe registries (recipes were split out per commit 17bb3c4a/da037284 "Remove extracted hyperflare_recipes ... from core Flare"). helios/tests/support/contracts/gemma4_frontend.json:16-17,38 has image_preparation/image_layout/image_tokens all null.
So serving a Gemma 4 vision request requires a companion PR in local-inference-lab/hyperflare-recipes plus a checkpoint download that is not on the hardware. The changed logic (resize/patch interleave/positions/envelope/packing widths) is CPU-side and deterministically testable without a GPU.
#3 [high] Should-fix: count-keyed patch width table in shared packing
helios/src/frontend/images/packing.rs:16-22:
fn bracketed_patch_geometry(patches_per_feature: usize) -> Result<(i64, usize)> {
match patches_per_feature { 4 => Ok((2, 1176)), 9 => Ok((3, 768)), _ => Err(...) }
}
Patch width is 3patch_size^2 (16→768), a vision-tower property; patches_per_feature is a merge factor. Key is ambiguous in-tree: DeepSeek uses ppf=9 with 588 floats/patch (packing.rs:32-34 Deepseek arm → patches588; helios/tests/support/contracts/deepseek4.json:9 "patches_per_feature": 9). So 9→768 is model identity in a geometry name.
Three copies of 768: packing.rs:19, conditioned.rs:192 (Profile::Gemma4(_) => 768, used by valid_processed cache predicate), gemma4.rs:116 (3*self.patch_size*self.patch_size).
Load-time behavior change: model/packing.rs:92-97 calls tensor_layout from Packing::new during core load with config.contract.vision.patches_per_feature; before this PR Bracketed was fixed 2×1176. Any core declaring Bracketed with ppf != 4 or 9 now fails at load; with ppf=9 and 588-wide patches it would be silently mis-strided. Note gemma4::Processor::load (gemma4.rs:23-44) accepts any patch_size 1..=64 / pooling 1..=16, so profile/contract can disagree (e.g. patch_size=14,ppf=4 → load OK, packing slices 1176 stride over 588-float patches).
Mitigation check: class_token still asserts ppf==4 (packing.rs:527). Prompt validation cross-checks tokens*ppf==patches (prompt.rs:171, packing.rs:488).
#4 [high] Should-fix: untested shared-behaviour span fill in prompt.rs
helios/src/model/prompt.rs:137-151 (new, +15 lines) fills prepared.data.spans from conditioned_inputs token spans when prepared.data.spans.is_empty() AND config.contract.frontend.image_tokens.span is Some.
This is profile-independent shared code, not Gemma-4-only: consumers are validate_prompt_data (model.rs:420-454) and Scheduler::set_prefill_spans, i.e. it converts an image envelope into an unsplittable prefill unit.
Precedent is the layout owning spans: layouts/deepseek.rs:149 pushes spans beside tokens.extend; Bracketed's layouts/bracketed.rs:82-91 returns PromptData{vision_token_indices, ..Default::default()} (empty spans) and conditioned_inputs: vec![].
Coverage: zero. gemma4_frontend.json image_tokens is null (line 38); in-tree span fixture only deepseek4.json:56 and the synthetic spans at prompt.rs:481-487,699 (Deepseek/DeepseekRowMajor only). search_code spans|span over prompt.rs shows no new test for lines 137-151.
Known-affected existing cores: none demonstrated in-tree — no in-tree contract declares image_layout Bracketed with a non-null image_tokens (deepseek4.json image_layout 3 = Deepseek; mimo 2; qwen 1; step 5; nemotron 6; inkling 10). Minimax patch_merge fixtures are the patch_merge profile, not Bracketed. So blast radius is a recipe-repo question, unresolved.
Secondary: envelope span = max_soft_tokens+1 (gemma4.rs:11 allows 1120 → 1121) vs validate_prompt_data rejecting len > prefill_chunk_size (model.rs:422) and scheduler set_prefill_spans capacity check. Default prefill_chunk_size is 4096 (server/config.rs:149) so the default is safe; a smaller chunk is not.
#5 [high] Parity evidence is silent-skip only; no CI on head
gemma4.rs:236-334 checkpoint_tokens_expand_the_image_envelope and gemma4.rs:334-415 native_pixels_and_positions_match_the_checkpoint_processor both return early and silently:
- :238-244 needs FLARE_GEMMA4_TEST_SNAPSHOT + tokenizer.json; :253-256 needs ../.venv/bin/python; :281-283 returns if the template subprocess fails.
- :336-339 needs ../.venv/bin/python.
A silent return counts as a pass, so the description's "45 passed ... including Hugging Face checkpoint pixel/position parity" is not reproducible from the PR; no CI checks run on head f2340e4.
Parity inputs are synthetic
(x % 256) as u8rasters at 91×37, 10×3000, 3000×10 (gemma4.rs:355, 378-383) — not real photographs. geometry_matches_the_hugging_face_processor (gemma4.rs:197-216) is a hardcoded expected table, not a live comparison. The envelope test also spawns Python to build a chat template it never renders and leaks the temp file on the :281-283 return path; existing accessor crate::template_fixtures::template("gemma4", "chat_template.google") is used at jinja/tests.rs:274,822. What IS deterministically covered without any env: geometry table, pixel/position interleave (pixels_interleave_rgb_and_positions_are_xy, gemma4.rs:218-234), packing.rs:574-586 tensor_layout table test (asserts the literal mapping, not the property).
#8 [high] Confirmed: merging PR reverts #479 TERMINAL_PREFILL from proto and pb2
Decisive, verified by direct file reads at both refs:
- pr/483 helios/proto/runtime_core.proto:325-339 → GRAPH_OPERATION_UNSPECIFIED=0, INIT..MIXED=1..9, reserved 10,11,13, SCORED_PREFILL=12, then closing } at 339. No TERMINAL_PREFILL.
- main helios/proto/runtime_core.proto:337-339 → SCORED_PREFILL = 12; TERMINAL_PREFILL = 14; }.
- search_code TERMINAL_PREFILL on ref pr/483 across whole repo → No matches (also none in ignition/, tests/, helios/src/).
- main: helios/proto/runtime_core.proto:338, ignition/preparation/contract.py:29 ("terminal_prefill" accepted kind), tests/direct/test_scheduler.py:720 (
p.TERMINAL_PREFILL == 14). Conclusion: the PR branch predates #479 (merged e091689b, Nov 23, 2026; PR head f2340e42 dated Nov 22, base 6d6fe0c6). Merging the PR as written reverts TERMINAL_PREFILL from the .proto and ships a pb2 without it, so contract.py:82p.GraphOperation.Value("terminal_prefill")and tests/direct/test_scheduler.py:720 break. This is an outright regression of a just-merged feature and must be rebased/regenerated, not tested on hardware.
#9 [high] Corrected: regression is the regenerated pb2 overwriting main, not the .proto hunks
CORRECTION to entry 8's mechanism (conclusion unchanged, precise mechanism):
- pr/483 .proto text (verified: runtime_core.proto:325-339 on pr/483) has no TERMINAL_PREFILL because base 6d6fe0c6 predates #479 (merged e091689b, Nov 23). main :337-339 has SCORED_PREFILL=12; TERMINAL_PREFILL=14.
- The PR's .proto diff is +10/−0 in disjoint hunks (enum value 11 near line 386, oneof tag 11 near 522, new message near 535), so at merge git combines both changes and the merged .proto DOES retain TERMINAL_PREFILL = 14. The .proto is not the regression.
- The regression is the checked-in artifact: runtime_core_pb2.py is regenerated wholesale (+122/−120, entire serialized descriptor replaced from the stale schema), so on merge main's descriptor (containing TERMINAL_PREFILL) is overwritten by one without it. Result: checked-in pb2 disagrees with the schema, and with unchanged consumers ignition/preparation/contract.py:29+82 (
p.GraphOperation.Value("terminal_prefill")) and tests/direct/test_scheduler.py:720 (p.TERMINAL_PREFILL == 14) → AttributeError / ValueError at preparation and in the direct scheduler test. - Compounded by the gencode header regression 7.36.2 → 7.36.1 (pb2:5, :16) against pyproject.toml:34
protobuf>=7.36.2,<8; regen command helios/manifest.md:468-471. - Fix: rebase onto main and regenerate with the pinned protoc; the correct artifact then contains both GEMMA4_IMAGE_PREPARATION and TERMINAL_PREFILL at 7.36.2.
#6 [medium] Preparation gaps: single-checkpoint pin, unchecked token strings, no pytest
ignition/preparation/frontend.py:113-137 (new gemma4 branch): pins processor_class Gemma4Processor, image_processor type/patch_size 16/pooling 3/do_resize/do_rescale/do_normalize False/mean 0/std 1, optional resample 3/rescale_factor 1/255/do_convert_rgb, max_soft_tokens in (70,140,280,560,1120), and vision_config {gemma4_vision, 16, 3, 27 layers, 1152 hidden, 16 heads, head_dim 72, 4304 FFN}. Returns hardcoded tokens "<|image|>", "<|image>", "<image|>" with no check that each encodes to exactly one added token (contrast _native_image_placeholder at frontend.py:231-245 which does that for DeepSeek).
Docs (repo lists all five Gemma 4 variants): docs/model-preparation.md:345 (gemma-4-e2b/e4b/12b/26b-a4b/31b + NVFP4); docs/api.md:749 links the 26B-A4B-it card; docs/model-development.md:79-83 covers e2b-e4b and 26B-A4B templates. So the vision-tower pin excluding 26B-A4B (and #74 more-than-one-checkpoint rule) is a real charter gap, but a doc/preparation-guard issue, not a hardware-testable runtime defect.
No pytest for image_settings(profile="gemma4"): search_code gemma4 over tests/ → no matches.
Shared constant duplicated: SUPPORTED_SOFT_TOKENS gemma4.rs:11 vs frontend.py:123.
#7 [medium] Checked clean and lower-severity items
Checked clean / lower severity:
- Proto additions additive: GEMMA4_IMAGE_PREPARATION = 11 appended (runtime_core.proto:386), ImageSettings.gemma4 tag 11 (:522), new message :535-542; ImageLayoutKind untouched. Rust: contract.rs:68 Gemma4 = 11 appended; protobuf.rs:167-171 decode arm; describe.rs:442-444. No existing tag renumbered.
- Envelope extraction (patch_merge.rs:10-81 Envelope + thin Processor wrapper :83-129) preserves the old validation (empty/duplicate marker checks moved verbatim; error text changed to "invalid image envelope tokens") and expand_prompt delegates. Genuine de-duplication, not churn.
- gemma4.rs geometry is self-consistent: checked_mul/checked_add/try_fold for overflow (:109-122), check_batch before/after geometry, degenerate-side clamps return a named error (:65-76), tokens = patches/(pooling^2) by construction, area bound :77-81.
- resize::resize reuse (uint8 antialiased bicubic) matches patch_merge/qwen — no new kernel.
- rerun: prewarm/gemma4 profile naming in describe.rs:442 mirrors other arms.
- Docs not updated (helios/README.md image-profile list, docs/runtime-core-design.md image settings, helios/model-contract.md) — doc-only, does not gate hardware testing.
- Nits: packing.rs:494-502 reformatting churn, redundant h%merge_side check (:486), duplicated soft-token list, Envelope doc comment self-referential, no protobuf round-trip test for tag 11 (precedents protobuf.rs:726,749).