Subtraction review — PR #518, --target-head-quantization
Key findings
The pull request adds a complete second route for something the repository already routes: --online-mxfp8 --online-mxfp8-scope GROUP is already a recipe-declared, CLI-only, recipe-free opt-in that travels Plan → reproduction args → SCOPE_TARGET_WEIGHT, and the target vocabulary head is exactly one of its conversion groups (precedent: PR #312 §7 --online-mxfp8-scope with-vocabulary-head, "no kernel, Helios code, Protobuf field or package contract changes"). The entire diff (~126 lines, 10 files) is removable; nothing replaces it in core code.
Everything else in the diff is a subset of that: ~88 test lines that clone three existing tests, a 10-line dict splat in bench.py that a 6-line comprehension already covers, a 2-line Recipe check that duplicates the Plan check, and 2 lines of status/doc text that restate the existing online-MXFP8 lines. Five getattr(..., None) fallbacks are dead but save no lines.
Ranked by lines saved: 126 → 88 → 4 → 2 → 2. If a maintainer keeps the flag, ~96 lines are still recoverable.
1. Blocking — the whole --target-head-quantization route duplicates --online-mxfp8 --online-mxfp8-scope GROUP: ~126 lines (the entire diff)
What goes (per-file counts from the diff: tests/cli/test_commands.py +47/−3, tests/cli/test_planning.py +41/−1, ignition/planning.py +8, ignition/cli/bench.py +6/−5, ignition/cli/serve.py +4, ignition/declaration.py +4/−1, ignition/preparation/rebuild_manifest.py +4, ignition/cli/__init__.py +3, ignition/cli/preparation.py +2/−1, docs/cli-design.md +1):
ignition/declaration.py:278—target_head_quantizations: tuple[str, ...] = ()ignition/declaration.py:328-329— the format-membership checkignition/declaration.py:276— comment reword "Preparation overrides for vocabulary and transition projections" (churn only)ignition/planning.py:199—target_head_quantization: str | None = Noneignition/planning.py:289-293— theUsageErrorignition/planning.py:411-412— theto_dict()splatignition/cli/__init__.py:212-214— the argparse flagignition/cli/preparation.py:57, 73— the_prepareparameter and forwardingignition/cli/serve.py:210, 278, 479(forwarding),:314(status item)ignition/cli/bench.py:170(forwarding),:243-252(configuration splat)ignition/preparation/rebuild_manifest.py:302-303(reproduction args),:363-364(manifest entry)docs/cli-design.md:454— the table rowtests/cli/test_commands.py:23, 52, 102-113, 116-139;tests/cli/test_planning.py:23, 54, 212-253
What already does this, in-tree:
ignition/declaration.py:267-269—online_mxfp8: bool,online_mxfp8_scope: str = "all",online_mxfp8_scopes: tuple[str, ...] = ("all",). Groups are recipe-declared and free-form; the only validation is membership (declaration.py:314,planning.py:226,planning.py:605-606). Nothing on the Rust side allowlists names:helios/src/runtime_core/preparation.rs:170-178(not opened) copies whatever string the manifest records;helios/src/core/conversion.rs:7554only rewrites a legacy arg.ignition/planning.py:206-207, 223-229—Plan.online_mxfp8/Plan.online_mxfp8_scope, defaulted from the recipe, validated against it, non-default scope requiring--online-mxfp8. This is structurally the same three things the PR adds atplanning.py:199, 289-293, 411-412.ignition/preparation/rebuild_manifest.py:294-297— reproduction args;:358-360—SCOPE_TARGET_WEIGHTentriesonline_mxfp8+online_mxfp8_scope(defaulting toall). Byte-for-byte the plumbing re-created at:302-303and:363-364.ignition/cli/__init__.py:262-270— the CLI flag and help already exist forexport,benchanddebug-serve, because all three share_preparation_arguments(__init__.py:50/53/60). No new plumbing was needed to expose a group on any command.docs/cli-design.md:474-475— already documents the flag and--online-mxfp8-scope SCOPEas "Select a conversion group declared by the recipe".
Precedent that the target vocabulary head is such a group: PR #312 adds --online-mxfp8-scope with-vocabulary-head, described as reading "239 MB of vocabulary weights per rank", and states "The scope enters the tuning identity and the rebuild manifest. No kernel, Helios code, Protobuf field or package contract changes" — i.e. precisely SCOPE_TARGET_WEIGHT + reproduction args, without a new flag. In today's tree the vocabulary module lives in the external recipe package, but the online_mxfp8_scope key already documents that pattern (docs/runtime-core-design.md:375 (not opened), 387; heliopause/src/export/weight_reuse.rs:650-654; helios/src/runtime_core/preparation.rs:535-539 (not opened) exercises a non-all scope value end to end).
Replacement: none in this repository. The companion recipe (local-inference-lab/hyperflare-recipes#40) declares an online-MXFP8 conversion group for the target head and prepares with --online-mxfp8 --online-mxfp8-scope <group>; the plan, Plan.to_dict(), the reproduction args and the SCOPE_TARGET_WEIGHT entry all follow from code that already exists and is already tested. Nothing stated in the PR description is lost: the opt-in stays recipe-declared, stays CLI-only, stays carried through Plan and PreparationManifest, and is still rejected by recipes that do not declare the group.
Rules this collision cites: charter line 12 ("Keep the runtime small and model-agnostic … implemented once via a single general mechanism") and its "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"; "Every contribution must address … a measured performance or memory problem" — here the measured gain belongs to the companion recipe, not to this flag); docs/design-review.md:80 (principle 10, settings belong in recipe declarations, configuration files or CLI flags — already satisfied by --online-mxfp8-scope) and :125 (principle 15, reject scope expansion).
Counter-case, answered. The repo does have a family of per-component overrides — draft_head_quantizations (declaration.py:277), draft_body_quantizations (:279), markov_head_quantizations (:280) — each with a recipe tuple, a choices=(...) flag (cli/__init__.py:204-217), a Plan field and a SCOPE_TARGET_WEIGHT entry, so a target-side member looks symmetric. It does not hold: those overrides exist because they prepare additional copies computed at load (proposal heads, DFlash2 body) that online_mxfp8 groups do not cover — docs/cli-design.md:474 says so explicitly ("Existing packed weights, normalization, convolutions, selectors and target vocabulary weights retain their precision") — whereas target-vocabulary conversion is an online_mxfp8 conversion group (PR #312). The new option also has exactly one value in practice (choices=("mxfp8",) at cli/__init__.py:212, a one-element recipe tuple, a single str | None plan field), and nothing outside ignition/ and tests/ reads the manifest key, so the field encodes one boolean fact through four layers.
2. Should fix — ~88 new test lines clone three existing tests: ~88 lines (removable even if the flag is kept)
tests/cli/test_commands.py:102-113test_target_head_quantization_flag_is_model_agnosticis:61-72test_row_shard_prefill_flag_is_model_agnosticwith a different flag string: same parametrization overexport/debug-serve/bench, same "parse_args never None", same--helpsplit, same "no model name in the section" assertion. ~12 lines. It asserts argparse plumbing, not behaviour.tests/cli/test_commands.py:116-139test_derive_forwards_and_validates_target_head_quantizationrepeats:75-99: build fixture →derive(...)→ assert plan field andto_dict()→ assert theUsageErrormessage. ~24 lines.tests/cli/test_planning.py:212-253test_target_head_quantization_validation_and_preparation_manifestrepeats:63-69/:72-107and:142-183: recipe rejects an undeclared value, key absent fromto_dict()when unset,from_planscope + reproduction args, protobuf round trip, sorted unique keys. ~42 lines.- The fixture keywords that exist only to serve these (
tests/cli/test_commands.py:23, 52;tests/cli/test_planning.py:23, 54) go with them.
What already covers the contract: test_row_shard_prefill_flag_is_model_agnostic, test_derive_forwards_row_shard_prefill_and_rejects_joint_tuning, test_preparation_manifest_resolves_scopes_and_dflash2_inheritance (tests/cli/test_planning.py:72-107, 142-183) prove the same CLI→Plan→manifest shape, including that changing a target-weight parameter rejects combine and reuse (helios/src/runtime_core/preparation.rs:530-539 (not opened)). Nothing behavioural is left untested.
AGENTS.md:188-193 also names source-text checks as non-contributions ("source-text checks and mocks that bypass the behavior cannot establish runtime correctness"), which is exactly what the --help text tests are.
3. Should fix — bench.py preparation block grows 12→21 lines for one optional key: ~4 lines
ignition/cli/bench.py:243-252 replaces a single dict comprehension with a pair of **{} splats purely to append one optional key:
"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", "language_model_only")},
**({} if "target_head_quantization" not in preparation else {
"target_head_quantization": preparation["target_head_quantization"]}),
}}
Smaller version (6 lines, and the same rule for every key instead of one special case):
"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 (ignition/planning.py:411-412), so if key in preparation expresses exactly the intended rule. The block is also a second serialization of a value the same function already prints whole (bench.py:182 dumps plan.to_dict()), so the extra entry adds no information.
Zero-line noise (record, do not count as savings): getattr(args, "target_head_quantization", None) at ignition/cli/serve.py:210, 278, 479 and ignition/cli/bench.py:170, and getattr(plan, 'target_head_quantization', None) at ignition/preparation/rebuild_manifest.py:302. Every command reaching these call sites builds its parser through _preparation_arguments (ignition/cli/__init__.py:50/53/60), so the attribute always exists, and neighbouring arguments in the same calls are read directly (args.online_mxfp8, args.row_shard_prefill, plan.force_moe_decode_a16 at rebuild_manifest.py:300, plan.row_shard_prefill at :308). Removing the wrapper saves no lines, only noise — but it is a fallback for a case that cannot happen.
4. Nit — Recipe 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("target_head_quantizations must name supported target vocabulary head formats")
The three sibling override tuples this field sits between (declaration.py:277, 279, 280) have no Recipe.__post_init__ validation at all; they are validated once, at plan time (ignition/planning.py:487-495). The new field is validated twice, and only Plan.__post_init__ (planning.py:289-293) produces the user-facing error that names self.checkpoint.alias and is reachable from a CLI path. Deleting the recipe-level check makes the field match its neighbours and loses nothing: an unsupported name still fails at plan(), with the alias named.
Also: the class docstring documents online_mxfp8 (declaration.py:226-229), language_model_only, mla_compute_modes, export_repository and b12x_environment, but the new field gets no line there — either the flag goes, or it needs the one line its neighbours have. Folded into finding 1.
5. Nit — status item and doc row restate existing output: 2 lines
ignition/cli/serve.py:314—f"{(' · target head ' + plan.target_head_quantization) if plan.target_head_quantization else ''}"sits immediately afterserve.py:308f"{(' · online MXFP8 ' + plan.online_mxfp8_scope) if plan.online_mxfp8 else ''}". Under the existing mechanism that line already prints the prepared conversion group, so the new item states the same fact twice. 1 line.docs/cli-design.md:454— a full table row duplicating:474-475(which projections each group converts;--online-mxfp8-scopeselects a recipe-declared group). It is also the only advanced-option row that names a model while the help text deliberately does not (ignition/cli/__init__.py:212-214says only "recipes that declare it", andtests/cli/test_commands.py:113asserts no model name in that section) — the row and the help disagree about how much model knowledge a model-agnostic flag should carry. 1 line.
Left behind elsewhere in the repository
None. target_head_quantization / target_head_quantizations match only in ignition/ and tests/ (plus the doc row); there are zero matches in helios/, heliopause/, helios/proto/runtime_core.proto (not opened) or the Python protobuf stubs. The change adds a parallel route rather than superseding one, so it creates no dead code for this PR to clean up — and, correspondingly, the new manifest key has no reader today: helios/src/runtime_core/preparation.rs:164-186 (not opened), 337-370 copies manifest parameters through opaquely. That is consistent with the description's "zero changes to helios/ or Protobuf schemas", and also means every line in this diff is inert in core until a recipe reads it.
Open questions / what I could not verify
- The companion recipe lives outside this repository (
local-inference-lab/hyperflare-recipes#40, and the tree's recipes were removed at17bb3c4a), so I cannot show the declaration that would use this flag. The in-tree precedent that a vocabulary-head conversion group works is PR #312 §7 plusdocs/cli-design.md:474-475and the scoped-manifest tests attests/cli/test_planning.py:142-183. - Whether the companion PR must ship simultaneously with core changes: on this diff, no — nothing in core consumes the key, so merging only the recipe with an
online_mxfp8group would be a single-repo change.
Totals
Whole diff removed: ~126 lines (essentially all of it) across 10 files, in 5 findings ranked above. If a maintainer keeps the flag against this recommendation, ~96 lines still come out: 88 test lines + 4 bench.py + 2 declaration.py + 2 status/doc (the five getattr wrappers save zero lines but should still go).