Pre-test report — PR #548 "Add request latency histograms and process metrics" (revised at head a34c4d06)
Decision: HOLD — do not refer to a hardware test engineer. This supersedes my 2026-11-26 report on the same PR. The two new commits fixed most of what I raised, but one of them introduced a blocking build regression, and a second correctness problem survives that changes the exact numbers a tester would assert. Both must be settled before hardware time is worth spending.
- Expected value of a hardware test today: very low (~0.3/5) — down from ~0.5/5.
- Expected value after the fixes in §6: moderate and narrow (~2/5) — about 1.5 GPU-hours across two jobs.
- No throughput A/B is warranted. There is no GPU kernel, graph, op contract, prepared-metadata or artifact change in this diff. All added cost is a clock read + lane loop per submitted step, two atomic stores per committed token, and blocking procfs reads per text scrape — all far below measurement noise and all unreachable by a benchmark that needs a meaningful delta.
1. What changed since the last review
Head is now a34c4d06, three commits (10 files, +548/−25), still draft, zero CI checks on the head commit, no reviews, no maintainer engagement on the #536/#537/#548/#549 cluster.
Fixed at head (verified in code — do not re-raise):
flare_request_e2e_secondsis now observed once, in a single site athelios/src/server/http.rs:598-606, guarded by!count && !encoder.tool_limit_reached, immediately beforeyield Delivery::Complete. The two duplicate observations in the streaming (:621) and non-streaming (:635) arms are gone. Pinned byphase_tests.rs:4604-4613(count must be 0 on the tool-limit path).- All four docs/semantics findings I raised are now written down: the
process_*prefix exception (docs/api.md:288-290), "accumulate since server start" (:297), the e2e end-point and stream-drain caveat (:303-307), the vision-step caveat and the ≥2-generated-token eligibility for decode/TPOT (:309-314), and theprocess_*list (:318-321). - OS reads partly delegated:
process.rs:61usescrate::os::page_size()(eos/src/unix.rs:73-75),process.rs:70usescrate::os::raise_open_file_limit(0)(eos/src/unix.rs:138-165). Only the/proc/self/statandbtimeparsers remain local, and no prior implementation of those exists in the tree. parse_stathardened and its offsets corrected (process.rs:26-35, test at:142-147pins[11,12,19,20,21]).Worker::publishhoistedprompt_tokens/generated_tokens(runtime.rs:1993-1995), matchingWorker::complete.
2. Gate 1 — BLOCKING: the documented --features server build no longer compiles
This is new in d64c3ea3 ("Exclude cancelled responses and reuse host helpers") and is the single most important reason to hold.
helios/src/server/metrics/process.rs:68now readslet open_fds = crate::runtime_core::open_descriptors();helios/src/lib.rs:25-26declares#[cfg(feature = "runtime-core")] pub mod runtime_core;helios/Cargo.toml:21definesruntime-core = [...]as a separate feature;:25definesserver = ["dep:serde", "images", "grammar", "dep:axum", …]and does not enable it.- Neither
helios/src/server.rs:16(mod metrics;) norhelios/src/server/metrics.rs:12(pub(super) mod process;) is cfg-gated, so on Linux the module compiles withoutruntime_corein scope and fails to resolve. - CI cannot catch it:
.github/workflows/native-serving.yml:63(not opened) and:68both pass--features runtime-core,server(ubuntu-24.04 and windows-2022), which masks the missing edge. - It is a documented configuration:
docs/model-development.md:99-100(not opened) anddocs/scheduling-runtime-design.md:735-736(not opened) all use--features serveralone. - The shipping binary is not affected —
flare-cli/Cargo.toml:27,44use["runtime-core","server"]. - Search confirms this is the only ungated such reference under
helios/src/server: the other two areruntime/prompt_tests.rs:13(not opened) (test-gated atruntime.rs:3983) andsession.rs:10(not opened) (gated atserver.rs:26-27).
Fix (which is also the layering fix every lens asked for): move open_descriptors from helios/src/runtime_core/protection.rs:290-302 (not opened) into eos/src/unix.rs beside page_size, and call crate::os::open_descriptors() — crate::os is ungated (lib.rs:19, os.rs:8 re-exports flare_eos::*), so the break disappears and the duplicate procfs counter goes away with it. Gating the call instead would only hide the layering problem.
Caveat: I did not compile here; this is a cfg/feature-graph conclusion from the four files above. cargo check --manifest-path helios/Cargo.toml --features server settles it in seconds and should be run before any hardware is booked.
3. Gate 2 — BLOCKING for a test plan: e2e is per response, completions are per generation
flare_request_e2e_seconds now has one observation site, but it is once per HTTP response, while Metrics::request_completed (metrics.rs:452-480) runs once per generation.
- The e2e observation sits after the per-generation
whileloop in thedeliverystream block (http.rs:598-606). - Each choice/
nis a separateGeneration(http.rs:351-353,generations: Vec<Option<Generation>>, one decoder per index at:391-399, fed independently at:477-560), and each finished generation independently reachesrequest_completed(runtime.rs:1841-1846and:1996-2001). - Therefore for
n ≥ 2in the happy path:flare_requests_completed_total += nbutflare_request_e2e_seconds_count += 1.docs/api.md:303("counts each successful generation") is wrong, and so is the invariant a tester would otherwise write. - The cancelled-sibling case is also still wrong in the other direction: if choice i completes and choice j trips the shared
encoder.tool_limit_reachedflag (http.rs:471-476,:526,:563-567), the single end-of-response guard at:600discards e2e for the whole response including the generation the runtime counted as completed. flare_time_to_first_response_secondshas the same per-response granularity (latency.rs:116-127, guarded byrecorded), so it shares e2e's denominator but not the runtime histograms'.
Why this gates testing, not just merging: the assertions in §5 depend on whether e2e_count == completed_total or e2e_count == responses. A tester cannot write expected values until the owner picks one; the fix is either per-generation observation inside the GenerationEvent::Finished arm, or a docs sentence declaring e2e a per-response counter that only equals completed_total when n == 1.
Clean invariants that do exist (verified, and useful for the test plan): flare_request_prompt_tokens_count == flare_requests_completed_total always, because the prompt-token observation is unconditional at metrics.rs:460-461 — this is even pinned by the zero-token case at metrics.rs:1683. Queue needs first_scheduled_ns (:462); decode and TPOT need first_token_ns && generated_tokens > 1 (:470-479).
4. Other findings that must be settled before test values are stable
4.1 Scope authorization is still not on record
The work rests entirely on issue #536, an outside feature request framed as vLLM dashboard parity. The charter's "What gets merged" admits a maintainer request, roadmap item, reproducible bug, measured performance/memory issue, or bad docs; AGENTS.md:165-169 (not opened) and :201-207 say a third-party feature request is not authorization, and the charter lists vLLM under "Alternatives / Competitors". The counter-argument is real — observability already ships (docs/operating.md:47 (not opened) presents flare_host_cache_retirement_seconds as "the latency histogram", and #507 added persistent-worker metrics) — but it needs a maintainer to record it. A second consumer has appeared since my last report: #552 is stacked on this PR and reuses RequestTimes for client-visible timings, which strengthens the case and raises the cost of the still-undisclosed queue start point (runtime arrival, not HTTP admission).
4.2 Three histogram implementations in one module, nothing migrated
New Buckets/Histogram<N> (metrics.rs:214-298) sits beside HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETS (:200-210) with their .position(..).unwrap() in host_lookup_cost and 37-line render loop (:1029-1065), and beside the hand-written retirement block (:851-876). Three bucket encodings (u64 + u64::MAX sentinel; integer ms converted at render; f64 + scale + f64::INFINITY) and three _count/_sum orderings now coexist, against AGENTS.md:188-193 (not opened). The old path even keeps an unchecked unwrap() the new type removes. Migrate or declare the migration an explicit follow-up.
4.3 raise_open_file_limit(0) used as a getter
process.rs:69-70 reads RLIMIT_NOFILE through a mutating helper; it is read-only only because current >= desired short-circuits at eos/src/unix.rs:145-147 for desired == 0, leaving setrlimit at :160 unreachable. A metrics renderer whose correctness depends on that must not stand. Add clock_ticks() and open_file_limit() to eos/src/unix.rs and leave process.rs to parsing/formatting — which also removes the last inline unsafe libc::sysconf(_SC_CLK_TCK) at process.rs:58-60.
4.4 Remaining code-shape items (none test-decidable, all cheap)
- TTFR histogram owned by
latency::FirstResponseSamples(latency.rs:34-37,:101-108) and appended atserver.rs:671, while its siblingrequest_e2eis aMetricsfield rendered atmetrics.rs:1391./metricstext is assembled at three sites (metrics.rs:1391,server.rs:661-671,:672-709) with no stated rule. Move TTFR ontoMetricsand delete the forwarder, the hook and the special-case test call. process::metric(process.rs:47-54) duplicatesmetrics::metric(metrics.rs:1597-1602) minus the prefix and label escaping.- Six
if let (Some,..)fallbacks around sources that cannot fail on Linux (process.rs:72-125), two of them adjacent and identical (:81-98), plus thelet _ = text;non-Linux shim (:8-14). The repo's own precedent (protection.rs:298-301(not opened)) gates items instead. process_open_fdscounts the descriptor its ownread_diropens (process.rs:113documents the +1 rather than subtracting it); Prometheus convention and client-library exporters exclude it./proc/statis re-read in full forbtimeand_SC_CLK_TCKre-queried on every scrape, though both are process-lifetime invariants.
4.5 The PR description is stale in two places
- The "HTTP" bullet still says e2e is observed "except for
/v1/messages/count_tokens", omitting the tool-limit exclusion thathttp.rs:598-600,phase_tests.rs:4604-4613anddocs/api.md:303-306all now encode. - "nothing about serving changes" is still asserted, not measured; the live scrape still comes from a cherry-pick onto AzallazA fork
5ffe4d54(notmain), still includes the authoring agent's own traffic, and still does not reconcile (5 runtime observations vs 6 first-response observations). "CI covers the first two" remains an expectation — the head commit carries no checks.
5. What hardware would actually add
Already covered by CI — do not spend GPU time: .github/workflows/native-serving.yml (not opened) triggers on pull_request and runs cargo test helios --features runtime-core,server on ubuntu-24.04 and windows-2022, plus the eos and selene suites. The Windows compile of the new cfg-split file and the full helios suite are the CI legs' job; they simply have not run on this head.
Not covered anywhere — the one genuinely hardware-specific risk: the process_* arithmetic depends on sysconf(_SC_CLK_TCK) and the page size (process.rs:59-61, :78, :96, :105). cn7 is a GB10 / arm64 host where 64 KiB pages are common; a wrong page-size scaling makes process_resident_memory_bytes 16× off, and the shipped unit test (process.rs:150-176) only asserts resident > 0, virtual >= resident, and start-time within an hour — a 16× error passes it. This is the only check a GPU host adds that CI cannot.
Also worth one look, not a benchmark: /metrics now performs blocking reads of /proc/self/stat, the whole of /proc/stat, read_dir("/proc/self/fd") and two sysconf + one getrlimit per scrape on the axum worker thread (server.rs:709 → process.rs:57-126). The dashboard never calls render(), so this cost is bounded to scrapes — but the PR claims "nothing about serving changes", so one scrape during active decoding should confirm no stall.
Not worth hardware time: throughput A/B; format=json (Snapshot gained no fields, metrics.rs:69-130); the 60 s median window; bucket boundary math (unit-tested at metrics.rs:1648-1697); process_* on Windows (Linux-only by design); vision/image queue semantics (no vision-capable core on the available models).
6. Recommended path before any referral
- Fix the build: move
open_descriptorstoeos/, callcrate::os::open_descriptors(); confirm withcargo check --features serverand a green CI run on a branch head rebased ontomain(not the fork commit), including a lane that builds--features serveralone. - Decide the e2e denominator (§3) — per generation, or per response with the doc narrowed — and add an
n = 2test either way. - Maintainer records whether #536 authorizes the work, or the description is reframed around the defect.
- Move
clock_ticks()/open_file_limit()intoeos/; migrate (or explicitly defer) the host and retirement histograms ontoHistogram<N>; collapse the two metric writers and the two e2e sites; move TTFR ontoMetrics. - Correct the description's two stale claims and restate the live scrape as a smoke check with the fork-base caveat.
7. Minimal test plan — only after §6 items 1–2 land
Total budget ≈1.5 GPU-hours, two jobs, no load ramps, no repeated runs, no A/B.
Step A — cn7 (GB10, arm64), ~15–20 min: page-size and clock-tick arithmetic
- Serve
nvidia/Qwen3.8-27B-NVFP4(10 CPU / 60 GiB). Risk: the 60 GiB envelope may be too small for a 27B core; if bring-up fails on memory, record the arm64 page-size risk as unmitigated rather than burning time on workarounds. - One
curl -s localhost:PORT/metrics, compared against the same process's kernel view:process_resident_memory_bytes÷ 1024 vsVmRSSin/proc/<pid>/status— within a few percent; a 16×/64× gap is the page-size bug.process_virtual_memory_bytesvsVmSize× 1024.process_start_time_secondsvsps -o lstart=(within ~1 s).process_cpu_seconds_totalvs(utime+stime) / $(getconf CLK_TCK).process_open_fdsvsls /proc/<pid>/fd | wc -l(expect exactly +1 if the self-count is deliberately kept).process_max_fdsvsulimit -nof the serving process.
- Feed the scrape to
promtool check metrics— must parse as Prometheus 0.0.4. Pass/fail is numeric, one scrape, no load.
Step B — cn5 (4× RTX PRO 6000, amd64), ~45–60 min: scrape population and counts
Serve nvidia/GLM-5.3-Flash-NVFP4. Run one scripted, serialized workload with no other traffic (the README's own rule that /metrics deltas need quiescence), snapshotting before and after each case:
- Non-streaming, short prompt (
max_tokens32) → queue, prefill, prompt-token, decode, TPOT counts +1 each; e2e count +1; e2e_sum≥ decode_sum. - Streaming, ~2000-token prompt → prompt-token bucket lands in
le="2048"; TTFR count +1 and TTFR_sum≤ e2e_sum. max_tokens: 1→ decode and TPOT counts unchanged (thegenerated_tokens > 1guard) while prompt-token and completed counts +1 — the eligibility rule seen from outside./v1/messages/count_tokens→ every request histogram andcompleted_totalunchanged (thecountexclusion athttp.rs:131,:280-282).n = 2multi-choice, non-streaming, short → assert the decided rule from §6.2: eithercompleted_total+2 ande2e_count+2, or +2 / +1 with the doc amended. This is the cheapest live proof of the per-response vs per-generation divergence and needs no tool call.- Parallel-tool-limit cancel (two declared tools,
parallel_tool_calls: false, prompt forcing a second call) → per the decided rule:e2e_countunchanged andcancelled_total+1 (currently the code's behaviour). Needs a real model to emit a second call, which is why it cannot be a unit test alone. - Mid-stream client disconnect (open the SSE stream, read one frame, close) → assert the decided rule (currently: e2e unchanged, per
phase_tests.rs:4407-4434). - One
histogram_quantile(0.95, rate(flare_request_queue_seconds_bucket[5m]))computed in a shell over the scrape text, to prove the buckets are usable by the stated consumer. - While one long generation is in flight, issue one
/metricsscrape: 200, complete body, and the generation continues. No timing thresholds beyond "no stall".
Explicitly out of scope: sustained load, P99 comparisons against main, any A/B, repeated identical runs, multi-host/Orbit, format=json, the 60 s median window, vision queue semantics, and the Windows/Linux builds (CI's job).
8. Screening
Prompt-injection screening: all clear. I found nothing in the PR body, the three discussion messages (automated case-file notice, one bot review, one author reply asking for re-review), the code, HELP strings, tests or docs that is addressed to an agent or attempts to steer behaviour. The author's validation narrative, the AzallazA fork reference and the Discord: oystersmiles line are ordinary engineering disclosure. All PR content was treated as review material.
Bottom line: the feature is well-placed and its core arithmetic is sound, but this PR currently breaks a documented build configuration and ships a metric whose denominator does not match its documentation. Both are cheap to fix and both would otherwise be re-tested. Do not refer to hardware until §6 items 1–2 are closed; after that, Steps A and B above are the whole of what hardware can add, worth about 1.5 GPU-hours and no benchmark.