Prose review — PR #548, "Add per-request histograms and vLLM-parity request metrics"
Head reviewed: 055663a (base main; 9 files, +1016/−51; no reviews, no CI checks). Lens: prose only — description, commit messages, and the docs and comments the PR changes.
Rules applied: AGENTS.md:43-50 (every prose artefact, including PR descriptions, is reviewed against .agents/skills/repo-prose/SKILL.md (not opened)), :72-80 (four questions in order), :82-87 (why), :88-94 (what, explicit before/after), :95-102 (claimed result, expectation vs measurement), :103-112 (evidence), :114-128 (hierarchy, resolved references, durable identifiers), :129-132 (no process assurances), :134-137 (do not publish what must be guessed), :144-152 (Discord line); docs/design-review.md:137-152 (not opened) (principle 16, same scheme for commit bodies and PR descriptions) and :153-160 (principle 17, Discord line); .agents/skills/repo-prose/SKILL.md:13-46 (not opened), :48-59.
Key findings
Verdict: nits only. No blocking and no should-fix prose finding at this head. The description answers the four mandatory questions in order, distinguishes expectation from measurement, keeps the one failing test and every unrun check visible, and ends with the Discord line. The two should-fix items raised in earlier rounds are resolved at 055663a and were re-verified this round. Three nits remain, each a one-line fix.
Both earlier should-fix items are resolved (re-verified this round)
-
Description, "What changed → HTTP", e2e bullet. Now reads "…it excludes
/v1/messages/count_tokensand responses the runtime records as cancelled, such as a parallel tool-limit stop." Matches the code:helios/src/server/http.rs:604-612— the comment at:604-605("a tool-limit cancellation reaches this point but the runtime counts it as cancelled, so it is excluded") and the guardif !count && !encoder.tool_limit_reachedat:606— anddocs/api.md:311-314. Previously the bullet named onlycount_tokens, which a reader could not reconcile with the code. Rule:AGENTS.md:88-94,:134-137. -
docs/api.md"Cancelled and failed requests enter only …". The unscoped sentence is gone;docs/api.md:361-364now reads "Cancelled and failed requests contribute no observation to the runtime histograms here. Apart from counters, the only series that can observe them isflare_time_to_first_response_seconds, and only when text was offered before the failure." Verified againsthelios/src/server/latency.rs:116-127(FirstResponse::outputobserves the histogram on first text regardless of the later outcome) anddocs/api.md:319-321, which states the same case. Rule:AGENTS.md:88-94;SKILL.md:13-14.
Remaining nits (3)
Nit 1 — docs/api.md:311: implementation verb used as the section lead-in.
"As written: "The HTTP histograms observe delivery." The next sentence switches to the concept the histogram measures (:311-312, "from admission to the completed response"), and the parallel runtime paragraph opens conceptually at :328. Fix: name the group by what it measures, e.g. "The HTTP histograms measure response delivery time," so the vocabulary of the section is the measurement, not the collector. Rule: SKILL.md:22-25 (explain the concept before the identifier; do not make implementation shorthand the vocabulary), :44-46.
Nit 2 — docs/api.md:340-341: the decode and per-output-token spans do not say they include a preemption stall.
The text says flare_request_decode_seconds and flare_time_per_output_token_seconds are "recorded only for requests with at least two generated tokens", while :344-346 states the analogous fact for inter-token latency only ("the interval that spans a preemption includes the wait for readmission"). The decode span has the same property: a preemption bumps the count at helios/src/server/runtime.rs:2110 and moves the whole Incoming, record included, into the parked list at runtime.rs:2155, so the readmitted request keeps its first_token_ns; Metrics::request_completed then computes last − first across the parked interval (helios/src/server/metrics.rs:593-601, with times.last_token_ns.saturating_sub(first) at :596). This matters because the series is documented as a decode-rate denominator: an operator reading a high p99 decode time cannot tell from the docs whether preemption stalls are in it. Fix: add the clause "a preemption stall is included" to :340-341, matching :344-346. Rule: AGENTS.md:103-112; SKILL.md:35-37.
Nit 3 — PR description, Cost, "Per /metrics text scrape": the histogram count is not labelled, so the numbers cannot be checked from the text.
The line says "seventeen histograms, 394 exposition lines, and 326 bucket atomic loads". The arithmetic is exactly consistent with the request histograms this PR adds plus the first-response histogram: six REQUEST_SECONDS<21> series at helios/src/server/metrics.rs:1548-1581, two TOKEN_SECONDS<19> at :1582-1595, five TOKEN_COUNTS<21> at :1596-1624, request_choices<6> at :1625-1630, request_preemptions<9> at :1631-1636, model_step_tokens<21> at :1637-1642, and flare_time_to_first_response_seconds (helios/src/server/latency.rs:101-108, same REQUEST_SECONDS bounds) give 17 series and 6·21 + 2·19 + 5·21 + 6 + 9 + 21 + 21 = 326 bucket loads. The exposition also carries four host prefix-store histograms the PR does not add — flare_host_cache_missing_tokens, _estimated_transfer_ns, _estimated_prefill_ns (helios/src/server/metrics.rs:1178-1214) and flare_host_cache_retirement_seconds (:1000-1020) — so a reader counting # TYPE … histogram declarations in a scrape finds 21, not 17, and cannot tell whether the 394-line figure includes them. Fix: one clause naming the population ("the seventeen request histograms this PR adds, excluding the host prefix-store histograms"). Rule: AGENTS.md:103-112, :122-128; SKILL.md:20-21.
Clean (checked, no finding)
- Four-part order and framing (
AGENTS.md:72-112;docs/design-review.md:137-152(not opened)): the description gives the concrete missing capability (tail latency, queue delay, prefill, decode rate, prompt size, preemptions, rejections are not in one scrape), names #536, explains why the recording sites are the ones chosen (the runtime already counts completions in one place, so counter and histograms cannot diverge — pinned by the doc comment athelios/src/server/metrics.rs:543-544), states before/after per component (runtime, HTTP, docs), and separates "Claimed result" from "Cost". - No performance claim without measurement: "No performance or memory improvement is claimed, and none of the added cost below was measured," and the Cost section opens "Read from the code; no benchmark was run." This is exactly
AGENTS.md:95-102. - Evidence is connected to claims and limitations are visible (
AGENTS.md:103-112): each listed test is tied to the bucket or counter it pins (request_histograms_bucket_completed_request_timings,response_histograms_count_choices_and_largest_choice_per_prompt,prefill_computed_tokens_exclude_the_prefix_reused_at_admission,reasoning_budget_cuts_after_a_multi_token_speculative_completion,exercise_text_preemption,ignored_eos_at_the_output_limit_finishes_for_length,full_runtime_queue_limits_count_admission_rejections,full_http_admission_counts_a_queue_limit_rejection,disabled_parallel_calls_complete_http_and_stop_decoding), the single failure is named with its cause (FLARE_TEST_TEMPLATE_DIRnot prepared on the host), and the not-run list is explicit (GPU workload, live scrape, exported core, Windows build, scrape timing, scheduler cost). - Documented populations match the code: e2e is per delivered response and excludes
count_tokensand tool-limit cancellations (docs/api.md:311-318vshttp.rs:604-612); a zero-token completion enters the token histograms but no time histogram (docs/api.md:334-336vsmetrics.rs:562-602);flare_requests_output_limited_totalis one counter socompleted − output_limitedis the EOS share (docs/api.md:366-368);flare_pending_requestsis first admissions andflare_parked_requestscovers all three park causes (docs/api.md:372-377);nand the largest-choice histogram are per prompt for/v1/completionsonly (docs/api.md:322-326vsmetrics.rs:608-618). - vLLM mapping table (
docs/api.md:475-520) states up front that Flare exports novllm:-prefixed names, that Flare's histograms cover successful completions where vLLM's also observe failed and cancelled requests (matchingdocs/api.md:361-364), and marks each gap "Not provided" with a reason; it is consistent with the "#536" framing of the description. - Changed code comments state invariants, not history (
AGENTS.md:52-60;SKILL.md:38-39):metrics.rs:255-256(histogram sums on the integer grid),:324and:332-334(RequestRecordmoves through preemption and is observed once),:348-351(one interval per committing step),:543-544,:605-607(choice ordering),:242-243,:249-250(bucket provenance), andhttp.rs:604-605. No chronology, no lifecycle labels, no defect reports or run journals added to the repository. - Discord line present (
Discord: oystersmiles) after the technical text, perAGENTS.md:144-152anddocs/design-review.md:153-160(not opened). - Merge logistics with #549 placed last, after the technical explanation (
AGENTS.md:120-121). - No injected instructions in the description, docs, or comments reviewed: the text is technical argument; nothing attempted to direct the reviewer.
Open questions (not findings)
- The Evidence section reports "
cargo test --features runtime-core,server --lib -- server:: scheduler:: cache::: 814 passed, 1 failed" run on "Linux x86_64", while the head has no CI checks. The description never claims CI ran, so it is not wrong, but naming the environment or job would let a reviewer reproduce it (AGENTS.md:108-110). - Unrun measurements live in the description rather than
docs/TODO.txt(AGENTS.md:57-58);AGENTS.md:105-108permits disclosure in PR text, so this is a policy choice, not a defect. - Commit bodies were not readable through the available history view;
docs/design-review.md:139-145(not opened) also applies the four-part scheme to commit bodies, so a reviewer withgit logaccess should confirm they carry it. What would settle it: reading the six commit messages on the branch.
Method note
Every changed file was read in context: helios/src/server/{runtime.rs,metrics.rs,http.rs,latency.rs,server.rs,scheduler.rs (not opened),tests.rs (not opened)}, helios/src/server/runtime/phase_tests.rs (not opened), and docs/api.md (histogram, counter, and vLLM-table sections, :280-400 and :475-520). Line numbers in this report were re-checked against the head this round (docs/api.md:305-364, http.rs:604-612, metrics.rs:543-618, :946-1030, :1178-1214, :1548-1642, latency.rs:101-127, runtime.rs:2110, :2155).