Correctness report · NVIDIA/hyperflare-inference #560

Raw Markdown for agents: https://autobot.eidonix.com/p/04884e7f-13c5-474b-bfa1-2a6b53423666.md

Key findings

Reviewed at head 046aaef through the correctness lens. The mechanism itself is sound: the worker's instants are carried to the encoder on the terminal event, placement matches vLLM per protocol, and nothing is added when the option is off except copying instants into Finished.

Blocking

1. The documented way to enable the feature breaks every Ignition command. docs/api.md:1007-1009 tells users to enable the option with [server] per_request_metrics = true "in the host configuration", and docs/cli-design.md:1317-1319 lists per_request_metrics among the [server] keys native flare run applies, with the commented example at docs/cli-design.md:1349.

That file is shared. docs/cli-design.md:1313 states "Ignition and native Flare read this file", and :1385 says "Ignition rejects any section or key outside its schema". The Ignition schema is closed:

Every command loads that file through the loader that runs _validate: ignition/cli/serve.py:127 (export), :174, :264, :431, :590 (debug-serve), ignition/cli/bench.py:144 (not opened) (not opened — cited from search hits), ignition/cli/publishing.py:31 (not opened)/73/174/194 (not opened). So a user who follows the new docs and writes the line Ignition itself is supposed to generate gets UsageError: unknown key per_request_metrics in [server] from ignition export, debug-serve, bench, and convert — the model preparation path, which is the step before any serving.

The PR touched neither ignition/cli/config.py nor tests/cli/test_config.py, and tests/cli/test_config.py:151-177 already parametrizes unknown-key rejection, so nothing in CI would catch this either way.

Fix: add "per_request_metrics": bool to _SECTIONS["server"] at ignition/cli/config.py:23-24 (and decide whether debug-serve forwards it, below), plus a positive load case in tests/cli/test_config.py. One ignition export with the documented line in ~/.config/flare/config.toml (not opened) reproduces the failure.

Should fix

2. No way to turn the option off once a file or a saved group enables it. flare-cli/src/config.rs:73-75:

if !run.enable_per_request_metrics {
    run.enable_per_request_metrics = self.server.per_request_metrics.unwrap_or(false);
}

enable_per_request_metrics is a plain bool (flare-cli/src/cli.rs:649 for orbit run, :863 for run); there is no --no-enable-per-request-metrics and no tri-state, so an explicit false is indistinguishable from omission. Two consequences:

Fix: make it tri-state (Option<bool> via num_args(0..=1) / --enable-per-request-metrics[=BOOL]) or add --no-enable-per-request-metrics with overrides_with, and forward the explicit false to rank zero as a config override. At minimum, document the limitation beside the flag. No test exercises a false override: flare-cli/src/config.rs:222-233 only tests ""/true/false in the file with the flag turning it on.

3. The PR body still claims no clock read is added, but reserve_and_pack reads one per model step. helios/src/server/runtime.rs:2272: let scheduled_ns = super::observation::monotonic_ns(); runs for every reserve_and_pack regardless of the option, and for every request source that reaches this path (including SDK generate/generate_many). The PR body says, under Result, "This PR adds no clock read; the one monotonic read per scheduled model step comes from #548", and the Cost-shaped claim is that with the option off the only added work is copying instants — which is stated correctly elsewhere but contradicted by the earlier sentence. #548's own description already declares "one clock read per model step" as its cost.

Not a new defect in this PR's code, but a claim a reviewer will use to assess cost. Fix: attribute the read to #548 in the Cost section and drop "No clock read is added in either state" / keep the accurate "the one monotonic read per scheduled model step comes from #548" only.

4. For image requests the scheduling instant now lands after vision packing. helios/src/server/runtime.rs:2269-2285 stamps first_scheduled_ns after pack/pack_vision and conditioned_inputs_ready have run (runtime.rs:2228-2267), which is the right move for the failing-pack case, but it changes what the instant means on the vision path: queue_time_ms (encode.rs:265, arrival_ns → first_scheduled_ns) now includes image conditioning and time_to_first_token_ms (encode.rs:262) starts after it. docs/api.md:1018 defines queue_time_ms as "Model-queue arrival to the first model step that includes the request", and helios/model-contract.md:346-352 (not opened) describes "when the worker reserves and packs that step before submitting it". #548's review raised the same class of issue ("first_scheduled_ns is stamped before the Vision split"). Only reachable with per_request_metrics or return_token_timestamps on and an image request.

Fix: either stamp before the vision pack for vision steps (and document that a failed pack leaves it null anyway), or state in api.md/model-contract.md (not opened) that for image requests the instant follows image conditioning. Note the stamp now precedes only submit's guards (runtime.rs:2289-2295), which can still fail for that step, so the "leaves first_scheduled_ns unset" comment at :2269-2271 covers the pack but not the submit.

5. api.md: a permanently-null field described as an unreached instant, and an overstated n > 1 null.

Nits

6. ignition debug-serve and write_initial ignore the new key, and one doc sentence is stale. ignition/cli/serve.py:485-487 builds the same bootstrap options dict from configuration.get("server.*") for the keys it knows and does not set per_request_metrics; once the schema accepts the key (finding 1), ignition debug-serve will silently ignore a setting flare run honours while honouring its two neighbours. ignition/cli/config.py:183-215 (write_initial) writes the commented template, and this key is missing from it even though docs/cli-design.md:1311-1312 says the file is generated "with the resolved values present as comments". Separately, docs/cli-design.md:1385-1387 ("Native Flare ignores keys it does not use, except in [prefix_cache]") now has a second exception: native Flare uses [server] per_request_metrics and Ignition's schema would reject it. Add the key to serve.py's options and to the template, and update that sentence.

7. Charter/roadmap framing is another lens's territory — noted only so this lens does not double-report it.

Verified clean (recorded so it need not be redone)

Not verified / open questions

Coverage

Read in context at head 046aaef: helios/src/server/http.rs:130-660; helios/src/server/protocol/encode.rs:233-278, :640-790; helios/src/server/runtime.rs:280-330, :1770-1910, :2085-2175, :2210-2330; helios/src/server/metrics.rs:320-380; helios/src/execution/manifest.rs:60-120; helios/src/server/protocol/decode.rs:742-760; flare/src/configuration.rs:1-130; flare/src/settings.rs:1-110, :220-226; flare-cli/src/main.rs:60-400, :470-540; flare-cli/src/cli.rs:532-760, :1375-1400; flare-cli/src/config.rs:1-200, :219-233; ignition/cli/config.py:1-216; ignition/cli/serve.py:120-200, :460-505; tests/cli/test_config.py:140-200; docs/api.md:1000-1060; docs/cli-design.md:1305-1360. Not read: helios/src/server/protocol/tests.rs (not opened) new tests (diff text only), runtime/phase_tests.rs (not opened) new tests, response_lifecycle_tests.rs (not opened), helios/src/scheduler.rs (not opened) diff, ignition/cli/bench.py (not opened) and publishing.py (not opened) (loader use cited from search). Caveat: the GitHub diff contains the whole stacked #548 change, so #560's own lines were separated using #548's item description.