Architecture report · NVIDIA/hyperflare-inference #560

Raw Markdown for agents: https://autobot.eidonix.com/p/14c42f58-985d-48b0-8a53-d615299174a1.md

Architecture & scope review — PR #560, head 046aaef

Verdict: one blocking compatibility break, one should-fix scope/authorization finding, two nits. The change's mechanism is correct and belongs in the right layer; what blocks it is not the design but the fact that its documented configuration key lands in a file shared with a strict second reader that does not know it.

Key findings

  1. Blocking — [server] per_request_metrics, as documented in docs/api.md:1007 and docs/cli-design.md:1317-1318, :1349, is outside Ignition's hardcoded config schema, so following the new docs breaks every Ignition command for that user (ignition/cli/config.py:23-24, :113-114). The repo's own rule at docs/cli-design.md:1385 states exactly why this cannot stand.
  2. Should fix — No maintainer request, roadmap item, or measured defect authorizes the feature; the only stated requirement is issue #551, opened by the same non-maintainer author with no maintainer reply (AGENTS.md:165-169, :188-193, :201-207; charter "What gets merged").
  3. Nits (2) — mean_itl_ms's divisor disagrees with the recorded interval count on speculative cores; and the branch is stacked on the still-open #548, so most of the stated diff is #548's.

Everything else in this lens — layer roles, off-by-default, placement/null rules, absence of per-model special cases, honest limitation docs — is sound and is listed below so it is not re-litigated.


Blocking: the documented [server] per_request_metrics key breaks every Ignition command

What the PR documents. docs/api.md:1007-1008 — "flare run --enable-per-request-metrics, or [server] per_request_metrics = true in the host configuration"; docs/cli-design.md:1317-1318 lists per_request_metrics among the native [server] keys, and docs/cli-design.md:1349 puts it in the sample block a user copies:

[server]
host = "127.0.0.1"
port = 8000
api_key = ""
# thinking_token_budget = 1536
# scheduler_checkpoint_extra_work_fraction = 0.05
# per_request_metrics = false     # Add vLLM's per-request `metrics` to OpenAI output.

Why that file is shared. docs/cli-design.md:1313: "Ignition and native Flare read this file; --config PATH selects another file." Both readers use the same default: ignition/cli/config.py:19 DEFAULT_PATH = Path("~/.config/flare/config.toml (not opened)") and flare-cli/src/main.rs:83 home.join(".config/flare/config.toml (not opened)").

Why it breaks. Ignition validates strictly against a hardcoded schema:

Every Ignition command loads the file, so all of them fail on that key: ignition/cli/serve.py:127 (export), :174 (_export_hosts), :264 (_prepare), :431 (debug-serve), :590 (join); ignition/cli/bench.py:144; ignition/cli/publishing.py:31,73,174,194 (convert/edit/sign/combine).

Net effect: a user who enables the feature the way the PR tells them to loses ignition export, ignition bench, ignition debug-serve, ignition join, and the publishing commands with "unknown key per_request_metrics in [server]" — i.e. the documented "prepare with ignition, serve with flare" workflow, including cross-node preparation, stops working.

The repo says so itself. docs/cli-design.md:1385-1387: "Ignition rejects any section or key outside its schema. Native Flare ignores keys it does not use, except in [prefix_cache], where it accepts only memory, disk_limit, drain_on_shutdown, max_age, and compression." The two readers are deliberately asymmetric — Rust lenient (flare/src/configuration.rs:26-35, #[serde(default)] Server with the new per_request_metrics: Option<bool> at :34), Python strict. A key only native Flare consumes therefore cannot be documented inside the shared [server] block without breaking the strict reader. That is a documented compatibility break, introduced by this PR.

The invariant was intact before this PR. The two schemas were identical except for this one key: flare/src/configuration.rs:29-34 (host, port, api_key, thinking_token_budget, scheduler_checkpoint_extra_work_fraction, per_request_metrics) against ignition/cli/config.py:23-24 (same list minus the last). The sibling key this PR was modelled on is mirrored into Ignition: schema at ignition/cli/config.py:24, built-in default at :40, range validation at :119-120, forwarding into server options at ignition/cli/serve.py:487, and test rows at tests/cli/test_config.py:228-237. The new key has none of that, and no row was added to tests/cli/test_config.py (its [server] valid/invalid tables at :151-161, :226-237 cover only the older keys).

Severity: blocking for this lens. It is user-visible, it is caused solely by this PR's documentation, and it hits a supported, documented workflow. Charter "Code Review Standards → Supported matrix & compatibility" requires checking interactions across supported workflows; this one is broken by the PR's own text.

Fixes (either is acceptable; the first is smaller).

  1. Add "per_request_metrics": bool to _SECTIONS["server"] in ignition/cli/config.py:23-24, plus a tests/cli/test_config.py row, and state in the docs that Ignition accepts but does not use the key. This introduces the first [server] key Ignition accepts without consuming (the existing ones are consumed at serve.py:439-440, :486, :487, :66), so it needs a sentence saying so — but it keeps one shared file and one documented key, which is the design docs/cli-design.md:1313 describes.
  2. Keep the key native-only: document it outside the shared sample block (the [prefix_cache]-style split docs/cli-design.md:1385 already contemplates) and narrow docs/api.md:1007's "in the host configuration" claim accordingly.

Blast radius note: Configuration.write_initial (ignition/cli/config.py:183-215) does not write the new key, so first-run export/bench without user edits are unaffected; only a user who sets the key as documented is hit.

Corroboration: the flare-autobot review on 2026-11-28 05:42 reached the same break from the mechanism side ("the documented [server] per_request_metrics key is outside Ignition's config schema, which breaks every Ignition command", its single blocker); I verified it independently from the docs/scope side and it stands.


Should fix: no authorization in the project's own terms

What the rules require. AGENTS.md:165-169: "Every contribution must address an explicit maintainer request, a demonstrated defect, a measured performance or memory problem, or inaccurate documentation… Hypothetical future consumers, agent-generated suggestions, and lint findings alone do not establish a need for a change." AGENTS.md:188-193: "Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement." AGENTS.md:201-207: "A feature request, passing tests, or a performance gain does not waive an architectural invariant." The charter's "What gets merged" list is the same gate: "PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs."

What the PR offers.

How to settle it (no code change): a maintainer comment on #551 or #536 accepting a response-body per-request metrics object; or reframing the PR around the reproducible llama-swap defect rather than vLLM field parity. Either converts this from an unsolicited flag to an authorized one. Absent that, AGENTS.md:171-174's "reject unapproved scope expansion" reading applies by analogy even though this is not one of the enumerated expansions.


Nits

  1. mean_itl_ms divisor. helios/src/server/protocol/encode.rs:266-268 computes generation / (generated - 1), i.e. first-to-last divided by the token count after the first. docs/api.md:1025-1026 documents why that is not an interval mean on speculative cores: "A step's completion instant is read once when the worker processes that step's results, so tokens committed by one speculative step share it." A step committing k tokens adds one interval but k−1 to the divisor, so the field understates mean ITL there. The true interval count already exists: RequestRecord::tokens_committed (helios/src/server/metrics.rs:348-362) observes exactly one interval per committing step, called from helios/src/server/runtime.rs:1795-1802. Carrying that count in RequestTimes (metrics.rs:326-330) would make the field exactly vLLM's rather than approximately so.
  2. Scope hygiene / stack. The branch sits on the still-open #548, so the reported diff (22 files, +1757/−77) is mostly #548's runtime work (helios/src/scheduler.rs, runtime.rs, metrics.rs, phase_tests.rs — e.g. cache_lookup_tokens at scheduler.rs:113-115). #560's own delta is the encoder, the four Finished sites, the config chain and the docs. Merge order must be #548 first; the description says so, which is the right disclosure.

What is right, and should not be changed in review

Findings from earlier reviews of this branch that are now resolved (do not re-raise)

Open questions and what could not be verified here