Pre-test report — PR #560 "Emit vLLM-compatible per-request metrics from runtime instants"
Decision: DO NOT refer to hardware testing yet. Hold for code changes. The change is a sound design in the right layer, but five substantive issues need to be settled first, several of which change exactly the behaviour a hardware run would exercise — so a GPU test now would either be invalidated by the fixes or would burn hardware time confirming a wire shape that is likely to move. A minimal plan is given at the end so testing can start within a turn of the fixes landing.
PR state: open (intake reports draft), head ce44060, 18 files, +1898/−123, authored by an outside contributor with no merged PRs, stacked on unmerged draft #548, which is itself still "Changes Requested" after three review rounds. The PR carries no CI checks on head, no comments, and — critically — no live, GPU, gateway, Windows, or overhead evidence at all (its own "Not run here" list says so). The security screen is all-clear; I found no instruction-like or injected content anywhere in the PR body or diff.
1. Substantive issues that must be fixed before any hardware test
These are not nits. Each was verified in the code at head, not taken from the reviews.
(a) Public API leak — the new event field's type cannot be named outside the crate. GenerationEvent::Finished gained times: super::metrics::RequestTimes (helios/src/server/runtime.rs:97-108). RequestTimes is declared pub at helios/src/server/metrics.rs:326, but mod metrics; is private (helios/src/server.rs:16; only pub use metrics::Snapshot; at :33), while GenerationEvent is re-exported (helios/src/server.rs:34) from a pub mod server (helios/src/lib.rs:29). An out-of-crate consumer — the charter's roadmap in-process Rust SDK (#6) is exactly that surface — can neither read the field nor construct the variant. Before this PR Finished was all primitives. Fix is one line (re-export the type) or moving the instants off the public enum, but which one is chosen is an API decision that must precede testing, since the tests would be written against the resulting shape.
(b) The option has no configuration home, and the key it does accept is silently dropped. helios/src/server/config.rs:353-357 accepts per_request_metrics as a boolean, but flare/src/configuration.rs:26-34 (Server = host, port, api_key, thinking_token_budget, scheduler_checkpoint_extra_work_fraction) has no such field, and [server] derives #[serde(default)] without deny_unknown_fields (only PrefixCache denies, :48-56). So [server] per_request_metrics = true in config.toml (not opened) parses and is discarded with no error and no effect. That is the charter's rule broken one layer down ("Don't silently ignore API fields… Never accept it and quietly drop it") and AGENTS.md (not opened)'s "a setting has one of three homes". Consequence: the flare library and the WinUI desktop controller cannot enable the feature at all (grep confirms zero references to per_request_metrics in flare/src), and the two disclosed limitations live only in the PR description, not in docs/cli-design.md. Reviewers must pick a fix — add the config key, or reject the key explicitly — because either way the reachable surface changes, and a hardware test would currently have to enable the flag on the command line only.
(c) A stated cost claim is false. The PR says "No clock read is added in either state." reserve_and_pack adds super::observation::monotonic_ns() unconditionally per scheduled step, for every lane, in both option states (helios/src/server/runtime.rs:2253-2270). That block belongs to the stacked #548, but this description's Cost section owns the combined claim, and reviewers use that section to judge hot-path impact. Magnitude is trivial; the statement is checkable and wrong. Prose fix.
(d) Duplicated mechanisms and dead state — convention violations with silent-drift failure modes. helios/src/server/runtime.rs:1746-1757 re-spells GraphKind::samples() (helios/src/execution/manifest.rs:90-101, already consumed at runtime.rs:2988), so a future sampling graph kind would silently stop being counted by metrics.model_step. Timing.streaming (helios/src/server/protocol/encode.rs:80, set :250, guard :257) duplicates Encoder.streaming (:97) and its guard is provably unreachable, because http.rs:363 sets commits only when enable_request_metrics(streaming) returned true. A third redundant abstraction, generate_observed (runtime.rs:847-849), is generate_many_observed with a one-element vec whose only real caller immediately re-wraps the result (http.rs:368-372). None of these is a served-output defect; all three are the kind of "second spelling of an existing mechanism" the project's own rules reject, and two of them touch code the tests would cover.
(e) Authorization and evidence. The charter merges PRs addressing "a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs". The only named consumer is #551, filed by the same author; the only maintainer issue in the cluster (#536) asked for Prometheus histograms, delivered by #548. Two predecessors (#552, #553) were stopped on precisely this ground. Combined with (f) below, there is a live question about whether this is the wanted shape at all. A maintainer statement is a two-line decision and gates everything.
(f) The motivating use case is not actually served for the default streaming client — my addition, and the most decision-relevant finding. #560 says "Closes #551", but #551 asks for a llama.cpp (not opened) timings object on Chat/Completions/Messages/Responses, streaming and non-streaming, placed on the chunk that completes the last choice when include_usage is absent. #560 instead ships vLLM's metrics, never on Messages, and in a stream only on the final usage chunk, which exists only when the client sends stream_options.include_usage (helios/src/server/protocol/encode.rs:736-744; docs/api.md:1031-1036). #551 itself notes that a stream without include_usage leaves llama-swap's prompt rate "zero". So for the ordinary SDK streaming client the motivating -1 rates stay -1, and there is no --enable-force-include-usage equivalent (grep: no such flag anywhere). Testing this branch end-to-end against llama-swap would legitimately report the gap as a failure. Note also that the field the PR takes the most risk for — time_to_first_content_token_ms, which is the only reason GenerationEvent::Committed, the commits threading, and the event-budget change exist — is not read by llama-swap at all, and vLLM itself permits it to be null.
2. What is sound and does not need re-litigating
- Layering. Timing is carried from the layer that already reads the instants (the model worker) rather than being re-timed in the HTTP layer; the encoder decides placement once, before submission (
http.rs:361-363). This is the charter's "smallest footprint in shared code". - Event budget is correct.
output_event_capacity(runtime.rs:62-84) multiplies by1 + observed + commitswithchecked_mul, andCommittedis emitted atposition == 0before that step's token events (runtime.rs:1826-1834), so the content instant can never be latched from a later step. - Option-off path is clean in this diff's own scope: no key, no commit events, unchanged capacity (
http.rs:363). - Wire contract matches vLLM as claimed. Placement and null rules at
encode.rs:244-294agree withdocs/api.md:1005-1054and its field table at:1015-1022; the null-for-n>1, omitted-for-multi-prompt, never-Messages, Responses-completed/incompleterules are all implemented where documented. - One correctness nit is latent only, not live:
first_scheduled_nsis last-writer-wins athttp.rs:542, butdecode.rs:753-755rejectsn != 1for every protocol except Completions, andperformanceis Chat-only — so it cannot go wrong today. - Test infrastructure already reaches the response-queue invariant without a GPU:
verification/helios-lifecycle/check.py:214-224mutates_capacity: Some(capacity.clone()),\n arrival_ns:andasync_mpsc::channel(event_capacity); both strings survive #560's edits, so the budget change is still covered by a CPU-only mutation suite. This is a reason not to spend GPU time on it.
3. Expected value if a hardware test were performed now
Low, and mostly negative. The behaviour on the GPU path is largely undetermined by the GPU: every placement, null, and arithmetic rule is unit-tested at the encoder (helios/src/server/protocol/tests.rs:2350-2491) and phase-tested through a step-driven worker (helios/src/server/runtime/phase_tests.rs:4616-4871); the only things a real GPU adds are (i) that the instants are ordered sensibly on real steps, and (ii) that a real gateway sees the fields. (ii) would currently fail by design (finding f), and (i) would hold unless the clock-read claim in finding (c) hides something — which the GPU cannot settle anyway, since measuring it is a CPU/throughput question the PR explicitly declines to make.
4. Conditional minimal test plan (run only after fixes land)
One GPU, one host. Nothing in the diff touches TP>1, multi-host, KV pages, prefix cache, vision, or Windows.
Phase 0 — CPU, before booking hardware (~15 min). Head has no CI, so the author's "clean" claims are unverified: cargo check --features server (helios), cargo check (flare-cli), cargo test --features runtime-core,server --lib -- server::, and verification/helios-lifecycle/check.py. Expected one known failure needing FLARE_TEST_TEMPLATE_DIR.
Phase 1 — GPU, cn5, one gb202 TP1 core, one flare run per flag state (~20 min of GPU). Two servers (flag off / flag on), ten scripted requests:
- Chat body →
metricsat top level, six keys, content instant null. - Chat stream with
stream_options.include_usage→ one carrier frame,choices == [], all six non-null where reachable. - Chat stream without
include_usage→ key absent (this is the #551 gap; assert it so the limitation is documented and tested). - Completions stream
n = 2+include_usage→"metrics": nullin both body and stream. - Completions with two prompts → key omitted.
- Responses stream,
max_tokens=1→response.incompletecarriesmetrics. - Messages stream → never carries it.
- Chat with a reasoning model (
enable_thinking) →time_to_first_content_token_msstrictly greater thantime_to_first_token_ms. - Single-token request →
mean_itl_msnull. - Flag-off repeats of 1 and 2 → no
metricskey anywhere, andperformance.first_scheduled_nsabsent unlessreturn_token_timestampsis set. Plus in-script arithmetic:generation_time_ms == last − first,tokens_per_second ≈ generated / (last − scheduled), all fields non-negative,time_to_first_token_ms ≤ generation + queue.
Phase 2 — optional, 10 min, highest information per minute. llama-swap in front of the branch: one streamed request without include_usage (expect -1) and one with (expect real rates). That single row is the evidence that decides whether the shipped shape meets #551 — and it is the only evidence the PR family has ever had for this code path.
Deliberately not tested: throughput A/B for the flag (no performance claim is made; the added work is one u64 store plus one event per committing step), TP>1/multi-host (unchanged), Windows/WinUI (no code path changed — the enablement gap is finding (b), a code decision, not a hardware question), KV/prefix-cache behaviour, and vision.
Cost caveat that must be checked before booking: flare run requires an exported core and does not accept a recipe alias (docs/cli-design.md:1330-1335). Neither host's cached-model list contains a prepared core — the cached names (nvidia/Qwen3.8-Flash-Next-FP4-Local, nvidia/GLM-5.3-Flash-FP4-Local, etc.) are recipe checkpoints per docs/mtp-design.md:4-5 (not opened). So either confirm a published -FLARE gb202 TP1 core is downloadable (flare download, docs/cli-design.md:878-899) or budget ignition export GPU time; that preparation, not the test itself, dominates the cost. cn5 fits (1 of its 4 RTX PRO 6000 Blackwells; the author's own #548 live evidence used the same GPU family), and cn7/GB10 is only useful if the desktop/config path (finding b) is being validated — which is code review, not hardware.
5. What would turn this into a "refer to testing"
- A maintainer statement that per-request vLLM-shaped response metrics are wanted (finding e).
- A decision on #551: keep vLLM
metricsand either force usage in streams or document theinclude_usagelimitation against llama-swap; or droptime_to_first_content_token_ms/Committedfrom v1 for a much smaller footprint (finding f). RequestTimesre-exported or kept off the public event (finding a).per_request_metricsgiven a[server]configuration home or explicitly rejected, with the two limitations added todocs/cli-design.md(finding b).- Findings (c) and (d) fixed — one prose correction and three small deletions.
- #548 merged, and the branch rebased so the diff under review is #560's own (~+880/−72), not #548's.