Simplicity scratchpad · NVIDIA/hyperflare-inference #229

Raw Markdown for agents: https://autobot.eidonix.com/p/fb5c0b7a-e383-47f2-89ff-234fe2294c99.md

#1 [high] PR 229 overview and review lens

PR #229 (Raydius, open, ready for review; changes requested by yatesdr). Head eebbf1d; base main at 66b473c3 when last rebased. 65 files, +5503/−232. Labels area:api, area:packaging, area:preparation, enhancement, model:muse-glimmer, triage:design-review. Three commits: (1) recipe + shared changes, (2) context 131072→1048576 + benchmark regex, (3) concurrency 4→8/16 + token_capacity 64→128.

My lens: D — simplicity. What can be deleted: unneeded code/options/fallbacks/parallel paths, tests that do not prove behaviour, bloated comments.

Repo rules relevant:

PR's own admissions: branch never exported or served; all CUDA tests of the recipe unrun; GPU evidence from fork cores. Charter requires "prove they export and serve cleanly from the PR branch".

#2 [high] PR 229 simplicity findings (lens D)

  1. should fix — duplicated DFlash2 drafter config parser. ignition/recipes/muse_glimmer_nvfp4/draft_config.py:1-77 re-implements ignition/components/dflash2_geometry.py:27-101 (DFlash2Config): same required-key table, same options table, same properties (layers/target_layers/block_size/noise_token/attention/validate_shard are line-for-line the same shape), same target compatibility checks. qwen38_dense/draft_config.py:10-25 is the smaller form already in the tree: one PROFILE dict + from_dict/load one-liners calling DFlash2Config. The PR admits the duplication ("Overlaps and follow-ups": kept out to leave geometry checks as measured on the fork). Difference to resolve: DFlash2Config.from_dict rejects non-default output_multiplier/final_logit_softcapping (dflash2_geometry.py:71-73) while Glimmer's requires them to equal the target's — so the shared reader needs an expected entry for them (it already takes expected), not a new module. Delete ~60 lines.

  2. should fix — ignition/recipes/muse_glimmer_nvfp4/attention.py (214 lines) duplicates muse_spark/attention.py:62-193 constructor branching (paged vs sliding, prefill/verify staging, windows, tuning_page_count, commit writer) plus head_norm (glimmer:61-63 == spark:57-59) and _rotary (glimmer:153-157 == spark:129-133) verbatim. docs/TODO.txt records the fold-back, i.e. the PR knows this is deletable. Smaller version: put the per-call-metadata form in muse_spark/attention.py (or ignition/components/) taking records/metadata per forward and the optional gate projection, and delete the Glimmer module + its head_norm/_rotary copies. This is the same conclusion the PR's own TODO reaches; the difference is doing it now rather than keeping two modules that must be kept in step (weights.py:123-124 re-asserts a width that attention.py:92-93 also asserts).

  3. should fix — qualify/results/glimmer-c16/summary.json:1-76 is a committed run output (16 request latencies, accepted-draft counters) that nothing reads: grep qualify/results and grep summary.json over the tree find no consumer, and main has no qualify/results directory at all. It belongs to a fork-built core (the PR says the core was built before the per-call forwards), so it cannot be reproduced or checked from this branch. AGENTS.md (prose skill lines 26-29) forbids run journals in the repository, and the numbers already appear in the PR description. Delete the file.

  4. should fix / nit — muse_glimmer_nvfp4/bootstrap.py:50 CONTEXT = 1048576 and :68-69 prefill_chunk_size = 4096, max_active = 4 are defaults that no caller uses and that contradict the declaration (RECIPE.context/max_active are 1048576/8). tests/recipes/muse_glimmer_nvfp4/test_preparation.py:15 then pins max_active == 4 and :19 decode_tokens == 4, so a future reader sees a test asserting a concurrency the recipe does not declare. Smaller version: take context, prefill_chunk_size, max_active from RECIPE (as the other recipe bootstraps do via the plan) or make them required dataclass fields with no default; the MAX_WIDTH=16 default in speculative_widths can stay because post_init validates it.

  5. nit — helios/src/frontend/images/conditioned.rs:186-187 states "no default arm, so a new profile cannot inherit another's extents", but the windows/reverse match at :209-212 is _ => (0, 0). A new windowed profile would silently declare zero window segments and zero reverse index (and valid_processed would then accept records with none). Either list all profiles explicitly, as the two matches above do, or drop the sentence.

  6. nit — conditioned.rs test helper settings() adds let mut covered = [false; 11] + an 11-arm index match + assert!(covered.iter().all(...)). The assertion cannot fail as written: the ImageSettings match arms are what force a new variant to be listed (exhaustiveness), and duplicate indices only indicate a copy-paste slip. The procedural block (~18 lines) is bookkeeping about the test, not about behaviour; drop it and keep the vector.

  7. nit — recipe.py:45-47 and :24-40, :55-58, :60-62 carry export-run provenance into code: # Export VRAM inventory (gb202-tp1-202611080045 at --max-concurrency 16), the round-catalog yields per batch, and the 18%-at-depths-8-15 acceptance figure. Run identifiers and fork measurements are not invariants the code holds (repo-prose skill: comments explain invariants, not history; documentation is not a changelog). Smaller version: keep _GRAPH_BYTES with a one-line "measured on one RTX PRO 6000 at --max-concurrency 16; see docs/model-preparation.md" and leave the rest to the doc/PR.

  8. nit — ingition/recipes/muse_glimmer_nvfp4/attention.py:36-40 AttentionScratch.allocate(..., max_verify_width=8) default is never used: the only caller (decoder.py:38-40) always passes width. Drop the default so the required width is explicit.

  9. nit — usage() in muse_glimmer_nvfp4/recipe.py:38-40 is identical to muse_spark/recipe.py:44-46 (3 lines of dict unpacking). One shared helper in ignition/recipes/declaration.py would remove both copies; the pattern now exists twice and a third recipe will copy it again.

  10. nit — bootstrap.py:75,188 declare stream_overlap: bool = True and build ScratchArena(overlap=config.stream_overlap), but recipe.py never forwards plan.stream_overlap (compare muse_spark/recipe.py:30-39, which also does not). The declaration's stream_overlap default is False, so --no-stream-overlap and the plan's "branches serialized" state can be reported while the arena still overlaps. Inherited from Muse Spark, so pre-existing, but this PR copies the pattern into a second recipe.

  11. nit — helios/src/frontend/images/record.rs:27-42: the empty-window handling pushes 0, extends, then clears when the length is 1. Simpler: if !images.cu_window_seqlens.is_empty() { ... }.

#4 [high] Research summary

Read the whole PR through the simplicity lens (charter, AGENTS.md, docs/design-review.md, repo-prose skill as the standard), all recipe modules, shared components they duplicate, the Helios image frontend, and every test the PR adds. Findings are in the scratchpad with severities: two structural duplications that should be deleted rather than kept as follow-ups (the DFlash2 drafter-config parser, which qwen38_dense already does in 25 lines against the shared reader; and the 214-line Glimmer attention module whose own TODO says it should fold back), one committed fork run output nothing reads, and a set of nits — bootstrap defaults that contradict the declaration and are pinned by a test, a comment claiming "no default arm" above a _ => (0, 0) match, a test bookkeeping block that cannot fail, run identifiers and fork acceptance figures in code comments, an unused max_verify_width default, usage() copied verbatim from Muse Spark, stream_overlap accepted but never forwarded, and a clearer empty-window guard in record.rs. Caveat recorded: a browser client may read qualify/results/, so that finding is phrased "verify, then delete". Also noted that per maintainer triage most of these files are scheduled to move to hyperflare-recipes.

#5 [high] Lens D: source-text test finding and verification notes

  1. should fix — source-text test that bypasses behaviour. tests/recipes/muse_glimmer_nvfp4/test_functional.py:238-241 test_decoder_constructor_keeps_the_vision_hook_optional asserts inspect.signature(PreparedDecoder.__init__).parameters["vision_state"].default is None. AGENTS.md (~line 189) rejects source-text checks that bypass the behaviour. The behaviour is already covered two tests above by test_text_only_decoder_skips_the_vision_hook (test_functional.py:232-235), which constructs a decoder without vision_state and shows the hook is skipped. Delete the signature test; the keyword default is exercised by every other case in the file.

Verification status per finding:

  1. draft_config duplication — read both files fully. muse_glimmer_nvfp4/draft_config.py:31-50 required+options tables vs ignition/components/dflash2_geometry.py:39-74; properties :52-77 vs :76-101 are the same expressions; validate_shard :74-77 vs :98-101 identical. qwen38_dense/draft_config.py:10-25 is the single-PROFILE-dict form. Blocking detail confirmed: dflash2_geometry.py:71-73 requires output_multiplier==1. and final_logit_softcapping is None, while Glimmer's draft_config.py:43-46 requires them to equal the target's (0.196…/20.0) — so folding needs that added to expected, which the shared reader already accepts as a dict.
  2. attention duplication — read both modules fully. Identical: head_norm (glimmer 61-63 / spark 57-59), _rotary (glimmer 153-157 / spark 129-133), the mode-driven branch tree (glimmer 110-151 / spark 86-127), tuning_page_count, window/columns/pages setup, commit slot arithmetic (glimmer 206-214 / spark 183-189). Differences are only: per-call metadata, a separate gate projection, gate without head_norm (glimmer 203 vs spark 179), and caller_owned_placeholders=True. docs/TODO.txt (new entry, +8 lines) already commits to removing it.
  3. qualify/results/glimmer-c16/summary.json:1-76 — confirmed no consumer: search_code "qualify/results" and "summary.json" in qualify/ both return nothing; main has no qualify/results directory (list_files on main for qualify/* shows only .py files). Construction of a query that a browser/JSON client might read is the one thing I could not check from the tree; if flare run/flare serve exposes a results directory, the file may be wanted — that would settle it.
  4. bootstrap defaults — bootstrap.py:50 CONTEXT = 1048576 (used as context: int = CONTEXT default), :68 prefill_chunk_size: int = 4096, :69 max_active: int = 4. recipe.py:75 passes plan.context / plan.concurrency, so no production path reads the defaults; test_preparation.py:13-21 asserts (0, 1048576, 4, 4096) and decode_tokens/samples == 4, i.e. the test pins a concurrency the recipe declares as 8. Compare muse_spark/bootstrap.py:69 max_active: int = 4 — same pattern upstream, so this is inherited, but the Glimmer defaults also disagree with its own RECIPE (max_active 8).
  5. conditioned.rs:186-187 comment vs :209-212 _ => (0, 0) — read in place. The two matches above it (:188-194 pixel width, :196-208 interpolation) do list every profile.
  6. conditioned.rs test settings() covered-array block — helios/src/frontend/images/conditioned.rs (PR diff hunk added after the vec), 11 booleans indexed by an exhaustive match; nothing can make the final assert false except a duplicated index.
  7. recipe.py:45-47 # Export VRAM inventory (gb202-tp1-202611080045 at --max-concurrency 16), :24-40 comment block on sampling/context/concurrency with the "18% of accepted drafts at depths 8-15" figure, :55-58 round-catalog yields, :60-62 rank-cost derivation. Run id and fork measurement are not invariants.
  8. attention.py:36 max_verify_width=8 default — only caller decoder.py:38-40 passes width.
  9. usage() identical: muse_glimmer_nvfp4/recipe.py:38-40 vs muse_spark/recipe.py:44-46.
  10. stream_overlap — muse_glimmer_nvfp4/recipe.py:22-36 builds PreparationConfig without stream_overlap=plan.stream_overlap; bootstrap.py:75 defaults it True and :188 passes it to ScratchArena; declaration.py:248 defaults the recipe declaration to False. So a plan with --no-stream-overlap reports "branches serialized" (serve.py:293) while the arena still overlaps. muse_spark/recipe.py:30-39 has the same omission, so this is inherited; reporting it because the PR copies it.
  11. record.rs:27-42 push-0/extend/clear-len-1 — simplest form is an is_empty guard.

Things that are genuinely simpler and should be said (no finding): the ModelOpt NVFP4 parser extraction into ignition/preparation/quantization.py (gemma4/config.py −25/+4, one parser for two recipes) is exactly the consolidation this lens wants; helios resize.rs's Filter enum replaces the pillow: bool, linear: bool flag pair; packing.rs bracketed_extent removes a duplicated validation block between bracketed and muse_glimmer; conditioned.rs's explicit ImageSettings match arms are exhaustiveness, not redundancy.

#3 [medium] Simplicity context: scope and rules cited