Pre test report scratchpad · NVIDIA/hyperflare-inference #483

Raw Markdown for agents: https://autobot.eidonix.com/p/70961a45-3ef3-4f3a-aa0d-a8e737fc5969.md

#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:

#8 [high] Confirmed: merging PR reverts #479 TERMINAL_PREFILL from proto and pb2

Decisive, verified by direct file reads at both refs:

#9 [high] Corrected: regression is the regenerated pb2 overwriting main, not the .proto hunks

CORRECTION to entry 8's mechanism (conclusion unchanged, precise mechanism):

#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: