#1 [high] Research summary
Conventions-and-duplication review of PR #518 (target-head-quantization). I read every changed file in context (docs/cli-design.md, ignition/cli/{init,bench,preparation,serve}.py, ignition/{declaration,planning}.py, ignition/preparation/rebuild_manifest.py, tests/cli/{test_commands,test_planning}.py) against the charter, AGENTS.md, docs/design-review.md (principles 3, 9, 10, 13, 16) and the surrounding code plus the Helios side of the manifest (helios/src/runtime_core/preparation.rs, docs/runtime-core-design.md). No blocking problem found; the new construct follows its closest precedents closely and does not duplicate an existing helper. Three nits, all verified in the code.
No duplication of an existing mechanism. --target-head-quantization is genuinely complementary, not a second path to something that already exists: --online-mxfp8 explicitly leaves "target vocabulary weights" at checkpoint precision (docs/cli-design.md:474) and --draft-head-quantization explicitly "retain[s] target-head precision" (docs/cli-design.md:453). The implementation reuses the existing plumbing rather than adding any: SCOPE_TARGET_WEIGHT (rebuild_manifest.py:325) needs no new scope, compatible_for_combine/compatible_for_weight_reuse already compare that scope generically (helios preparation.rs:310-347), and the reproduction_args branch (rebuild_manifest.py:302-303) is shaped exactly like its neighbours at 290-291/300-301. Recipe.target_head_quantizations mirrors draft_head_quantizations/markov_head_quantizations (declaration.py:277-280), Plan.target_head_quantization mirrors force_moe_decode_a16 (planning.py:198-199), and the omitted-when-None to_dict() spread (planning.py:411-412) copies the existing draft_body_quantization/method pattern (planning.py:419-424).
Nit 1 — redundant getattr where every sibling flag uses direct attribute access. ignition/cli/bench.py:170, ignition/cli/serve.py:210, :278, :479 pass target_head_quantization=getattr(args, "target_head_quantization", None), while the two lines above each of them pass args.force_moe_decode_a16, args.native_dense_activations, args.shard_hyperconnections etc. directly. The flag is added inside _preparation_arguments (ignition/cli/init.py:212-214), which is attached to export, bench and debug-serve alike, so the attribute is always present; the three getattr calls can only hide a future parser-wiring mistake (the very bug the new test_target_head_quantization_flag_is_model_agnostic was written to catch). Fix: use args.target_head_quantization at all four call sites. (getattr is the established pattern only where a flag may genuinely be absent, e.g. args.dcp_size at serve.py:197 or the draft-head flags inside preparation.speculation at preparation.py:169-171, where bench/serve do not all define them.)
Nit 2 — same file, two access styles for the new field. ignition/preparation/rebuild_manifest.py:302 uses getattr(plan, 'target_head_quantization', None) while the new line at :363 uses plan.target_head_quantization directly, and the surrounding reproduction_args code (:300, :304) uses direct access. Every field this function touches is a real Plan field, so both should be if plan.target_head_quantization is not None: / if getattr(plan, 'native_dense_activations', False)-style per the local precedent at :304 only for genuinely optional attributes.
Nit 3 — the recipe-side format allowlist is duplicated and validated asymmetrically. The supported format set is written out in three independent places: the argparse choices=("mxfp8",) (ignition/cli/init.py:212), the new Recipe.__post_init__ check (ignition/declaration.py:328-329), and the analogous Speculation.__post_init__ tuple (declaration.py:135) — nothing ties them together, so adding a second format (e.g. nvfp4) means editing three literals that can silently disagree. More importantly the placement departs from precedent: draft_head_quantizations, markov_head_quantizations and draft_body_quantizations are not validated in Recipe.__post_init__ at all but in fit() against the declared tuple (planning.py:487-497), and Plan.__post_init__ here repeats that same membership test a second time (planning.py:289-293). target_head_quantizations is therefore the only head-format tuple checked at declaration time, which makes a bad recipe declaration fail loudly for the target head while the equivalent draft/markov mistake is still accepted until a plan is built. Fix: either drop the Recipe.__post_init__ check and keep only the Plan check (matching the draft/markov path), or keep it and share one module-level tuple of supported target-head formats with the CLI choices; the asymmetric version is the one to avoid.
Evidence limitations: no CI checks on the head commit and I ran nothing; the behaviours above are established by reading the code and docs, and a pytest tests/cli run would confirm they are style, not behaviour, issues. I found no per-model branching, no new environment switch, and no Protobuf/Helios change, consistent with design-review principles 3, 10 and 13.
#2 [high] Nit: redundant getattr for target_head_quantization in CLI call sites
Severity: nit.
Locations (verified in code):
- ignition/cli/bench.py:170
target_head_quantization=getattr(args, "target_head_quantization", None) - ignition/cli/serve.py:210 (in
_export_hosts) - ignition/cli/serve.py:278 (in
_prepare) - ignition/cli/serve.py:479 (in
debug_serve)
Why it departs from the precedent: on the very next/adjoining lines the same functions pass args.force_moe_decode_a16, args.native_dense_activations, args.shard_hyperconnections, args.joint_tuning, args.row_shard_prefill directly (see bench.py:169-172, serve.py:209-211, 277-280, 478-480).
Why the getattr is unnecessary: --target-head-quantization is registered inside _preparation_arguments (ignition/cli/init.py:212-214), and that group is attached to export (line 50), bench (line 53) and debug-serve (line 60), so the attribute always exists on every args namespace these handlers see.
Why it matters: a getattr(..., None) silently degrades to "flag not requested" if the parser wiring ever breaks, which is exactly the failure the new test test_target_head_quantization_flag_is_model_agnostic (tests/cli/test_commands.py:102-113) was written to catch.
Fix: use args.target_head_quantization at all four sites.
Contrast (getattr IS the established pattern where a flag may genuinely be absent): getattr(args, "dcp_size", None) serve.py:197; the draft-head flags inside preparation.speculation (ignition/cli/preparation.py:169-171) and bench.py-style helpers, because bench/serve/export do not all define them.
#3 [medium] Nit: two access styles for target_head_quantization in rebuild_manifest.py
Severity: nit.
Location: ignition/preparation/rebuild_manifest.py
- line 302
if getattr(plan, 'target_head_quantization', None) is not None:(reproduction_arguments) - line 363
if plan.target_head_quantization is not None:(from_plan)
Local precedent: the same function uses direct access for real Plan fields — if plan.force_moe_decode_a16: (line 300), if plan.shard_hyperconnections: (306), if plan.row_shard_prefill: (308), if plan.joint_tuning: (310) — and getattr only where the attribute may not exist on the object (getattr(plan, 'native_dense_activations', False) line 304, getattr(plan, 'prompt_logprobs', False) line 266).
target_head_quantization is a declared field of Plan (ignition/planning.py:199), so both new lines should use plan.target_head_quantization is not None.
Fix: drop the getattr at line 302.