#1 [high] PR #548 basic facts
PR #548 "Add request latency histograms and process metrics", draft, head ebecef1, base main, 8 files +545/-20, author WynnD (first-time contributor, association NONE), Discord oystersmiles. Head carries ZERO CI checks; no reviews, no maintainer engagement on #536/#548. Branch metrics/request-latency-histograms.
Change: new generic Buckets/Histogram in helios/src/server/metrics.rs:212-298; five runtime request histograms (queue, prefill, decode, time_per_output_token, prompt_tokens) recorded in Metrics::request_completed (metrics.rs:452-480); RequestTimes stamps on Incoming (runtime.rs:190-193, 913, 1774-1775, 2189-2203); e2e histogram in http.rs:614-617 (stream) and 631-632 (nonstream); TTFR histogram in latency.rs:33-37,107-120,122-131 rendered at server.rs:671; new Linux-only helios/src/server/metrics/process.rs (184 lines) rendered at server.rs:709; docs/api.md:287-320.
Closes #536 (outside requester Napuh, "monitoring parity with vLLM"). Charter "What gets merged" = maintainer request / roadmap item / reproducible bug / measured perf-memory issue / bad docs; vLLM is listed under Alternatives/Competitors, not a compatibility target. => scope authorization unresolved, needs maintainer decision.
#2 [high] Correctness defects needing fix before test
-
flare_request_e2e_seconds observes on every Delivery::Complete (http.rs:614-617, 631-632) including the parallel-tool-limit cancel path (http.rs:471-476 drops events, :526 finishes decoder with Termination::Cancelled, :563-567 generation.cancel(); :598 yields Complete). Those requests increment metrics.cancelled (runtime.rs:1317/1338/1360/1407) and never reach Metrics::request_completed. So docs/api.md:312-313 ("Cancelled and failed requests enter only flare_requests_cancelled_total and flare_requests_failed_total") is false, and e2e_count != requests_completed_total. Also racy: cancel may lose to natural finish, so membership is timing-dependent.
-
Decode/TPOT interval = first_token_ns..last_token_ns (metrics.rs:470-479) includes any preempted/parked interval; TPOT therefore inflated with no signal. Second queue wait never counted (first_scheduled_ns get_or_insert, runtime.rs:2196-2204). Not documented in docs/api.md:307-313.
-
Family populations differ: prompt_tokens unconditional (metrics.rs:460-461), queue/prefill only when stamps exist, decode/tpot only when generated_tokens>1 (metrics.rs:470-472). docs/api.md:305-313 claims "one observation per completed generation" for all six — contradicted by the PR's own HELP strings (metrics.rs:1406-1418).
-
first_scheduled_ns stamped for every lane of every committed step INCLUDING GraphKind::Vision (runtime.rs:2189-2203 before the step.kind==Vision split at :2208), so for image requests "queue" ends at the vision step and "prefill" absorbs vision work. Doc/reality mismatch; needs either code narrowing or doc rewording.
-
Streaming e2e requires client to drain the SSE body (observation inside the filter_map closure, http.rs:604-620); non-streaming records in the handler before the body is polled (phase_tests.rs:4461-4465 asserts count 1 for poll_body=false). Undocumented asymmetry; abandoned streams record nothing.
#3 [high] Architecture/duplication should-fix items
process.rs (new, 184 lines):
- Duplicates OS layer: open_descriptors() exists char-identically at helios/src/runtime_core/protection.rs:290-302; page_size() at eos/src/unix.rs:73 (and windows.rs:152); getrlimit(RLIMIT_NOFILE) already inside eos::raise_open_file_limit (eos/src/unix.rs:135-165, returns soft limit when called with desired=0). AGENTS.md:20-21 designates eos/ as home for host OS ops. (process.rs:55-77)
- Six speculative Option fallbacks for sources that cannot fail on Linux (sysconf x2, getrlimit, read_dir, parse_stat, btime); module doc promises "a scrape never fails" (process.rs:1-6, 79-132).
let _ = text;non-Linux shim (process.rs:11-15) exists only to silence unused param; repo precedent is cfg-gating (protection.rs:298-301) or gating whole items.- process_open_fds includes the read_dir's own descriptor (+1 vs client_golang) — HELP text admits it.
- Blocking procfs reads on the axum worker thread every scrape, incl. reading all of /proc/stat for btime (server.rs:709).
- No migration: metrics.rs still has HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETS (metrics.rs:200-210) + host_lookup_cost loop (:670-692) + render loop (:1029-1065) and retirement histograms (:851-876) => three histogram implementations/encodings (u64::MAX sentinel vs f64::INFINITY; _sum/_count order differs).
- process::metric (process.rs:42-49) duplicates metrics::metric (metrics.rs:1597-1602), minus flare_ prefix and escaping.
- TTFR histogram owned by latency::FirstResponseSamples (latency.rs:33-37, 122-131) and rendered from server.rs:671, while e2e is a Metrics field rendered in Metrics::render (metrics.rs:1386-1424) => three assembly points for /metrics text.
- http.rs:615 vs :632: request_e2e observe written twice inline in two accessor styles.
#4 [high] CI coverage and what hardware would add
Repo CI: .github/workflows/native-serving.yml triggers on pull_request, matrix ubuntu-24.04 + windows-2022; runs eos tests, selene tests, and cargo test helios --features runtime-core,server on BOTH Linux and Windows (lines 43-68). So Windows build + full helios suite are CI-covered — no hardware time needed for that; head ebecef1 shows no checks yet (first-time contributor, workflows likely awaiting approval).
Hardware-target angle that is genuinely hardware-specific: process_* math derives from sysconf(_SC_CLK_TCK) and sysconf(_SC_PAGESIZE) (process.rs:54-58). cn7 is NVIDIA GB10 / arm64 Linux (DGX Spark — a charter target), where Linux arm64 kernels commonly use 64 KiB pages. A wrong/absent page size multiplies process_resident_memory_bytes by 16x. Existing test only asserts resident>0 and virtual>=resident (process.rs:166-183), which cannot catch a wrong page size. This is the one validation that a GPU host adds beyond CI. No MMIO/kernel/op/artifact change anywhere in the PR, so no throughput A/B is warranted: added cost is one monotonic_ns() per submitted step + a lane loop (runtime.rs:2191-2203), two atomics per committed token (:1774-1775), and one relaxed fetch_add per observe.
Live-scrape evidence in the PR was taken on a cherry-pick onto AzallazA fork commit 5ffe4d54, not main (needs #482 engram encoding for the served model), and the scrape window includes the authoring agent's own session traffic.
#5 [high] Test recommendation: hold, plus minimal post-fix plan
Decision: HOLD — do not refer to a test engineer yet.
Reasons (priority 1, don't burn hardware on code that will change):
- Scope authorization unresolved (no maintainer decision that #536 authorizes work; charter "What gets merged" + AGENTS.md:165-169/201-207). Could be declined outright.
- Open semantic decisions that change the values/assertions a tester would pin: a) whether e2e excludes tool-limit-cancelled responses (code vs docs conflict), b) whether first_scheduled_ns should be restricted to generation lanes (vision boundary) — changes queue/prefill intervals, c) whether decode/TPOT must exclude parked time — changes those values, d) whether process_* get a flare_ prefix (docs naming rule) — changes series names, e) whether process_open_fds subtracts its own directory read — changes the value, f) whether the new histograms move into Metrics / host histograms migrate — changes render ownership, not values.
- Also: 3 of 6 lenses find layering violations (process.rs duplicates eos/ + protection.rs:290-302) which are "move the code" fixes; retesting after a move is wasted otherwise.
If fixed (assuming values preserved): minimal plan ~1.5-2 GPU-hours. cn7 (GB10/arm64): the only genuinely hardware-specific arithmetic — sysconf(_SC_PAGESIZE)/CLK_TCK (process.rs:53-58). Verify process_resident_memory_bytes vs VmRSS in /proc//status (x1024), process_start_time_seconds vs ps -o lstart, process_open_fds vs ls /proc//fd | wc -l, and that /metrics parses as Prometheus 0.0.4. Existing unit test only asserts resident>0 & virtual>=resident (process.rs:166-183) so a 16x page-size error passes it. cn5: one model, scripted 5-request workload: non-streaming short prompt; streaming long prompt; parallel-tool-limit cancel; mid-stream client disconnect; /v1/messages/count_tokens. One scrape, assert counts per the decided population rule and histogram_quantile() works. No load ramp. No throughput A/B: the diff adds one monotonic_ns() per submitted step + a lane loop (runtime.rs:2191-2203) and two atomic stores per committed token (1774-1775), no GPU/kernel/graph/artifact change; any effect is below noise. Do NOT test: Windows build + full helios suite (native-serving.yml runs helios tests on ubuntu-24.04 AND windows-2022, pull_request-triggered), format=json (untouched), 60s median window (untouched), bucket boundary math (unit-tested in metrics.rs:1648-1701). Irreproducibility note: author's live scrape was a cherry-pick onto fork AzallazA 5ffe4d54 (needs #482 engram encoding); test on a branch head rebased on main, not on the fork.
#6 [medium] Verified facts that narrow test scope
- Verified: helios/src/server/dashboard.rs NEVER calls Metrics::render(); it reads metrics.snapshot()/prefill_plot (dashboard.rs:99-146, 566-620). So the architecture reviewer's open question "dashboard also calls render(), per-refresh /proc cost unknown" is resolved: no /proc reads on the dashboard path. Only /metrics (server.rs:660-709) and tests call render().
- Metrics::render() callers: server.rs:660 and tests only (metrics.rs tests, phase_tests.rs:576,3217,3543,6230, runtime.rs:3178-3210).
- completed.fetch_add now only at metrics.rs:459 (inside request_completed); call sites runtime.rs:1841-1846 and 1993-1998. No direct increment left.
- RequestTimes survives preemption: park() moves Incoming wholesale (runtime.rs:2094-2100, parked.push_back at :2121), readmission reuses it (parked list at :1334/:1367).
- Snapshot struct unchanged (metrics.rs:69-130) → format=json untouched, Orbit consumer docs/orbit.md:545 unaffected.
- Non-Linux: metrics.rs:12
pub(super) mod process;unconditional; process.rs::render has cfg arms withlet _ = text;on non-Linux; all libc uses inside cfg(target_os="linux"), libc is a plain dependency (helios/Cargo.toml:50) → no Windows compile risk visible; Windows leg of native-serving.yml will confirm. - process.rs tests are #[cfg(all(test, target_os = "linux"))] so they never run on the Windows CI leg.
- /metrics is unauthenticated (docs/api.md:235) → scriptable by a tester without keys.