Re review report · NVIDIA/hyperflare-inference #560

Raw Markdown for agents: https://autobot.eidonix.com/p/9e2cb31b-6f4b-4ca0-a0fa-5c3e14f8f1f6.md

Recommendation: Ready To Merge

PR #560's per-request metrics implementation at f5d7078 is lean, well-tested, and sound, and both prior Round 3 blockers are resolved: the branch is now rebased onto main (c146d7be) and #548's fixed head (93fdc895, including the Worker::requeue first_scheduled_ns reset at helios/src/server/runtime.rs:2694-2696 and its conformance test), and the PR now reports passing --release crate tests, pytest tests/cli, and Layer 3 TLA+ lifecycle conformance (python3 verification/helios-lifecycle/check.py (not opened)). No new correctness, safety, or hot-path regressions remain. Merge #548 first (as the PR declares) so #560 lands cleanly as its own delta without pulling unreviewed #548 commits ahead of #548.

Merge Risk

Level: Medium

Walkthrough

Pre-merge Checks

Blockers

None.

Should Fix

None.

Subtract / Simplify

  1. Deduplicate queue_time_ms definition (docs/api.md:1021): Instead of restating queue_time_ms without the requeue reset rule already documented for the same instant at docs/api.md:338-341, point the table row at #health-and-metrics ("as defined for the request histograms, including requeue before the first generated token") so one definition governs both surfaces (and optionally note requeue alongside preemption in helios/model-contract.md:391-394).
  2. Share bucket-index lookup (helios/src/server/metrics.rs:291-300, :352-368, carried from #548): Extract Buckets::index(&self, value: u64) -> usize so Histogram::observe and InterTokenIntervals::observe share one lookup instead of duplicating the scan and coupling counts: [u32; 19] to TOKEN_SECONDS by convention.
  3. Deduplicate carried-total folding (helios/src/server/runtime.rs:1421-1425, :1933-1940, :2096-2100, :2223-2228, carried from #548): A small helper on Carried computing (prompt_tokens, generated_tokens, reused_prompt_tokens) would remove four manual unwrap_or / addition blocks across completion, cancellation, and park paths.

Nits

  1. Narrow Closes #551 → Part of #551: Issue #551 specifically proposes llama.cpp (not opened) timings (Messages coverage, top-level Responses placement, draft counts, and streams without include_usage), which #560's vLLM metrics format intentionally does not deliver. Using Part of #551 (or updating #551's scope) matches the Closes #536 → Part of #536 adjustment made on #548.
  2. Optional template round-trip test (ignition/cli/config.py:187, tests/cli/test_config.py): Parsing of [server] per_request_metrics is already tested (tests/cli/test_config.py:162-163, :178-184) and line 187 is valid TOML when uncommented, but Configuration.write_initial currently has no test in tests/. Adding a quick round-trip test would pin the generated template under python-cpu.yml (not opened).

Dropped on verification