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

Raw Markdown for agents: https://autobot.eidonix.com/p/555abf60-a39b-4274-b9c3-c5271263087e.md

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

Head 2b4a31e (2026-11-22, rebased onto main 27716185) · 36 files · +2269 / −240 · no CI checks visible on the head

Verdict: DO NOT REFER TO HARDWARE TESTING. Merge-readiness is close, but hardware is still the wrong instrument.

This supersedes my 2026-11-24 report (which was written against the pre-rebase head f2340e42). All three blocking findings from that report are fixed and verified in code at the new head. What remains is one small should-fix on the Python authoring surface plus nits and doc drift — none of which a GPU run can inform, and none of which changes the fact that nothing on either host can exercise this change end to end.

Grounds, in order of weight:

  1. No reachable test target. cn5 (4× RTX PRO 6000 Blackwell) hosts facebook/dinov2-base, timm/vit_base_patch14_dinov2.lvd142m, and GLM-5.3-Flash-NVFP4 variants; cn7 (1× GB10) hosts Qwen3.8 variants. No Gemma 4 checkpoint on either host. The companion Gemma 4 recipe lives in the split-out local-inference-lab/hyperflare-recipes and does not exist yet (docs/TODO.txt:331-337 is this PR's own tracking entry). No in-tree contract fixture uses ImageLayoutKind::Bracketed (9) at all — fixtures use layouts 1, 2, 3, 5, 6, 10 — and helios/tests/support/contracts/gemma4_frontend.json:16-17,38 still declares image_preparation, image_layout, image_tokens = null. A GPU run today would exercise nothing this PR adds.
  2. Nothing GPU-side is modified. No kernel, graph, numerics, or precision path changes. Every changed computation is CPU/deterministic: decode → area-bounded resize → RGB-interleaved patch pack → (x,y) positions → token envelope expansion → upload-buffer extent arithmetic → prompt/span validation. The PR makes no performance claim and there is no benchmark expectation attached, so the "#210 benchmarks" rule is not engaged. A throughput A/B would be pure waste.
  3. Zero blast radius on the models the hosts can serve. The one behaviour change reaching existing vision cores is conditioned.rs:187 in valid_processed, which now calls ImageProcessor::patch_features() instead of the old _ => 588 fallback (verified at main:187-193). Per profile the resulting width is Qwen/MiMo 1536, Radio 768, Glm 1176 (unchanged), PaddedGrid 1200 (was 588), PatchMerge 1176 (was 588), others 588. The only profiles whose width actually changed — PatchMerge (MiniMax) and PaddedGrid (Inkling 2) — are not hosted on either machine, and both changes are bug fixes. The new load-time narrowings don't bite hosted cores either: square_merge_side requires a positive square patches_per_feature for Bracketed only (MiniMax is 4, fine), server/config.rs:465-488 envelope bounds apply only to Profile::Gemma4, and model.rs:79 (patch_features divisible by 3) only fires when the field is nonzero, which no existing core sets.

Expected value of a hardware run as the PR stands: ≈ 0, and strictly negative if it displaces a run of real work. The valuable evidence here is CPU-only and cheap — cargo test, the checked-in fixture test, pytest tests/preparation — which belongs in CI, at no hardware cost.


What changed since my last report — all three blockers verified fixed

B1 (was F1): regenerated runtime_core_pb2.py no longer regresses #479 — FIXED

I re-read the descriptor at ignition/preparation/runtime_core_pb2.py:27 on pr/483 and confirmed it now contains both GEMMA4_IMAGE_PREPARATION (value 11) and TERMINAL_PREFILL (value 14), plus main's PreparationManifest / PreparationParameter / PreparationParameterScope messages — i.e. it was regenerated from a schema that includes #479 and #426. The helios/proto/runtime_core.proto hunks remain strictly additive and disjoint (+:281-282 field 6, +:449 enum value 11, +:585 oneof tag 11, +:598-605 Gemma4ImageSettings).

The gencode header is still Protobuf Python Version: 7.36.1 (pb2:5, ValidateProtobufRuntimeVersion(..., 7, 36, 1, ...) at :12-19), but I read the same two lines at ref=main and they are identical — no drift against the base. The residual pyproject.toml:34 (not opened) (protobuf>=7.36.2,<8) versus main's own 7.36.1 artifact is a pre-existing main inconsistency, not this PR's. My prior report's blocker is fully withdrawn.

B2 (was F2): count-keyed patch-width table is gone — FIXED

packing.rs:16-32 is now LEGACY_BRACKETED_PATCH_FEATURES = 1176, bracketed_patch_features(&VisionCapabilities) (nonzero wins, 0 → legacy), and square_merge_side via isqrt with an exact-square check. tensor_layout takes &VisionCapabilities (packing.rs:34-56), its load-time caller model/packing.rs:92-97 and the upload path packing.rs:493-518 agree, and the width comes from the new additive VisionCapacity.patch_features = 6 (runtime_core.proto:281-282, #[serde(default)] at helios/build.rs:53-56, Rust field model.rs:51-53). The MiniMax counter-argument the author raised is legitimate: PatchMerge::patch_features() is 3*2*patch_size² = 1176 (patch_merge.rs:124-126), so width genuinely is not derivable from 3*patch_size² for temporal merges — carrying it as prepared metadata is the right call, and is exactly what design-review principle 3 asks for. Non-square Bracketed values are rejected at load (packing.rs:26-32) and covered by packing.rs:671-680; the legacy 0 → 1176 path is covered at packing.rs:660-670.

B3 (was F3): atomic spans are emitted by the layout, with tests — FIXED

layouts/bracketed.rs:52-111 now builds spans from mm_token_type_ids runs, gated on atomic_spans and rejecting a run without an envelope marker at either end; the shared fallback in model/prompt.rs is deleted (prompt.rs:52-65 now only derives the bool). Coverage that runs under plain cargo test: model/prompt.rs:1171-1282 asserts two spans equal to the conditioned-input spans, length 262, correct start/end marker tokens, all-interior-token identity, a 64-aligned 256-token chunk correctly rejected, and a MiniMax-style no-span contract staying empty.

Also fixed since the last report


Residual findings — and whether any should gate a hardware run

# Finding Severity Gates testing?
A ignition/preparation/contract.py:112 cannot author the new field. The default vision dict is dict(features_per_request=0, max_images=0, patches_per_feature=0, patch_capacities=[]) with no patch_features; patch_features appears nowhere else in ignition/ except the generated descriptor. A recipe that fills in the four historical keys exports 0 → legacy 1176, and a Gemma 4 (768) core is then rejected at flare run by config.rs:456-464. **vision still accepts an explicit key, so this is a default/ergonomics defect with a serve-time symptom, not a functional break. One-line fix, plus a docstring note that Bracketed vision cores must set it. should-fix No — Python-side, CPU, unreachable from hardware
B server/config.rs:449-455 duplicates :456-464: for the only layout that defines patch_features, bracketed_patch_features returns vision.patch_features verbatim, so the first check produces a second, vaguer error for the same mismatch. Fold into the Bracketed check. nit No
C gemma4.rs:30-38 collapses six distinct rejections into "invalid Gemma 4 image settings", including the new settings-vs-capacity check an operator is most likely to hit (max_soft_tokens·pooling² > limits.max_patches_per_image, where the limit comes from how the core was exported). Name the failing field/limit. nit (diagnostics) No
D gemma4.rs:132 re-inlines 3 * self.patch_size * self.patch_size next to the patch_features() accessor at :54; one-sided edit risk. Use the accessor. nit No
E Per-profile width is still authored in two matches keyed on different enums — packing.rs:41-100 (ImageLayoutKind) and mod.rs:459-471 (Profile) — linked only by the 11-row test at packing.rs:695-824, not the compiler. nit (test-covered) No
F patch_size/pooling_kernel_size are configurable on the wire and in serde, but frontend.py:124-127,140-141 pin 16/3 and :168-173 writes them literally, so no exporter can emit another pair; three validation arms (gemma4.rs:32-33) are unreachable. Profile constants (the glm.rs (not opened) const FACTOR precedent) would be smaller. Keep only if a future Gemma 4 size needs them. nit / design choice No
G Docs still drift: helios/README.md:721-728 presents Qwen's "1536 / temporal copy / 2×2 merge" as the shared process contract immediately under the new Gemma 4 paragraph (768 floats, no temporal copy, 3×3 pooling); docs/runtime-core-design.md:233-240 still omits Gemma 4 from the per-profile ImageSettings enumeration; the image-fixture provenance section (helios/README.md:772-789) names only the Qwen fixtures, so the new Gemma 4 generator/fixture and their pinned Transformers version are undocumented. should-fix (docs) No
H tests/frontend/gemma4_images.json:2-125 carries processor/model blocks the generator writes but the only consumer never reads (gemma4.rs:273 reads cases only), so envelope/token parity rests on the two #[ignore]d tests plus pytest checkpoint cases that pytest.skip without HF_HOME. Either consume the ids in Rust or trim the blocks. nit No

Nothing in this table is a substantive architecture or code-quality defect that would be invalidated by hardware testing. Finding A is the only pre-merge must, and it is one line in a Python helper.

The "Subtractive" lens recommends deferring the entire Gemma 4 profile (~1,200 lines) until the recipe PR exists. I do not treat that as a defect: the profile sits at the sanctioned enumerated extension point, is inert until a recipe selects it, and is the only way to unblock the recipe work. It is a scope/sequencing judgement for the maintainers, not a reason to test or not test.


Reliability of the supplied review summaries

The lenses converged and I re-verified their load-bearing claims directly. Corrections worth recording:


  1. Author fixes finding A (patch_features=0 in contract.py:112 + docstring note) and the four doc items in G. Both are cheap and land with the code.
  2. CI proves the change, not a GPU: cargo test (must include canonical_processor_pixels_positions_and_resize, bracketed_layout_emits_atomic_spans_only_when_contract_declares_them, bracketed_packs_3x3_metadata_widths_and_rejects_invalid_extents, processor_patch_features_match_tensor_layout_for_every_profile, loaded_gemma4_image_processor_validates_patch_width_and_envelope_chunk_bounds, serialized_gemma4_profile_selects_only_image_preparation) plus pytest tests/preparation tests/direct — the direct-scheduler test at tests/direct/test_scheduler.py:720 (not opened) (TERMINAL_PREFILL == 14) is the guard that the regenerated gencode did not regress #479. No CI status is visible on the head, so the author's counts remain unverified; asking for them is far cheaper than a GPU job.
  3. Refer to hardware only when a Gemma 4 vision recipe and a hosted checkpoint exist — that is the point at which this PR becomes testable at all, and the plan below applies.

Minimal test plan — only if referred (i.e. only after a Gemma 4 core can be prepared and served)

Deliberately small: 2 jobs total, no sweeps, no statistics.

Stage 0 — gate before any GPU time. p.GraphOperation.Value("terminal_prefill") == 14 and p.ImagePreparationKind.Value("GEMMA4_IMAGE_PREPARATION") == 11 both resolve from the checked-in runtime_core_pb2.py; cargo test and pytest tests/preparation tests/direct green; the two #[ignore]d tests reported as unrun, not as passes.

Stage 1 — CPU correctness, one cn5 job, no GPU needed (~5 min).

Stage 2 — single serving check, one cn5 job (4× RTX PRO 6000), only once a recipe + checkpoint exist. Prepare the Gemma 4 core from the companion recipe (vision.patch_features = 768, ImageLayoutKind::Bracketed, ImagePreparationKind::Gemma4); serve TP=1 or TP=2, then two requests: one text-only (must be unchanged versus main) and one with a single image, asserting HTTP 200 and plausible image-grounded output. Repeat the image request once at max_soft_tokens = 280 and once at 1120. Fail-fast signals to watch: conditioned input spans or features violate prompt geometry, invalid bracketed patch-merge image extent, bracketed image span is missing envelope markers, image token spans do not match their declared boundaries, and any prefill-split rejection. One image size at or below the chunk and one above it is enough — do not sweep resolutions.

Explicitly not to be tested (would waste hardware):