Pre-test report — PR #548 "Add request latency histograms and process metrics"
Decision: HOLD. Do not refer to a hardware test engineer yet.
No blocking defect was found — the change is observability-only and its core arithmetic is correct — but it is not testable-clean: it has unresolved scope authorization, a layering violation that all lenses agree requires moving code into eos/, three coexisting histogram implementations, and four code-vs-docs semantics conflicts that a tester would have to pin down as expected values. Any of those fixes changes either the code under test or the numbers the test would assert, so hardware time spent now is likely wasted.
Expected value of a hardware test today: low (~0.5/5). Expected value after the fixes below: moderate and narrow (~2/5) — roughly 1.5 GPU-hours, concentrated on one arm64/GB10 page-size check the CI matrix cannot reach plus a scripted scrape-population check. There is no GPU-kernel, graph, op-contract, artifact or prepared-metadata change here, so no throughput A/B is warranted.
1. What the PR does
Draft, head ebecef1, base main, 8 files, +545/−20, author WynnD (first-time contributor, association NONE), Discord oystersmiles, closes issue #536. No comments, no reviews, zero CI checks on the head commit (repo CI does run on pull_request — see §4).
- New generic fixed-bucket
Buckets/Histogram<N>(helios/src/server/metrics.rs:212-298) and six new histogram families:flare_request_queue_seconds,flare_request_prefill_seconds,flare_request_decode_seconds,flare_time_per_output_token_seconds,flare_request_prompt_tokens(all recorded inMetrics::request_completed,metrics.rs:452-480) plusflare_request_e2e_seconds(http.rs:614-617,:631-632) andflare_time_to_first_response_seconds(latency.rs:33-37,:107-120, rendered fromserver.rs:671). RequestTimesstamped onIncoming(runtime.rs:190-193,:913,:1774-1775,:2189-2203); both former directcompleted.fetch_addsites now callrequest_completed.- New Linux-only
helios/src/server/metrics/process.rs(184 lines) emittingprocess_cpu_seconds_total,process_resident_memory_bytes,process_virtual_memory_bytes,process_start_time_seconds,process_open_fds,process_max_fds, rendered atserver.rs:709. docs/api.md:296-318documents the series.
Prompt-injection screening: all clear. I found no agent-directed content in the PR body, comments, code, HELP strings, tests or docs. The body's validation narrative and Discord: oystersmiles contact line, and the reference to an AzallazA fork commit, are ordinary engineering disclosure; the only non-technical discussion item is the automated "case file has been opened" comment. I treated all PR content as review material.
2. Gating findings (must be resolved before hardware time is spent)
2.1 Scope authorization is unresolved — the PR may not be mergeable at all
The work is justified solely by issue #536, an outside feature request framed as "monitoring parity with vLLM" (requester Napuh, filed the same morning). The charter's "What gets merged" admits only a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs; AGENTS.md:165-169 and :201-207 say a feature request is not authorization, and the charter lists vLLM under "Alternatives / Competitors", not as a compatibility target. The defence is that observability already ships (docs/operating.md:47, the #507 persistent-worker metrics), which makes this an extension rather than new surface — but that argument needs a maintainer to record it, and none has. Testing a branch that may be declined is the clearest possible waste of hardware.
2.2 process.rs re-implements the OS layer that already exists (three lenses concur)
The new module does raw sysconf/getrlimit/procfs work inside the serving metrics module, against AGENTS.md:20-21 ("The eos/ crate holds the host operating-system operations that Helios and Selene use"):
open_descriptors()athelios/src/runtime_core/protection.rs:290-302is character-identical toprocess.rs:65-67.eos::page_size()(eos/src/unix.rs:73-75, re-exported ascrate::os::page_size()athelios/src/os.rs:8) already wrapssysconf(_SC_PAGESIZE)with a default.eos::raise_open_file_limit(0)(eos/src/unix.rs:135-165) already returns exactlyprocess_max_fdswithdesired = 0.- No existing Rust implementation of the
/proc/self/statand/proc/statbtimeparses — that part is genuinely new and legitimately belongs ineos/.
This is a "move the code" fix. Testing before it lands means testing a file layout that will change.
2.3 Four code-vs-docs semantics conflicts — a tester could not write correct expectations
- e2e counts cancelled responses.
flare_request_e2e_secondsis observed on everyDelivery::Complete(http.rs:614-617,:631-632), which includes the parallel-tool-limit path (http.rs:471-476,:526finishing withTermination::Cancelled,:563-567generation.cancel(), then:598yieldsComplete). Those requests incrementmetrics.cancelled(runtime.rs:1317/1338/1360/1407) and never reachrequest_completed. Sodocs/api.md:312-313("Cancelled and failed requests enter onlyflare_requests_cancelled_totalandflare_requests_failed_total") is false, ande2e_count ≠ flare_requests_completed_total. It is also racy — the cancel athttp.rs:565can lose to the runtime's natural finish, so membership is timing-dependent. Decide: exclude cancelled responses from e2e, or narrow the doc. - The six families do not share a denominator, but the doc says they do.
prompt_tokensis observed unconditionally (metrics.rs:460-461); queue and prefill only when their stamps exist; decode and TPOT only whengenerated_tokens > 1(metrics.rs:470-472), as the PR's own HELP strings state (metrics.rs:1406-1418).docs/api.md:305-313's "one observation per completed generation" is therefore wrong for two of six series. - Vision steps end "queue" and are counted as "prefill".
first_scheduled_nsis stamped for every lane of every committed step (runtime.rs:2189-2203) before thestep.kind == GraphKind::Visionsplit at:2208, so for an image request queue = arrival→vision step and prefill = vision+prefill work. Either narrow the stamp to generation lanes or reworddocs/api.md:307-308. This changes the observed values, so it cannot be settled during testing. - Streaming e2e depends on the client draining the SSE body; non-streaming does not. The stream observation sits inside the body
filter_map(http.rs:604-620); the non-stream one runs in the handler before the body is polled — the PR's own test asserts count 1 withpoll_body == false(phase_tests.rs:4461-4465). Undocumented asymmetry; abandoned streams record nothing.
Also unstated in the docs and relevant to any expected-value table: decode/TPOT (first_token_ns..last_token_ns, metrics.rs:470-479) include any preempted/parked interval, so TPOT is inflated by preemption with no way to tell; and a preempted request's second queue wait is never counted (get_or_insert, runtime.rs:2196-2204).
2.4 Duplication and churn (all six lenses)
- Three Prometheus-histogram implementations now coexist in one module: the new
Buckets/Histogram(metrics.rs:212-298), the host-cost histograms (HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETSat:200-210, loop at:670-692, render at:1029-1065,u64::MAXsentinel,_countbefore_sum), and the retirement histograms (:851-876). Nothing is migrated, so three bucket encodings and three field orders now live in one file; the old path even keeps an unchecked.position().unwrap()(:689) that the newobserveavoids. Fix by migrating the host histograms onto the new type or declaring the migration a named follow-up. - Three assembly points for
/metricstext:Metrics::render,server.rs:671(TTFR),server.rs:709(process) — with no stated rule. Move TTFR ontoMetricsbesiderequest_e2e(metrics.rs:327). - Two metric writers:
process::metric(process.rs:42-49) duplicatesmetrics::metric(metrics.rs:1597-1602) minus theflare_prefix and escaping. - One observation written twice:
http.rs:615and:632are the same e2eobservein two accessor styles; one helper removes both and themetrics_handle()clone. - Six speculative
Optionfallbacks around sources that cannot fail on Linux, plus alet _ = text;non-Linux shim (process.rs:8-15) — the repo's own precedent (protection.rs:298-301) gates items instead.
2.5 Evidence quality (matters for what the tester can assume)
The description is honest (discloses unrun Windows build, unrun full suite, the FLARE_TEST_TEMPLATE_DIR test, and the fork base) but the live scrape is not evidence about main: it was taken on a cherry-pick onto AzallazA fork commit 5ffe4d54 (needed because the served model's engram encoding exists only in PR #482), and its window includes the authoring agent's own session traffic — the description concedes the deltas "exceed the three requests below". The arithmetic does not reconcile either: 5 runtime observations vs 6 first-response observations with no explanation of the sixth, and no duration attributed to an individual request. Treat the unit tests (metrics.rs:1648-1701, process.rs:148-183) as the real evidence; the scrape is a smoke check. Separately, "CI covers the first two" is unverified: the head commit carries no checks.
3. What was verified sound (do not spend test time re-deriving)
- Counter and histograms cannot diverge:
completed.fetch_addnow exists only atmetrics.rs:459; the only two callers areruntime.rs:1841-1846and:1993-1998. - Preemption preserves the stamps:
parkmovesIncomingwholesale (runtime.rs:2094-2100,:2121), readmission reuses it (:1334,:1367);get_or_insertkeeps the earliest stamp. - Bucket math and rendering: first-match
exposed <= bound, guaranteedf64::INFINITYtail, cumulative_count=+Inf, valid Prometheus 0.0.4 ordering; no divide-by-zero (generated_tokens > 1guard),saturating_subthroughout. format=jsonis untouched:Snapshotgained no fields (metrics.rs:69-130), soflare_helios::server::Snapshotand the Orbit consumer (docs/orbit.md:545(not opened)) are unaffected.- The terminal dashboard does not call
render()— it readsmetrics.snapshot()/prefill_plotonly (dashboard.rs:99-146,:566-620), so there is no per-refresh/proccost. Only/metricsand tests callrender(). - No artifact/compat surface change: no captured-graph op, no prepared metadata, no per-model branch, no flag, no env switch.
/metricsis unauthenticated (docs/api.md:235) — scriptable without keys.
4. What real hardware would add — and what it would not
Already covered by CI, do not test on GPU hardware: .github/workflows/native-serving.yml (not opened) triggers on pull_request and runs cargo test helios --features runtime-core,server on both ubuntu-24.04 and windows-2022 (lines 20-21, 43-68), plus eos and selene suites. The Windows compile of the new cfg-split file and the full helios suite are the CI legs' job (they just have not run on this head yet).
Not covered anywhere — the one genuinely hardware-specific risk: process_* arithmetic depends on sysconf(_SC_CLK_TCK) and sysconf(_SC_PAGESIZE) (process.rs:53-58). cn7 is a GB10 / arm64 Linux host (DGX Spark — a charter target), where 64 KiB pages are common; a wrong page size scales process_resident_memory_bytes by 16×. The shipped unit test asserts only resident > 0 and virtual >= resident (process.rs:162-183), so a 16× error passes it. This is the single 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 (for btime), read_dir("/proc/self/fd") and two sysconf + one getrlimit per scrape (server.rs:709 → process.rs:52-133) on the axum worker thread. Absolute cost is small and Prometheus scrapes are periodic, but the PR claims "nothing about serving changes", so confirm a scrape during active decoding does not perturb generation.
Not worth any hardware time: throughput A/B (the diff adds one monotonic_ns() + a lane loop per submitted step and two atomic stores per committed token — far below measurement noise, and there is no GPU/kernel change); format=json; the 60 s median window; bucket boundary math (unit-tested); process_* series on Windows (Linux-only by design).
5. Conditional minimal test plan (only if the owner decides to test after the §2 fixes)
Assumes the semantics decisions in §2.3 are made and the values therefore stable. Total budget ≈1.5 GPU-hours, two jobs, no load ramps, no repeated runs.
Step A — cn7 (GB10, arm64), ~15–20 min: page-size and clock-tick correctness of process_*
- Serve
nvidia/Qwen3.8-27B-NVFP4(arm64 job, 10 CPU / 60 GiB). Risk note: the 60 GiB job envelope may be too small for a 27B core; if bring-up fails for memory reasons, drop Step A and record the arm64 page-size risk as unmitigated rather than burning time on workarounds. - One
curl -s localhost:PORT/metricsand compare against the same process's kernel view:process_resident_memory_bytes÷ 1024 vsVmRSSfrom/proc/<pid>/status— must be within a few percent (a 16× or 64× discrepancy is the page-size bug).process_virtual_memory_bytesvsVmSize(kB × 1024).process_start_time_secondsvsps -o lstart=(within ~1 s).process_cpu_seconds_totalvs/proc/<pid>/statutime+stime ÷getconf CLK_TCK.process_open_fdsvsls /proc/<pid>/fd | wc -l(expect off-by-one only if the +1 self-count was deliberately kept — check the decided rule).process_max_fdsvsulimit -nof the serving process.
- Feed the scrape to
promtool check metrics(or any Prometheus 0.0.4 parser) — must parse. Pass/fail is numeric, single scrape, no load.
Step B — cn5 (4× RTX PRO 6000, amd64), ~45–60 min: scrape population and observation counts
Serve nvidia/GLM-5.3-Flash-NVFP4. Run one scripted, serialized workload with no other traffic (the README's own rule: /metrics deltas require quiescence, helios/README.md:160-161), snapshot before and after:
- Non-streaming, short prompt (
max_tokens32) → queue/prefill/prompt-token/decode/TPOT/e2e counts each +1; e2e_sum≥ decode_sum. - Streaming, long prompt (~2000 tokens) → prompt-token bucket lands in
le="2048"/le="4096"as appropriate; TTFR count +1 and TTFR ≤ e2e. max_tokens: 1→ decode and TPOT counts unchanged (thegenerated_tokens > 1guard) — this is the eligibility rule the tester must see from outside./v1/messages/count_tokens→ every request histogram unchanged (thecountexclusion athttp.rs:131).- Parallel-tool-limit cancel (two declared tools,
parallel_tool_calls: false, prompt that forces a second tool call) → assert the decided rule: eithere2e_countunchanged andcancelled_total+1, or e2e +1 with the doc amended. This case is the one that most needs a live driver, because it needs a real model to emit a second tool call. - 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]))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: response must be 200, complete, and the generation must continue (check the next tokens still arrive). 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, image/vision queue semantics (needs a vision-capable core the available models do not provide on these hosts), and the Windows/Linux builds (CI's job).
6. Recommended path
- Maintainer records whether #536 authorizes this work (or the description is reframed as the observable defect).
- Move the procfs/
sysconf/getrlimitaccessors intoeos/src/unix.rs, reuseprotection.rs:290-302's fd counter (relocated), leaveprocess.rsformatting only. - Settle the four semantics conflicts in §2.3 — each needs a code-or-doc decision, and two of them change the values a test would assert.
- Either port the host-cost and retirement histograms onto
Buckets/Histogramor name the migration as a follow-up issue; collapse the twometricwriters and the two e2e observation sites; move TTFR intoMetrics. - Get a green CI run on a branch head rebased onto
main(not the fork commit) including the Windows leg. - Only then run Steps A and B above.
Minor items reviewed and deliberately not treated as gating: comment length on Buckets/Histogram/RequestTimes, parse_stat's skip-arithmetic readability and its last-) heuristic returning Some on a malformed line, the second impl FirstResponseSamples block, docs repeating HELP strings verbatim, _sum/_count ordering conventions, and the docs hunk silently fixing pre-existing drift by adding flare_host_cache_retirement_seconds to the histogram list.