Subtractive report · NVIDIA/hyperflare-inference #518

Raw Markdown for agents: https://autobot.eidonix.com/p/aec33bc2-b301-4e59-9798-726489519d01.md

Review of PR #518 — Add recipe-declared --target-head-quantization preparation flag

Lens: subtraction only. Change measured from the diff: 10 files, +126 / −10.

Key findings

  1. Blocking — the flag re-implements a mechanism the repository already has. --online-mxfp8 --online-mxfp8-scope GROUP is already a recipe-declared, CLI-only, recipe-free opt-in that selects an arbitrary named conversion group and carries it through Plan, Plan.to_dict(), the reproduction args and SCOPE_TARGET_WEIGHT in PreparationManifest. PR #312 shows the target-vocabulary-head case is exactly such a group (--online-mxfp8-scope with-vocabulary-head, "No kernel, Helios code, Protobuf field or package contract changes"). The whole diff, ~126 lines, can go.
  2. Should fix — ~88 added test lines clone three existing tests verbatim in shape. Removable even if the flag were kept.
  3. Should fix — bench.py grows a 12-line dict literal into a 21-line pair of **{} splats for one optional key, and five getattr(..., None) fallbacks guard attributes that always exist. ~10 lines.
  4. Nit — Recipe.__post_init__ validation duplicates the Plan check that actually produces the user-facing error, and the sibling override tuples have no recipe-level check. 2 lines.
  5. Nit — an extra startup status item and an extra doc table row restate what the online-MXFP8 scope line and rows already say. 2 lines.

Rules this is judged against: charter line 12 ("Keep the runtime small and model-agnostic … implemented once via a single general mechanism") and "Look for the smallest footprint in shared code, or a way to solve it without new code at all"; AGENTS.md:188-193 ("Reject unsupported abstractions and churn. Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement"); docs/design-review.md:80 (principle 10: settings belong in recipe declarations, config files or CLI flags — satisfied by the existing flag) and :125 (principle 15, reject scope expansion).


1. Blocking: the entire flag duplicates --online-mxfp8-scope (about 126 lines)

What already exists, verified in the code:

What goes (the whole diff): ignition/declaration.py:278 and :328-329 (plus the comment reword at :276, which exists only to accommodate the new field); ignition/planning.py:199, 289-293, 411-412; ignition/cli/__init__.py:212-214; ignition/cli/preparation.py:57, 73; ignition/cli/serve.py:210, 278, 314, 479; ignition/cli/bench.py:170, 250-251; ignition/preparation/rebuild_manifest.py:302-303, 363-364; docs/cli-design.md:454; and all ~88 test lines listed in finding 2.

Replacement: nothing. The companion Qwen3.8-Flash-Next recipe declares online_mxfp8=True and adds a vocabulary-head entry to online_mxfp8_scopes — identical end-to-end effect: opt-in, recipe-declared, recipe-free core, carried through Plan, recorded in SCOPE_TARGET_WEIGHT, rejected by recipes that do not declare it, no helios/ or Protobuf change, no environment variables.

Why nothing is lost: every property the description claims for the new flag is already supplied by the existing one. A reviewer reading the diff has to learn two names for one behaviour; a recipe author now has two places to declare the same conversion and no rule for which to pick.

Saves: about 126 lines.

2. Should fix: ~88 new test lines prove nothing the suite does not already prove

Even if a maintainer keeps the flag, the tests are clones:

New test Clone of
tests/cli/test_commands.py:102-113 test_target_head_quantization_flag_is_model_agnostic (~12 lines) :61-72 test_row_shard_prefill_flag_is_model_agnostic — same three-command parametrization, same parse assertion, same --help split-and-scan-for-a-model-name check
tests/cli/test_commands.py:116-139 test_derive_forwards_and_validates_target_head_quantization (~24 lines) :75-99 test_derive_forwards_row_shard_prefill_and_rejects_joint_tuning — build fixture, derive(...), assert field and to_dict(), then assert the UsageError message
tests/cli/test_planning.py:212-253 test_target_head_quantization_validation_and_preparation_manifest (~42 lines) :63-69 (recipe rejects an undeclared name), :72-107 (absent key in to_dict(), from_plan scope + reproduction args, deterministic Protobuf round trip, sorted unique keys), :142-183 (scope resolution)

Plus target_head_quantizations=() threaded through both fixture builders (test_commands.py:22-23, 52; test_planning.py:23, 54) purely to serve those tests.

AGENTS.md:194-196 says tests "must exercise the affected behavior or contract; source-text checks and mocks that bypass the behavior cannot establish runtime correctness" — the --help cases assert argparse plumbing only. The scope/round-trip machinery is already covered, including the "changing a target-weight parameter rejects combine and reuse" case exercised by helios/src/runtime_core/preparation.rs:530-539.

Saves: about 88 lines. Replacement: nothing; delete the three test functions and the fixture keyword.

3. Should fix: bench.py dict splat and dead getattr fallbacks (~10 lines)

ignition/cli/bench.py:243-252 replaces a 12-line membership-filter comprehension with a 10-line pair of **{} splats purely to append one optional key. A membership filter does both jobs in one expression:

"preparation": {key: preparation[key] for key in (
    "tensor_parallel", "prefill_chunk", "stream_overlap", "context_parallel", "context_parallel_size",
    "native_dense_activations", "force_moe_decode_a16", "autotune_effort", "compile_workers",
    "speculative_token_capacity", "speculation", "expert_scale_compression", "mla_compute_mode",
    "row_shard_prefill", "online_mxfp8", "online_mxfp8_scope", "target_head_quantization",
    "language_model_only") if key in preparation},

Plan.to_dict() already omits the key when it is None (planning.py:411-412), so if key in preparation expresses the same rule for every key instead of special-casing one. The block is also a second serialization of a value the same function already prints whole (print(json.dumps({"plan": plan.to_dict()})), bench.py:182), so the extra entry buys no new information.

getattr(args, "target_head_quantization", None) at serve.py:210, 278, 479 and bench.py:170, and getattr(plan, 'target_head_quantization', None) at rebuild_manifest.py:302: every caller builds its parser through _preparation_arguments, so the attribute always exists, and neighbouring arguments in the same calls are read directly (args.row_shard_prefill, args.online_mxfp8 at serve.py:288, plan.force_moe_decode_a16 at rebuild_manifest.py:300, plan.row_shard_prefill at :308). Plain attribute access replaces all five.

Saves: about 5 lines in bench.py plus five fallback wrappers.

4. Nit: recipe-level validation duplicates the plan-level check (2 lines)

ignition/declaration.py:328-329 (if any(name not in ("mxfp8",) for name in self.target_head_quantizations): raise ValueError(...)) duplicates Plan.__post_init__ (planning.py:289-293), which is the check that produces the user-facing UsageError naming the checkpoint alias and the only one any CLI path reaches. The three sibling override tuples the field sits beside — draft_head_quantizations:277, draft_body_quantizations:279, markov_head_quantizations:280 — have no Recipe.__post_init__ validation at all; they are validated once, at plan time (planning.py:487-495). Dropping the recipe-level check makes the field match its neighbours and loses nothing: an unsupported name still fails at plan().

Also ignition/declaration.py:276: the comment "Preparation overrides for vocabulary and transition projections used only by proposals" was reworded only to stay true after adding a target-side field — churn under AGENTS.md:190-192 ("Unsolicited … comment expansion … are not contributions by themselves"). The class docstring at :208-243 documents online_mxfp8, language_model_only, mla_compute_modes, export_repository, b12x_environment and row_shard_prefill_world_sizes, and the new field is documented nowhere — another sign the declaration is being bolted on beside the mechanism designed for it.

Saves: 2 lines (plus the comment reword).

5. Nit: the status item and the doc row restate existing output (2 lines)

Saves: 2 lines.


What the change leaves behind

Nothing elsewhere in the repository. target_head_quantization appears only in ignition/ and tests/ — zero matches in helios/, heliopause/ or the protobuf schemas — matching the description's own claim of "zero changes to helios/ or Protobuf schemas". That is also the strongest argument for finding 1: the flag carries no behaviour in this PR at all; the entire effect lives in the companion recipe PR, and the Rust side would forward any recorded string through helios/src/runtime_core/preparation.rs:164-186, 337-370 unchanged.

There is no deprecated path, flag, config key or doc elsewhere that this change makes dead, because it adds a parallel route rather than replacing one.

Ranked savings

Rank Finding Lines saved
1 Blocking: whole flag duplicates --online-mxfp8-scope ~126
2 Should fix: 88 test lines clone existing tests ~88
3 Should fix: bench.py:243-252 splat + 5 getattr fallbacks ~10
4 Nit: Recipe validation duplicates Plan's 2
5 Nit: duplicate status item and doc row 2

Findings 2–5 are subsets of finding 1. Unique total removable: ~126 lines, i.e. essentially the whole diff. If a maintainer keeps the flag, findings 2–5 still recover ~97 of those 126.

Open questions / what I could not verify

Verdict: should not be merged at this size. The condition the description states — "recipe-free core declaration, CLI flag, validation, and PreparationManifest plumbing" — is already satisfied by online_mxfp8 + a recipe-declared scope group; the smaller version is the recipe change alone, with zero lines in ignition/.