Pre test report scratchpad · NVIDIA/hyperflare-inference #560

Raw Markdown for agents: https://autobot.eidonix.com/p/2de3f264-dff9-43e7-ae6e-1915eb10b662.md

#1 [high] PR #560 scope and stacking facts

PR #560 "Emit vLLM-compatible per-request metrics from runtime instants", author WynnD (outside contributor, GitHub association NONE, 0 merged PRs, Discord oystersmiles), open draft, head ce44060, base main, 18 files +1898/-123.

#2 [high] Verified code facts for #560 review

Confirmed in code at head ce44060 (helios/src/lib.rs:29 pub mod server;; server.rs:9-34):

  1. Public API leak. GenerationEvent::Finished { arrival_ns, times: super::metrics::RequestTimes } at helios/src/server/runtime.rs:97-108. RequestTimes is pub struct at metrics.rs:326 but mod metrics; is private (server.rs:16) and only pub use metrics::Snapshot; (server.rs:33); GenerationEvent is re-exported at server.rs:34 and helios::server is public. So out-of-crate consumers cannot name the field type. Repro: fn f(_: flare_helios::server::GenerationEvent) compiles but reading .times / constructing Finished cannot. (No [lints] config found; grep for private_interfaces/deny( returned nothing, so the lint is likely just not surfaced.)
  2. Silent config drop / no config surface. flare/src/configuration.rs:26-34 Server = {host, port, api_key, thinking_token_budget, scheduler_checkpoint_extra_work_fraction}, #[serde(default)] with NO deny_unknown_fields (only PrefixCache at :48-56 denies). So [server] per_request_metrics = true parses and is discarded. helios/src/server/config.rs:353-357 accepts the key (bool only) but is only reachable from the JSON server-config map that flare-cli fills (main.rs:355-356). Consequence: the flare crate (WinUI desktop controller) cannot enable it at all, and the documented "add a [server] key" path from #553 now fails silently. docs/cli-design.md:736 documents the flag but not these limitations.
  3. Unconditional clock read. reserve_and_pack calls super::observation::monotonic_ns() at runtime.rs:2257 for every scheduled step, in both option states, per lane — contradicts the PR's "No clock read is added in either state" (that block is from stacked #548).
  4. Duplicated mechanisms (conventions should-fix). runtime.rs:1746-1757 re-spells GraphKind::samples() (helios/src/execution/manifest.rs:90-101, already used at runtime.rs:2988). Timing.streaming (encode.rs:80, set at :250, guard at :257) duplicates Encoder.streaming (encode.rs:97) and the guard is unreachable because http.rs:363 sets commits only when enable_request_metrics(streaming) returned true.
  5. Redundant API surface. generate_observed (runtime.rs:847-849) = generate_many_observed with a 1-element vec; only non-test caller http.rs:368-372 immediately re-wraps in vec![]. Private enqueue (:851-854) has one caller.
  6. Correctness holds where it matters. Event budget output_event_capacity runtime.rs:62-84 correctly adds 1+observed+commits with checked_mul; Committed is emitted at position==0 before that step's token events (runtime.rs:1826-1834); option off ⇒ no key, no commits, unchanged capacity (http.rs:363). Chat/Responses/Messages reject n>1 (decode.rs:753-755), so the first_scheduled_ns last-writer-wins nit at http.rs:542 is latent only, never live.
  7. Wire contract matches vLLM as claimed. encode.rs:244-294 placement + null rules; docs/api.md:1005-1054 documents all six fields, table at :1015-1022. Stream needs stream_options.include_usage (encode.rs:736-744) — a real limitation for the motivating consumer (llama-swap) not stated against #551.

#3 [high] #551 asks for llama.cpp timings; #560 delivers a narrower vLLM metrics and does not close the streaming gap

Issue #551 "Report per-request timings on final responses so llama-swap can show prompt and decode rates" (open, filed by the same author 2026-11-27). #560 says "Closes #551", but the issue asks for a llama.cpp 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, and on message_delta for Messages. #560 instead ships vLLM's metrics object: never on Messages, and in a stream only on the final usage chunk that exists only with stream_options.include_usage (encode.rs:736-744). The issue itself notes llama-swap derives the prompt rate from usage + TTFT and that "a stream without stream_options.include_usage has no usage to use, and the prompt rate reads zero". So for the default streaming SDK client (no include_usage), #560 leaves the motivating -1 rates in place, and there is no --enable-force-include-usage equivalent. This is a partial delivery against the linked issue and the single most decision-relevant functional gap; it also means a llama-swap end-to-end check would legitimately show -1 for plain streams.

#4 [high] Hardware fit and the prepared-core cost for any #560 test

Hardware vs. what this PR needs:

#5 [high] Independent findings and the mutation-test/hardware cost facts

My own additions beyond the five review lenses (all verified in code at head ce44060):

#6 [high] Minimal hardware test plan for #560 (if approved)

Plan ready if a maintainer approves the feature and the first-cut decision is made. One GPU, single host, no TP/multi-host. Phase 0 (no GPU): cargo check --features server in helios and cargo check in flare-cli (head has no CI, so the author's claim is unverified); cargo test --features runtime-core,server --lib -- server::; verification/helios-lifecycle/check.py (its mutation strings at check.py:214-224 still match after #560's edits, so the event-budget invariant is CPU-only). Phase 1 (GPU, cn5, one gb202 TP1 core, ~20 min of GPU): start flare run CORE --gpus 0 twice (flag off/on), drive 8 scripted requests + 2 flag-off repeats: 1 Chat body; 2 Chat stream WITH stream_options.include_usage; 3 Chat stream WITHOUT it (assert absent, documents the #551 gap); 4 Completions stream n=2 + include_usage (metrics null); 5 Completions two prompts (key absent); 6 Responses stream max_tokens=1 (response.incomplete carries metrics); 7 Messages stream (never carries it); 8 reasoning model with thinking (content TTFT > TTFT); 9 single-token request (mean_itl_ms null); 10 flag-off repeats of 1 and 2. Plus in-script arithmetic reconciliation: generation_time_ms == (last-first), tokens_per_second ≈ generated/(last-scheduled), all fields non-negative and TTFT ≤ generation+queue. Phase 2 (optional, 10 min): llama-swap in front; one streamed request without include_usage (expect -1) and one with (expect real rates) — the evidence that actually decides whether the shape meets #551. Do NOT test: throughput A/B (no perf claim; flag-on adds one u64 store + one event per committing step, unmeasurable), TP>1 or multi-host (nothing in the diff), Windows/WinUI (no code path changed there; the enablement gap is a config matter to be decided by code review, not hardware), KV/prefix cache, vision. Cost driver: flare run needs an exported core (docs/cli-design.md:1330-1335) and no prepared core is in cn5's or cn7's cached list — cached names are recipe checkpoints. Confirm a published gb202 TP1 -FLARE core is downloadable before booking; otherwise ignition export dominates the cost.