Correctness review of PR #229 — Muse Glimmer 30B NVFP4 (head eebbf1d)
Key findings
- Blocking — the recipe is unproven on this branch and serves a single checkpoint. Charter line 37 ("New model recipes … prove they export and serve cleanly from the PR branch, and support more than a single checkpoint") is unmet twice over, and the PR description says so itself. Every GPU number comes from fork cores built before the forwards moved to per-call metadata, so none of it exercises this diff.
- Should fix — a shared validation was relaxed for all recipes.
inspect_indexed_checkpointnow accepts an indextotal_sizeequal to the shard file-size sum, weakening payload accounting for every recipe to accommodate the ModelOpt exporter. - Should fix — cached image records for Muse Glimmer are validated by length only, turning a would-be silent re-preparation into a user-visible packing error at request time.
- Should fix — image geometry tie-breaking depends on a hand-replicated CPython 3.12 set-iteration order, with a silent fallback and only 20 pinned tie sizes.
- Should fix —
bootstrap.ConstructionConfig.max_activestill defaults to 4 although the recipe declares 8 by default / 16 at the ceiling. - Should fix — the prepared decoder declares an auxiliary buffer it never writes.
- Three nits: stale cache metadata tag after the record version bump, over-widened metric regex in
qualify/speculative_benchmark.py, and (see below) the missing vision-scratch coverage noted by the author.
Rules applied: docs/design-review.md principles 12 (validate the real path and report evidence honestly), 13 (preserve model core compatibility), 15 (reject scope expansion and weakened constraints); AGENTS.md "Contribution scope and rejection criteria" — "Reject weakened guarantees" (lines 177-182) and "Require focused, meaningful validation" (lines 189-194); the charter's merge criteria (line 37).
Blocking
1. No export/serve evidence from this branch, and exactly one supported checkpoint
docs/design-review.md:94-102 requires exercising the real path and disclosing unrun checks; the charter (line 37) is stricter for new recipes: "Must list supported checkpoints from an official or widely used source, prove they export and serve cleanly from the PR branch, and support more than a single checkpoint (#74)."
Both halves are unmet:
- The description states: "This branch has not been exported or served, and none of its CUDA tests has run on this base." The three GPU runs (
gb202-tp1-202611070323,…0536,…202611080045) are fromRaydius/flare-local-inferencebranchdeploy, and the description itself says they were built before the fork's Muse Glimmer forwards moved to per-call metadata — so they exercise neitherdecoder.py's per-call__call__(metadata)nor the new attention/drafter plumbing in this diff.ignition/recipes/muse_glimmer_nvfp4/recipe.py:49-51cites the fork export for the 5,938 MiB graph inventory. ignition/recipes/muse_glimmer_nvfp4/config.py:63-73requires exactly theoriginal-el8layout — all 416 decoder projections NVFP4 plus a BF16 head ("lm_head" in quantization or len(quantization) != len(PROJECTIONS) * c["num_hidden_layers"]→ error).nvidia/Muse-Glimmer-30B-NVFP4(the checkpoint PR #192 serves, 180 FP8 + 213 NVFP4 W4A16 includinglm_head) is rejected by construction, leaving one supported checkpoint. The PR's own "Overlaps" section confirms each recipe's check rejects the other checkpoint.
Consequence specific to this lens: the graph catalog, page budget (145 graphs / 57.3 GiB pages at the 16-request ceiling), the 128-row packed catalog and the 1,048,576-token context arithmetic are all unexecuted code paths on this head; a wrong capacity or catalogue derivation would surface only after merge.
Fix: land the public alias only after one export + serve run from this head (one text request and one image request passing is enough to satisfy the rule), or merge the recipe without a public alias, documented as unqualified. Whether it exports and serves cannot be settled from code — it needs a GPU run.
Should fix
2. total_size check relaxed for every recipe
ignition/preparation/checkpoint.py:396-405 (diff in this PR):
# Transformers writes the tensor payload sum; the ModelOpt exporter writes the shard file-size sum.
payload = sum(tensor.nbytes for tensor in tensors.values())
files = sum(shard.file_size for shard in shards)
if (not isinstance(index.get("metadata"), dict)
or index["metadata"].get("total_size") not in (payload, files)):
raise CheckpointError(...)
_inspect_indexed_checkpoint is the single entry point behind inspect_indexed_checkpoint, used by every recipe's preparation. Previously a checkpoint whose index total_size disagreed with the tensor payload the index actually maps was rejected. file_size includes the safetensors header and any trailing/unrequested bytes (the new test at tests/preparation/test_checkpoint_source.py:41-50 proves exactly this: header_bytes + payload is accepted), so:
- payload-accounting errors of up to the header/padding size now pass, and
- a stale index over a rewritten shard of equal length is now indistinguishable from a valid one.
AGENTS.md:177-182 ("Reject weakened guarantees … do not remove validation, suppress errors … or relax references") applies to shared preparation code, not just to the new recipe.
Fix: keep the payload comparison authoritative; accept the file-sum arm only when it is provably the ModelOpt shape (payload <= files and the surplus equals the known extra shard, or gate on exporter identity in metadata), and pin a rejecting case for a file-sum index whose surplus is wrong. The PR currently adds only the accepting case plus the pre-existing payload + 1 rejection (tests/preparation/test_checkpoint_source.py:48-50), which would pass under the old check too.
3. Cached Muse Glimmer image records are validated by length, not content
helios/src/frontend/images/conditioned.rs:209-212 and :237-239:
let (windows, reverse) = match self.processor.profile {
Profile::MuseGlimmer(_) => (super::muse_glimmer::windows(&self.geometry) + 1, patches),
_ => (0, 0),
};
...
&& images.cu_seqlens == sequences // compared by value
&& images.cu_window_seqlens.len() == windows // length only
&& images.reverse_index.len() == reverse // length only
materialize_cached (conditioned.rs:149-166) treats a valid_processed failure as a stale record: it invalidates the store entry and re-prepares. A persisted record with correct lengths but wrong window boundaries or a wrong reverse index now passes this gate and is handed to helios/src/frontend/images/packing.rs, which rejects it at request time with "vision window segments differ from the image extent" (packing.rs:581) or "vision reverse index leaves the image extent" (packing.rs:591). So the failure moves from silent re-preparation to a user-visible request error — the opposite of the intent of validation. cu_seqlens is compared by value two lines above, which shows the intended standard.
Fix: check cheap invariants cheaply in valid_processed: first() == Some(&0), last() == Some(&(patches as i32)), monotone non-decreasing for cu_window_seqlens, and reverse_index a permutation of 0..patches (or compare against a re-derived vector as cu_seqlens is compared).
4. Image geometry depends on a hand-replicated CPython hash
helios/src/frontend/images/muse_glimmer.rs:240-277 reproduces CPython 3.12's set iterating order — tuplehash constants (PRIME_1/2/5), the eight-slot probe slot * 5 + 1 + (perturb >>= 5), and the acc == u64::MAX → 1_546_275_796 fix-up — solely so that min(list(set(itertools.product(...)))) in the reference resolves aspect-ratio ties the same way. geometry_matches_transformers_smart_resize (muse_glimmer.rs:367-417) pins 20 tie sizes and 40 plain sizes; the fallback path best.unwrap_or(...) (muse_glimmer.rs:99-102) silently uses ideal dimensions whenever the filtered set is empty, and every untested size follows the replicated hash. CPython 3.13 changes set sizing/resizing (and therefore probe order), so a tester on a different interpreter, or a change in the reference holder, changes the chosen grid — with no failing test. A wrong grid changes patches, tokens, the bracketed prompt expansion and the vision metadata together, i.e. it changes token counts, not just pixels.
Fix: record the interpreter and Transformers version that produced TIES beside the table (as lanczos_matches_torchvision_antialiased_uint8_resize already does for torchvision/PIL), or drop the hash replication and sort candidates by (distance, grid) with the reference's choice pinned explicitly per tie size.
5. bootstrap default contradicts the recipe's declaration
ignition/recipes/muse_glimmer_nvfp4/bootstrap.py:69: max_active: int = 4, while ignition/recipes/muse_glimmer_nvfp4/recipe.py:69 declares concurrency=8, max_concurrency=16, and commit 3's entire argument is the eight-request default. max_active drives request_capacity (bootstrap.py:96), image capacity (:108), the speculative shapes (:115-116), page budgets (:159), prefill/batch capacities (:222) and the runtime max_active (:367). Driving it through recipe.prepare is safe (recipe.py:36 passes max_active=plan.concurrency), but a direct PreparationConfig(...) run — the form the recipe's own tests use — builds a four-slot catalog that does not match the declaration. tests/recipes/muse_glimmer_nvfp4/test_preparation.py:15 pins the stale value, so the inconsistency is currently enforced.
Fix: default max_active to 8 (matching recipe.py), or make it required, and update the test row.
6. PreparedDecoder declares an auxiliary buffer it never writes
ignition/recipes/muse_glimmer_nvfp4/decoder.py:104-106 allocates self.auxiliary via declaration_tensor(...), but __call__ (decoder.py:123-128) builds auxiliary = torch.cat(taps, -1) as a forward-local value and returns it (decoder.py:140); the declared tensor is only cleared in release_outputs (decoder.py:114-115). That is one live BF16 (rows, len(target_layers) × 6656) allocation per prepared decoder (five taps × 6656 columns) with no reader and no writer. Harmless numerically but it is dead allocated VRAM in a recipe whose whole budget argument is graph inventory plus pages.
Fix: delete the declaration, or write the concatenation into it and return the buffer if the drafter path expects a stable address.
Nits
7. Record version bumped, store metadata tag not
helios/src/frontend/images/record.rs:73 writes FLAREIMG\x02 and decode (record.rs:116) rejects \x01, while helios/src/frontend/images/conditioned.rs:169 still labels the payload flare-prepared-image-v1. Effect is correct — an old record fails decode, is invalidated and re-prepared (conditioned.rs:154-166) — but records written by a previous engine are silently re-preprocessed and the metadata tag no longer identifies the payload version. Bump both together.
8. qualify/speculative_benchmark.py:32 widened the metric classes to [0-9]+
Accepting width 16 and batches 8/16 is the intended fix and is pinned by tests/qualify/test_speculative_benchmark.py, but batch="0" or an unexpected batch="32" row now silently produces a shape row instead of being ignored. Prefer a bounded class (([0-9]{1,2})) plus dropping rows whose batch/width exceed the served configuration.
9. Pooled vision scratch coverage
The description's limitation stands: on main, tests/recipes/test_vision_scratch.py (not opened) no longer checks pool reuse across capacities for any recipe, so Muse Glimmer's pooled vision scratch is covered only by test_attention_cuda/test_vision_cuda, none of which ran on this base. Not a defect in this diff (it is a pre-existing gap), but it means the recipe's scratch aliasing is unverified — worth a follow-up test rather than a change here.
Verified as correct (checked, not findings)
- Core-format compatibility (design-review principle 13).
ImagePreparationKindgainsMUSE_GLIMMER_IMAGE_PREPARATION = 11andImageSettings.profilegainsmuse_glimmer = 11; number 10 remainsPADDED_GRID_IMAGE_PREPARATION. Additive only, no renumbering; the existingserialized_padded_grid_profile_selects_only_image_preparationtest passes on the branch per the description, so cores exported before this change still decode. An engine without the change refuses the new core explicitly ("missing protobuf image profile"). valid_processedrewrite fixes a real main-branch defect. The old wildcard arm gaveProfile::PatchMerge588 pixel values whilepatches::PatchProcessoremits3 × 2 × patch_size² = 1176; every PatchMerge materialization failed validation. The new no-default matches (conditioned.rs:188-212) with a compile-time coverage test (conditioned.rs:352-418) are the right form — finding 3 is about the depth of the two new checks, not about the restructure.- Per-call metadata path.
paged_attention.py'scaller_owned_placeholders+functional()dropsslot_mapping/key/valuefrom the retained arguments (paged_attention.py:478-479), so the forward's localslots/rowsare what the kernel binds; the "no retained per-call buffers" claim holds for the attention op. - Reverse-index completeness.
muse_glimmer.rs:121-196writes everyreverse_indexrow (the window loops cover0..grid_h × 0..grid_wentirely), and its pixel width (1176),geometry.tokens = patches/4andgrid_thwagree withhelios/src/frontend/images/packing.rsand withbracketed_extent's assertions. record.rsappend arithmetic (record.rs:27-43) offsetscu_window_seqlensandreverse_indexby the running totals; its only callers are tests, so cross-profile appends cannot occur in serving.- Image tensor capacity checks:
helios/src/model/packing.rs:87-101re-derives each image tensor's required minimum fromgraph.token_capacity, so the newvision_cu_window_seqlens/vision_reverse_indexbindings are extent-checked per graph, and the padded window width (capacity/64 + 2) matchesVisionMetadata.allocate. - Checkpoint geometry guard:
config.py:55-73enforces the four invariants it claims (52 layers × 8 projections, matching q/k/v/gate/o rows, sliding-only rope, BF16 head) andweights.py:111-131asserts the fused q/k/v+gate width after loading, so a swapped packed order fails loudly. - No environment-variable or per-model native branching introduced (AGENTS.md:435 / design-review principle 3): the new profile is data in the core, consumed by an existing dispatch on
ImageSettings.profile.
Open questions / could not be settled from code
- Whether the recipe exports and serves from
eebbf1d— needs a GPU run; this is blocking finding 1. - Whether the checkpoint's NVFP4 gate scale really differs from q/k/v (the reason
gateis a separate projection) — needs theb47e1e9fsnapshot. - Whether the vision tower's window/full layer split (
muse_glimmer_nvfp4/vision.py:220-224) matches the checkpoint'slayer_types— needs the snapshot / a CUDA test. - Alias collision with PR #192, which registers the same
muse-glimmer-30b-nvfp4alias for a different checkpoint. Out of this lens (naming), but it interacts with blocking finding 1: two recipes cannot both claim the alias, and the proposed resolution (this PR keeps it, #192 renames) should be agreed with a maintainer before either merges. ignition/recipes/muse_glimmer_nvfp4/attention.pyduplicates Muse Spark's attention;docs/TODO.txtrecords folding them together once Muse Spark accepts per-call metadata. Recorded as a follow-up, not a finding — the duplication is justified in the description by Muse Spark's construction-bound metadata.