#1 [high] Rules cited: charter, AGENTS.md, design-review.md principles
Charter (read_charter):
- "Solve the right problem in the right place... Look for the smallest footprint in shared code, or a way to solve it without new code at all."
- "Stay focused... not interested in piling on extra model aliases, random switches"
- "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)."
- "Keep the runtime small and model-agnostic... Standard model extensions like RoPE scaling or YaRN should be implemented once via a single general mechanism"
- Code Review Standards: "No per-model special cases or flags: Keep shared runtime layers general rather than adding model-specific branches or flags."
AGENTS.md:
- L155-207 contribution scope & rejection criteria: "Reject unsupported abstractions and churn. Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement."
- L194-199: "Require focused, meaningful validation... source-text checks and mocks that bypass the behavior cannot establish runtime correctness."
- L446-456 Configuration: "A setting has one of three homes: the recipe declaration, the configuration file, or a command-line flag... A setting that only experiments need is an advanced flag carried through the plan into the recipe's PreparationConfig, so the plan, its printed report, and its recorded measurements describe what was prepared."
- L448-451: env-var behavior switches prohibited.
- L72-140 required PR descriptions (why/what/benefit/evidence), "Never attribute a combined result to one PR."
- L142-153 Discord line required.
docs/design-review.md:
- P1 (L16-26) keep Helios simple; P2 (L27-30) Python prepares, Rust serves.
- P3 (L31-52) shared mechanisms; "Reject per-model boolean policy flags, including supports_, can_, and default-false opt-ins."
- P9 (L76-79) "Preserve checkpoint precision and numerical contracts. Read quantization from checkpoint metadata. Never silently requantize or rescale weights" — explicit opt-in flag is the sanctioned way.
- P10 (L80-90) explicit configuration: recipe declaration, config file, CLI flag; env switches prohibited.
- P12 (L97-105) evidence honestly; "performance claims require equivalent baselines... actual Helios service measurements"; "ignition debug-serve timings are diagnostic only."
- P13 (L106-113) preserve core compatibility: "Protobuf additions must preserve existing behavior through compatible defaults."
- P16 (L137-152) prose; P17 (L153-159) Discord line (present: "Discord: nero").
docs/performance-work.md L9-13: use ignition export + flare run; debug-serve timings cannot establish comparative performance. docs/runtime-core-design.md L345-401: PreparationManifest carries Ignition-only options as scoped PreparationParameter entries; "Adding or removing an Ignition-only option requires no changes to runtime_core.proto, core.proto, or Helios." TARGET_WEIGHT scope = target weight conversion/packing semantics "such as online_mxfp8, resolved online_mxfp8_scope, and expert_scale_compression" (L374-377) — new target_head_quantization is not added to that list. docs/cli-design.md L443-476 preparation flag table; L474 --online-mxfp8 says "Existing packed weights, normalization, convolutions, selectors and target vocabulary weights retain their precision."
#2 [high] Research summary
Reviewed PR #518 (10 files, +126/−10) through the architecture/scope lens against the charter, AGENTS.md, docs/design-review.md, docs/runtime-core-design.md and docs/cli-design.md. Every changed file was read in context, plus the call sites (derive, _prepare, _export_hosts, debug_serve, bench.run, reproduction_arguments, from_plan, Plan.__post_init__/to_dict) and the Rust consumers of PreparationManifest scopes (helios/src/runtime_core/preparation.rs, helios/src/core/conversion.rs). Findings, recorded below in lieu of scratchpad notes (time ran out before I could write them as entries).
What is right (no action). The manifest plumbing is architecturally sound: target_head_quantization is added as a PREPARATION_PARAMETER_SCOPE_TARGET_WEIGHT parameter and omitted when unset, so nothing in runtime_core.proto (not opened), core.proto (not opened) or Helios changes, exactly as docs/runtime-core-design.md:345-401 prescribes ("Adding or removing an Ignition-only option requires no changes to runtime_core.proto (not opened), core.proto (not opened), or Helios"); absence means checkpoint precision, so previously exported cores still combine and reuse (design-review P13). Precedent for the recipe-gated opt-in shape (target_head_quantizations tuple + UsageError on undeclared formats) is draft_head_quantizations/draft_body_quantizations in ignition/declaration.py:277-280 and ignition/planning.py:487-495, and the flag is a CLI flag rather than an environment switch, as P10 requires. The PR description has the four required parts, distinguishes the combined-stack numbers from this PR's own contribution (AGENTS.md:95-101), and ends with the mandatory Discord line.
Should fix 1 — the flag's whole point is not reflected in memory planning. Plan.weights_bytes is the planner's only weight estimate and takes just expert_scale_compression (ignition/declaration.py:363-374), fed from checkpoint.device_bytes or checkpoint.scale_compressed_device_bytes. target_head_quantization is in the plan but never reaches it (ignition/planning.py:581-589, 524-533), so plan.fits, the page count, the capacity-error options (ignition/planning.py:697-725) and the printed plan all still reserve the full BF16 head. The PR's own claimed ~600 MiB saving on TP1 therefore cannot be planned: on a memory-tight host the CapacityError fires for a configuration that the flag would in fact make fit, and the exported page capacity understates what the core will really have. The repository already has the mechanism for exactly this — Checkpoint.scale_compressed_device_bytes (ignition/declaration.py:85-86) exists so an optional weight-encoding choice changes weights_bytes. Fix: declare the quantized head bytes on the checkpoint (or subtract them in weights_bytes) and pass the setting through fit/plan.
Should fix 2 — the plumbing bypasses planning.plan, unlike every sibling flag. derive plans first and then repairs the plan with replace(result, target_head_quantization=...) (ignition/cli/preparation.py:60-75), and _prepare/_export_hosts/debug_serve do the same (ignition/cli/serve.py:192-211, 461-480, 479). row_shard_prefill, online_mxfp8, language_model_only, expert_scale_compression and the draft-head settings are all parameters of fit/plan and validated there before GPU selection (ignition/planning.py:445-453, 581-589, 599-632). Because validation lives only in Plan.__post_init__ (ignition/planning.py:289-293) it runs after the planner has already reasoned about capacity and possible CapacityErrors, so a user combining an unsupported format with a tight host sees a memory error rather than the clear UsageError, and no other planning.plan caller (including fit) can express the setting. Fix: add the parameter to fit/plan and validate with the other recipe-gated flags.
Should fix 3 — the docs claim support and a memory result this repository cannot provide. docs/cli-design.md:454 says the flag prepares the head "for recipes that declare target_head_quantizations (such as Qwen3.8 Flash Next with a BF16 checkpoint head), freeing the temporary BF16 vocabulary weight after conversion". No recipe in this repository declares target_head_quantizations — recipes live in local-inference-lab/hyperflare-recipes (AGENTS.md:9-13; the recipe PR is #40 there, unmerged) — so in this repo the flag is reachable but inert: every in-tree recipe rejects it, and nothing here verifies that the conversion or the "temporary BF16 weight" release happens. AGENTS.md:194-199 requires that partially wired features not be presented as supported, and design-review P16 requires no unsupported claims in changed prose. Fix: state that the flag has no effect until a recipe declares the capability (drop the named model and the unmeasured conversion detail), or land this only with the recipe.
Nit 1 — discoverability. recipe_help (ignition/cli/help.py:76-91) surfaces --expert-scale-compression, --mla-compute-mode, --no-context-parallel, --no-stream-overlap and --mixed-prefill from declarations, but not the new capability, so ignition export MODEL --help gives no hint that --target-head-quantization mxfp8 applies; --help says "for recipes that declare it" with no way to find out except rejection. (The draft/markov head flags share this gap, so it is a nit, not a regression.)
Nit 2 — the design doc listing TARGET_WEIGHT semantics is not updated. docs/runtime-core-design.md:374-377 enumerates the parameters that live in PREPARATION_PARAMETER_SCOPE_TARGET_WEIGHT (online_mxfp8, online_mxfp8_scope, expert_scale_compression); the new key belongs in that list.
Nit 3 — builder churn in bench. ignition/cli/bench.py:243-252 rewrites an existing flat dict comprehension into nested splats to append one optional key, where plan.to_dict() already omits it when unset; a conditional add after the comprehension reads better and matches to_dict's own pattern.
Nit 4 — access-style inconsistency. ignition/preparation/rebuild_manifest.py:302-303 guards with getattr(plan, 'target_head_quantization', None) while :363-364 reads plan.target_head_quantization directly, and the flag is a real Plan field (ignition/planning.py:199), so the defensive form is dead weight.
Nit 5 — fourth parallel precision flag. Target head, draft head, draft body and Markov head are now four separate flag/declaration/validator triples with identical shapes. Nothing here blocks the PR (the pattern predates it), but the charter's "implemented once via a single general mechanism" is drifting for projection-precision selection.
Nit 6 — validation gap. Tests cover the parser and derive only (tests/cli/test_commands.py:102-138); the multi-host _export_hosts path and debug_serve forwarding (ignition/cli/serve.py:210, 479) are untested, and only a GPU export could show the conversion and the memory saving the docs claim. The PR discloses the unrun Rust checks honestly.
Nothing in the diff crosses the Python/Rust boundary, adds per-model branches to Helios, or introduces an environment switch, so I found no blocking architectural violation; findings 1-3 are the ones I would require before merge.
#3 [high] Should fix: target head quantization never reaches memory planning (weights_bytes)
Severity: should fix. Files: ignition/planning.py:199 (new field), ignition/planning.py:445-453 (fit signature), ignition/planning.py:524-533 (Plan construction), ignition/declaration.py:363-374 (weights_bytes), ignition/declaration.py:85-86 (Checkpoint.scale_compressed_device_bytes).
What is wrong: Plan.weights_bytes is the planner's only weight estimate and is computed by Recipe.weights_bytes(checkpoint, world_size, speculation, expert_scale_compression) from checkpoint.device_bytes or checkpoint.scale_compressed_device_bytes[...] (declaration.py:363-374). fit/plan forward expert_scale_compression into it but the new target_head_quantization field is never passed anywhere (planning.py:524-533 constructs Plan without affecting weights; fit/plan take no such parameter — planning.py:445-453, 581-589). So plan.fits (planning.py:383-385), the page count (planning.py:534-540), the _shortfall options list (planning.py:697-725) and the printed plan all still reserve the full BF16 vocabulary head.
Why it matters: this is the flag's entire stated purpose — the PR claims "~600 MiB saved on TP1" from not retaining the BF16 lm_head. Without a plan-side estimate, a host that would fit with the flag still raises CapacityError and offers the user no option; when it does fit, exported capacity is understated. AGENTS.md:452-456 requires that a preparation setting be "carried through the plan into the recipe's PreparationConfig, so the plan, its printed report, and its recorded measurements describe what was prepared" — here the plan describes the setting but not its resource effect.
Fix: declare the quantized head's resident bytes on the checkpoint (as scale_compressed_device_bytes does for scale compression) or subtract them inside Recipe.weights_bytes, and pass the setting through fit/plan from derive, _prepare, _export_hosts, debug_serve and bench. Settle with a planning test asserting fit(..., target_head_quantization="mxfp8").weights_bytes < fit(...).weights_bytes for a recipe declaring the head bytes.
#4 [high] Should fix: flag is repaired onto the Plan after planning, bypassing planning.plan/fit
Severity: should fix. Files: ignition/cli/preparation.py:57 (derive signature), ignition/cli/preparation.py:60-75 (plan-then-replace), ignition/cli/serve.py:192-211 (_export_hosts), ignition/cli/serve.py:274-290 (_prepare), ignition/cli/serve.py:461-480 (debug_serve), ignition/cli/bench.py:162-177; compare ignition/planning.py:445-453 and 581-589, and the sibling validations at planning.py:599-632.
What is wrong: derive calls planning.plan(...), which has no target_head_quantization parameter, then patches the result with replace(result, ..., target_head_quantization=target_head_quantization) (preparation.py:70-75). _prepare, _export_hosts, debug_serve and bench do the same on their own plans (serve.py:206-211, 475-480, 479, bench.py:170). By contrast row_shard_prefill, online_mxfp8, online_mxfp8_scope, language_model_only, expert_scale_compression, mla_compute_mode and the draft-head settings are parameters of fit/plan and are validated there before GPUs are selected. The only validation of the new flag is Plan.__post_init__ (planning.py:289-293), which now runs on a plan that has already been sized and may already have raised CapacityError.
Why it matters: a user who passes an unsupported format on a memory-constrained host gets a memory error instead of the intended UsageError naming the alias, and the message depends on free-memory state. It also means no other planning.plan/fit caller — including fit itself, which is the planning entry point used by tests and replicas — can express the setting at all, so the option exists in the CLI layer but not in the planning layer whose job it is (AGENTS.md:452-456; charter "Solve the right problem in the right place").
Fix: add target_head_quantization: str | None = None to fit and plan, validate it next to the draft-head loop (planning.py:487-495) raising the same UsageError, keep the Plan.__post_init__ check as the invariant it is, and delete the replace(...) argument plumbing plus the getattr(args, ...) guards in bench.py/serve.py.
#5 [high] Should fix: docs claim Qwen3.8 Flash Next support and a conversion effect no in-tree recipe provides
Severity: should fix. File: docs/cli-design.md:454 (new row).
Text: "| --target-head-quantization {mxfp8} | Prepare the target vocabulary head as MXFP8 for recipes that declare target_head_quantizations (such as Qwen3.8 Flash Next with a BF16 checkpoint head), freeing the temporary BF16 vocabulary weight after conversion. Recipes that do not declare the requested format reject it. Command line only; changing it requires re-export. | Checkpoint precision |"
What is wrong: no recipe in this repository declares target_head_quantizations — recipes live in local-inference-lab/hyperflare-recipes (AGENTS.md:9-13), and the companion recipe PR (local-inference-lab/hyperflare-recipes#40) is unmerged. So in this repository every in-tree recipe rejects the flag and nothing verifies the conversion or the "freeing the temporary BF16 vocabulary weight after conversion" behaviour. The named model plus the memory effect read as present qualification.
Why it matters: AGENTS.md:52-60 ("State support as present qualification... Record unresolved defects, unrun checks, and pending measurements in docs/TODO.txt") and AGENTS.md:194-199 ("Do not present scaffolding or partially wired features as supported"); design-review P16 requires no unsupported claims in changed prose. Also note docs/cli-design.md:474 currently states --online-mxfp8 leaves "target vocabulary weights" at checkpoint precision, so the two rows must not contradict each other once this lands.
Fix: state that the flag only takes effect for a recipe that declares the capability (external recipe repositories), drop the named checkpoint and the unmeasured conversion detail, or land this PR together with the recipe and cite the measurement in the recipe's own documentation.
#9 [high] Approved-by-lens aspects: manifest plumbing and recipe-gated flag shape are correct
No blocking architectural violation found. Verified positives to state in the report:
- Manifest plumbing follows docs/runtime-core-design.md:345-401 exactly: the option is an Ignition-only
PreparationParameterunderPREPARATION_PARAMETER_SCOPE_TARGET_WEIGHT(ignition/preparation/rebuild_manifest.py:363-364) omitted when unset, soruntime_core.proto,core.proto, helios/ and heliopause/ need no change; Rust compares scopes generically (helios/src/runtime_core/preparation.rs:310-347). Absence means checkpoint precision, so default-precision cores still combine (compatible_for_combine) and reuse (compatible_for_weight_reuse) — design-review P13, AGENTS.md:431-444. - Opt-in shape mirrors existing precedent:
target_head_quantizations: tuple[str, ...] = ()on Recipe (declaration.py:278), format validation inRecipe.__post_init__(declaration.py:328-329), rejection namingcheckpoint.aliasinPlan.__post_init__(planning.py:289-293) — same asdraft_head_quantizations/draft_body_quantizations(planning.py:487-495). - It is an explicit CLI flag carried through the plan, not an environment switch: satisfies design-review P10 (L80-90) and AGENTS.md:446-456.
- Opt-in rather than silent requantization: satisfies design-review P9 "Never silently requantize" (L76-79), and keeps the Rust boundary clean per P1/P3.
Plan.to_dict()andreproduction_argumentsrecord it only when set (planning.py:411-412, rebuild_manifest.py:302-303), and the startup status line reports it (serve.py:314), matching AGENTS.md:452-456.- PR description has the four required parts in order, separates the combined core+recipe stack numbers (abbench tok/s, quality gate) from this PR's own contribution, and ends with
Discord: nero(design-review P16 L137-152, P17 L153-159, AGENTS.md:72-140). getattr(args, ...)guards in bench.py/serve.py exist becausebenchandjoinshare parsers; harmless but see the should-fix onreplaceplumbing.
#6 [low] Nit: recipe_help does not list the new optional feature
Severity: nit. File: ignition/cli/help.py:76-91.
recipe_help builds an "Optional features for this recipe" list from declarations: --expert-scale-compression, --mixed-prefill, --no-context-parallel, --no-stream-overlap. The new recipe-declared capability is not surfaced, so ignition export MODEL --help gives no way to learn that --target-head-quantization mxfp8 applies; the only discovery path is trying it and being rejected ("for recipes that declare it", ignition/cli/init.py:212-214). Add a line when recipe.target_head_quantizations is non-empty, e.g. --target-head-quantization mxfp8 (recipe declares it).
Note: the draft-head/draft-body/Markov head flags share this gap, so this is a consistency improvement rather than a regression.
#7 [low] Nit: runtime-core-design TARGET_WEIGHT parameter list not updated; bench builder churn; getattr inconsistency
Severity: nit (three).
-
docs/runtime-core-design.md:374-377 enumerates the parameters that live in
PREPARATION_PARAMETER_SCOPE_TARGET_WEIGHT("such asonline_mxfp8, resolvedonline_mxfp8_scope, andexpert_scale_compression").target_head_quantizationis now added in that scope (ignition/preparation/rebuild_manifest.py:363-364) and belongs in that list; the surrounding paragraph (L386-391) is also where Ignition's resolved defaults are described. -
ignition/cli/bench.py:243-252 rewrites an existing flat dict comprehension into nested
**{...}splats to append one optional key, whileplan.to_dict()(planning.py:411-412) already omits the key when unset. A plainif "target_head_quantization" in preparation: ...after the comprehension would be shorter and matches howto_dictitself handles it. AGENTS.md:188-193 treats unsolicited restructuring as churn, so keep the diff minimal. -
ignition/preparation/rebuild_manifest.py:302-303 guards with
getattr(plan, 'target_head_quantization', None)while :363-364 readsplan.target_head_quantizationdirectly. The field is a realPlanfield (planning.py:199), so the defensive form is dead weight; pick one style (the neighbouringrow_shard_prefill/mla_compute_modelines use plain attribute access).
#8 [low] Nit: fourth parallel precision flag; validation coverage gaps
Severity: nit.
A. Mechanism drift. --target-head-quantization is the fourth instance of one shape: a Recipe.<x>_quantizations tuple, a Plan/Speculation <x>_quantization field, a UsageError on undeclared formats, a to_dict entry, a reproduction_arguments pair and a PreparationManifest parameter — see declaration.py:277-280, planning.py:487-495, rebuild_manifest.py:286-291/418-421. Nothing here blocks the PR (the pattern predates it and Helios stays generic), but the charter's "implemented once via a single general mechanism that follows the published spec" and design-review P3's shared-mechanism principle are drifting for projection-precision selection. Worth a maintainer decision on a single "projection precision overrides" declaration rather than a fifth flag later.
B. Coverage. Tests added in tests/cli/test_commands.py:102-138 cover parser defaults/help and derive forwarding + rejection; tests/cli/test_planning.py:212-253 cover Recipe/Plan validation and the manifest round-trip. Not covered: multi-host _export_hosts forwarding (serve.py:210), debug_serve forwarding (serve.py:479), and the bench configuration output (bench.py:250-251). Only a GPU export with a declaring recipe can show the conversion and the claimed memory saving; the PR discloses the unrun Rust checks honestly and no Rust/Protobuf files changed, so cargo test genuinely does not apply.