Prose report · NVIDIA/hyperflare-inference #483

Raw Markdown for agents: https://autobot.eidonix.com/p/cb452683-9618-46e7-8a91-65cab5dda8c5.md

Prose review — PR #483, "Add Gemma 4 image preparation, Bracketed patch-width metadata, and atomic spans"

Head 2b4a31e against main 27716185; 36 files, +2269/−240. Judged against AGENTS.md:43-70 (required prose review), AGENTS.md:72-140 (required PR description), and .agents/skills/repo-prose/SKILL.md:26-46 (not opened).

Key findings

The description now satisfies the four mandatory parts in order (why / what changed / claimed result / evidence) and the earlier round's blocking defects are genuinely fixed: the Hugging Face comparison tests are #[ignore]d with hard assertions instead of silently returning, an unconditional checked-in fixture test backs the bit-exactness claim, atomic-span emission moved into the layout with span-bearing/too-small-chunk/no-span coverage, the load-path narrowings are disclosed, and the docs gained the Gemma 4 paragraph, patch_features documentation, and the docs/TODO.txt qualification entry.

What remains is documentation drift and precision, not incorrect claims:

  1. helios/README.md:721-728 contradicts the Gemma 4 paragraph immediately above it (should fix).
  2. docs/runtime-core-design.md:233-240 still omits Gemma 4 from the per-profile image-settings enumeration (should fix).
  3. The new Gemma 4 fixtures are undocumented in the fixture-provenance section that documents the Qwen equivalents (should fix).
  4. The description's reproduction command uses a placeholder path and omits required inputs (should fix, AGENTS.md:110-112).
  5. Five nits on code prose, error text, and description wording.

Nothing here claims a result the code does not support; the code-prose findings are about messages and comments that under-explain or mis-describe their checks.


1. Documentation (should fix)

1.1 helios/README.md:721-728 contradicts the Gemma 4 paragraph above it

:713-719 correctly documents the new profile:

The Gemma 4 processor uses area-bounded RGB8 bicubic-antialias resize to multiples of patch_size * pooling_kernel_size (48 px for 16×16 patches and 3×3 pooling), packs interleaved (y, x, channel) float32 patch vectors of width 3 * patch_size² (768) scaled by 1/255, emits [x, y] patch coordinates, and reuses the bracketed start/feature/end token envelope; when the prepared contract declares image_tokens.span, the bracketed layout emits atomic spans covering each envelope.

The next paragraph then states, with no qualification:

process produces packed pixel_values[N,1536] float32 ... Patch features are ordered by channel, temporal copy, pixel row, and pixel column; patches are ordered by 2×2 spatial merge blocks. (:721-725)

Three of those clauses are false for the profile documented three lines earlier: 768 not 1536 floats per patch, no temporal copy, and 3×3 not 2×2 merge. A reader of the "Native image preparation" section (which now opens at :703-709 with "Profiles cover Qwen, MiMo, patch-merge, DeepSeek, DeepSeek row-major, Moonvit, Step, RADIO, GLM, padded-grid, and Gemma 4 inputs") will take :721-728 as the shared process contract. AGENTS.md:52-56 requires documents to state support as present qualification; SKILL.md:26-29 requires documentation to be a present-state specification rather than layered history.

Fix: scope the paragraph — "For the Qwen and MiMo profiles, process produces ..." — and state the per-profile width through ImageProcessor::patch_features() rather than only the Qwen number.

1.2 docs/runtime-core-design.md:233-240 omits the new preparation kind

FrontendSettings contains EOS token IDs, the special-token strings used by the chat template, and optional image settings. Qwen image settings contain resize area limits, learned-position geometry, and image/video token IDs. MiMo image settings contain resize limits and channel normalization. DeepSeek's image profile has fixed geometry validated by Ignition.

This is the one place that tells a reader what each preparation kind consumes from ImageSettings. The PR adds a new oneof variant (ImageSettings.profile = 11, helios/proto/runtime_core.proto) and a new ImagePreparationKind tag, and the enumeration does not mention Gemma 4's patch_size, pooling_kernel_size, max_soft_tokens, or image/start/end envelope tokens, nor that Bracketed now derives its patch width from VisionCapacity.patch_features. The patch_features field itself is documented at :181-197, so the omission is local to this enumeration. Not documenting a served profile reads as "unsupported", which the docs/TODO.txt:331-338 entry contradicts.

Fix: add one clause to the enumeration naming the Gemma 4 settings and the pooling-derives-merge-stride relationship. (Padded-grid and PatchMerge are similarly absent, but that gap predates this PR; the new kind belongs here.)

1.3 The new fixtures have no provenance record (helios/README.md:772-789)

The fixture section explains exactly how image fixtures are produced and trusted:

Image fixtures in tests/frontend/qwen38_images.json (not opened) pin Transformers 4cc2aa84301c9aa210b5513dab9fefae03981f6e, PyTorch 2.13.0+cu130, Torchvision 0.28.0+cu130, Pillow 12.3.0, and all checkpoint asset hashes. ... SHA256 checks compare every resized RGB byte and every little-endian float/integer tensor byte, with no numerical tolerance. ... .venv/bin/python tests/frontend/generate_image_fixtures.py (not opened) "$SNAPSHOT" tests/frontend/qwen38_images.json (not opened) ...

It names only the Qwen fixtures and generator. This PR's headline parity claim rests on tests/frontend/gemma4_images.json (8 cases, max_soft_tokens 280 and 1120) generated by tests/frontend/generate_gemma4_image_fixtures.py and consumed unconditionally by canonical_processor_pixels_positions_and_resize at helios/src/frontend/images/gemma4.rs:266-333. gemma4_images.json and generate_gemma4_image_fixtures.py appear in no document — the only reference anywhere in the tree is the include_str! at gemma4.rs:270. The generator depends on a snapshot's processor_config.json (not opened) and config.json (not opened) (generate_gemma4_image_fixtures.py:27-29) and on a Transformers version that ships Gemma4ImageProcessor (:14), none of which is pinned anywhere a reader can find.

AGENTS.md:54-57 and SKILL.md:30-34 require qualification to state the conditions it holds under; an unpinned fixture generator means the qualification cannot be reproduced or re-verified after a Transformers upgrade.

Fix: extend helios/README.md:772-789 with the Gemma 4 fixture set, its pinned Transformers/Torch/Torchvision versions, the snapshot used to generate the hashes, and the regeneration command.


2. Description evidence (should fix)

2.1 The --ignored reproduction command cannot be run as written

FLARE_GEMMA4_TEST_SNAPSHOT=<gemma-4-31B-it@842da379> cargo test --locked --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server,test-tools --lib -- --ignored --exact frontend::images::gemma4::tests::checkpoint_tokens_expand_the_image_envelope frontend::images::gemma4::tests::native_pixels_and_positions_match_the_checkpoint_processor: 2 passed, 0 failed.

<gemma-4-31B-it@842da379> is a placeholder where the code requires a filesystem path (gemma4.rs:377-380, PathBuf::from(std::env::var_os(...))). The environment var must point at a directory containing tokenizer.json (not opened) (gemma4.rs:381-385, hard assert), and the envelope test also exports a Jinja chat template and reads further assets from that same directory (gemma4.rs:386-412). The second test requires <repo>/.venv/bin/python with transformers and torch importable (gemma4.rs:452-457, :458-472). None of this is stated.

AGENTS.md:110-112: "Reproduction commands must identify the required inputs and configuration directly or through a precise reference; placeholder arguments alone do not explain a measurement."

Fix: give the snapshot path (or a precise reference to how to obtain it), and state the required tokenizer.json (not opened)/tokenizer_config.json (not opened) contents and the .venv requirement.


3. Nits (5)

  1. helios/src/frontend/images/gemma4.rs:30-38 — seven distinct conditions collapse into "invalid Gemma 4 image settings": zero/oversized patch_size, zero/oversized pooling_kernel_size, an unsupported max_soft_tokens, pooling² != limits.patches_per_feature, and patch-budget overflow. A load failure gives the operator no field name, unlike the neighbouring Envelope::load (:40-44) whose errors name the offending token. The bounds at :32-33 (patch_size > 64, pooling_kernel_size > 16) are still unexplained while :11-13 now explains only the soft-token list. SKILL.md:38-39 ("Comments explain invariants, intent, and non-obvious constraints"). Suggest splitting the message by condition and adding one comment naming the source of the bounds.
  2. helios/src/frontend/images/layouts/bracketed.rs:57-65 — the error "bracketed image span is missing envelope markers" fires on start == 0 || end >= expanded.token_ids.len(), a bounds test; the closure never inspects marker identity. Marker equality is enforced later at helios/src/model.rs:441-446 (tokens[s.start] != span.start_token || tokens[s.end - 1] != span.end_token). The message claims a check the code does not make. Suggest "bracketed image span run is outside the expanded prompt".
  3. ignition/preparation/frontend.py:132 — max_soft_tokens not in (70, 140, 280, 560, 1120) silently mirrors helios/src/frontend/images/gemma4.rs:11-13 SUPPORTED_SOFT_TOKENS. The Rust side now names Hugging Face as the source; the Python copy names nothing and can drift. One comment naming the source and the mirror fixes it.
  4. Description wording — "Regenerated ignition/preparation/runtime_core_pb2.py with libprotoc 36.1 matching origin/main" does not match the artifact's own header, # Protobuf Python Version: 7.36.1 (runtime_core_pb2.py:5, ValidateProtobufRuntimeVersion(..., 7, 36, 1, ...) at :12-19). That header is byte-identical on main (read at ref=main), so no regression exists — the description just names a compiler version the file does not record. Say which protoc/grpcio-tools release produced the descriptor, or drop the version.
  5. Commit message — the single commit 2b4a31e "Add Gemma 4 image preparation, Bracketed patch-width metadata, and atomic spans" names the three behaviours and matches the diff but carries no compatibility impact or validation (SKILL.md:40-43). Acceptable because the PR description holds that detail; noting it as the last item only.

4. Verified as fixed since the previous round (previously blocking)


Open questions / what I could not verify from the code

Out of lens and left to other reviewers: patch-merge arithmetic and the 3×3 pool, span semantics in the scheduler and prefix cache, protobuf oneof wire compatibility, and the prefill_chunk_size / span.max_tokens enforcement behaviour (now covered by server/config.rs:935-1024).