#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.
#8 [high] Revision facts at head a34c4d06 (blocker + semantics)
Head now a34c4d06 (3 commits: ebecef13 + d64c3ea3 "Exclude cancelled responses and reuse host helpers" + a34c4d06 "Hoist completion values and tighten stat parsing"). 10 files, +548/-25. Still draft, zero CI checks on head, no reviews.
NEW BLOCKING BUILD BREAK (verified by reading, not compiled):
- helios/src/server/metrics/process.rs:68
let open_fds = crate::runtime_core::open_descriptors(); - helios/src/lib.rs:25-26:
#[cfg(feature = "runtime-core")] pub mod runtime_core; - helios/Cargo.toml:21 runtime-core = [...]; :25 server = ["dep:serde","images","grammar","dep:axum",...] — does NOT include runtime-core.
- helios/src/server/metrics.rs:12
pub(super) mod process;unconditional; helios/src/server.rs:16mod metrics;unconditional inside server. - So
cargo test --features serveron Linux fails to resolve crate::runtime_core. Documented configs: docs/model-development.md:99,100 and docs/scheduling-runtime-design.md:735,736. - CI cannot catch it: .github/workflows/native-serving.yml:63,68 both pass
--features runtime-core,server(ubuntu + windows). - Introduced by d64c3ea3. Before it, process.rs only used crate::os (lib.rs:19
mod os;ungated, helios/src/os.rs:8pub(crate) use flare_eos::*;). - Search: only 3 refs to runtime_core under helios/src/server — process.rs:68 (ungated, broken), runtime/prompt_tests.rs:13 (test-gated), session.rs:10 (feature-gated at server.rs:26-27).
- Serving binary unaffected: flare-cli/Cargo.toml:27,44 use ["runtime-core","server"].
E2E DENOMINATOR (verified):
- http.rs:598-606 single observation inside the
deliverystream! block, after the per-generation loop, beforeyield Delivery::Complete(response); guard!count && !encoder.tool_limit_reached. - e2e is once per RESPONSE; Metrics::request_completed (metrics.rs:452-480) runs once per GENERATION (per lane/choice). http.rs:351-353 builds
generations: Vec<Option<Generation>>per choice (requestn). So for n>=2 choices: completed_total += n, e2e_count += 1. docs/api.md:303 "counts each successful generation" is wrong even in the happy path; also wrong for the cancelled-sibling case (choice i completed, choice j trips the shared tool_limit_reached flag -> whole-response e2e skipped). - prompt_tokens histogram is unconditional (metrics.rs:460-461) so flare_request_prompt_tokens_count == flare_requests_completed_total always. That IS a clean invariant to test.
- queue/prefill need first_scheduled_ns (metrics.rs:462); decode + TPOT need first_token_ns && generated_tokens > 1 (metrics.rs:470-479).
- metrics.rs:1683 test pins zero-token completion: only prompt_tokens + completed, queue/prefill/decode unchanged.
FIXED SINCE MY LAST REPORT (do not re-raise):
- docs/api.md:288-290 now has the
process_*prefix exception; :297 "accumulate since server start"; :303-307 e2e delivery/drain caveat; :309-314 vision-step + >=2 tokens eligibility; :318-321 process_* list. All four semantics docs findings I raised are fixed. - e2e observed once (was twice). parse_stat hardened (process.rs:26, offsets value(10)/0/6/0/0, test process.rs:142-147 pins [11,12,19,20,21]).
- OS reads partly delegated: process.rs:61 crate::os::page_size() (eos/src/unix.rs:73-75), :70 crate::os::raise_open_file_limit(0) (eos/src/unix.rs:138-165; early return at :145-147 because desired=0 never exceeds current, so setrlimit at :160 unreachable — getter only by accident).
- Worker::publish hoisted prompt_tokens/generated_tokens (runtime.rs:1993-1995).
STILL OPEN code-shape (all 6 lenses):
- Three histogram implementations: new Buckets/Histogram (metrics.rs:214-298), HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETS (:200-210) + host_lookup_cost .position().unwrap() + 37-line render loop (:1029-1065), retirement block (:851-876). Nothing migrated.
- TTFR histogram owned by latency::FirstResponseSamples (latency.rs:34-37, render_histogram :101-108) appended at server.rs:671; sibling request_e2e is a Metrics field rendered at metrics.rs:1391. Three /metrics assembly sites: metrics.rs render, server.rs:661-671, server.rs:672-709.
- Two writers: process::metric (process.rs:47-54) duplicates metrics::metric (metrics.rs:1597-1602).
- Six
if let (Some,..)fallbacks process.rs:72-125 +let _ = text;non-Linux shim :8-14 + adjacent duplicate :81-98. - process_open_fds self-counts its own read_dir descriptor (documented at process.rs:113, not subtracted).
- Docs invariant "Cancelled and failed requests enter only cancelled/failed totals" (api.md:315-316) still approximate for multi-choice and cancelled-after-complete races.
DESCRIPTION STILL STALE: the "What changed -> HTTP" bullet still omits the tool-limit exclusion that http.rs:598-600, phase_tests.rs:4604-4613 and api.md:303-306 all encode; "nothing about serving changes" still unmeasured; live scrape still from fork 5ffe4d54; "CI covers the first two" unverified (no checks on head).
#9 [high] Revised test verdict at a34c4d06 plus arm64/n=2 plan
Decision at head a34c4d06: HOLD, and more firmly than my 2026-11-26 report, because there is now a verified blocking regression (--features server build break) plus a denominator divergence (e2e per response vs completed per generation) that changes the exact numbers a tester would assert.
Hardware value today: ~0.3/5 (was 0.5/5) — the build config a contributor would use is broken and two of the eight assertion targets are disputed semantics. After fixes: ~2/5, ~1.5 GPU-hours, two jobs, no throughput A/B (no GPU kernel/graph/op/prepared-metadata change; added serving cost is one monotonic_ns + lane loop per submitted step at runtime.rs:2188-2203, two stores per committed token at runtime.rs:1774-1775, and blocking procfs reads per text scrape at server.rs:709 -> process.rs:57-126).
Genuinely hardware-only checks (CI cannot reach):
- arm64 page-size / clock-tick arithmetic. cn7 is GB10 arm64; 64 KiB pages common. process_resident_memory_bytes = stat[4] (pages) * crate::os::page_size() (process.rs:96); process_cpu_seconds_total = (utime+stime)/CLK_TCK (process.rs:78); process_start_time_seconds = btime + starttime/CLK_TCK (:105). The shipped unit test (process.rs:150-176) only asserts resident>0, virtual>=resident, start within 1h — a 16x page error passes it.
- Live bucket plausibility + scrape-during-decode does not stall.
New case to add to the cn5 plan: n=2 completions (multi-choice) -> assert flare_requests_completed_total += 2 but flare_request_e2e_seconds_count += 1 (or whatever rule the maintainer chooses). That single case is the cheapest live proof of the per-response vs per-generation divergence at http.rs:598-606 vs metrics.rs:452-480, and it needs no tool call. Also keep: prompt_tokens_count == completed_total invariant; max_tokens:1 -> decode/TPOT unchanged; count_tokens -> all request histograms unchanged; tool-limit cancel -> decided rule; mid-stream disconnect -> e2e unchanged; histogram_quantile smoke.
cn7 model choice: nvidia/Qwen3.8-27B-NVFP4 (job 10 CPU / 60 GiB). If bring-up fails on memory, record the arm64 page-size risk as unmitigated rather than burning time.
#11 [high] Re-verification at a34c4d06 (run 3): blockers confirmed, n=2 reachability proven
Head unchanged: a34c4d06, 10 files +548/−25, draft, zero CI checks. New comment on PR is only the 06:15 bot review re-post; no code change since my 2026-11-27 report (#10).
Blocker 1 (build) re-verified at head:
- helios/src/server/metrics/process.rs:68
let open_fds = crate::runtime_core::open_descriptors(); - helios/src/lib.rs:25-26
#[cfg(feature = "runtime-core")] pub mod runtime_core;; lib.rs:19mod os;ungated - helios/Cargo.toml:21 runtime-core = [...]; :25 server = [...] does NOT include runtime-core
- helios/src/server.rs:16
mod metrics;ungated; helios/src/server/metrics.rs:12pub(super) mod process;ungated - only ungated
crate::runtime_corereference under helios/src/server (search confirmed: process.rs:68; runtime/prompt_tests.rs:13 is behind #[cfg(all(test, feature="runtime-core"))]) - documented config: docs/model-development.md:99-100
cargo test --manifest-path helios/Cargo.toml --features server --lib frontend::
Blocker 2 (e2e denominator) re-verified + reachability settled:
- http.rs:299
let size = prepared.len();; :351generations: Vec<Option<Generation>> = (0..size); :451 loop; :598-606 ONE e2e observation after the loop, guarded!count && !encoder.tool_limit_reached - per-generation completion: metrics.rs:452-480
request_completed - Multi-generation IS reachable live: /v1/completions accepts
n> 1 (protocol/decode.rs:742-755 rejects n!=1 only for non-Completions) and a prompt array multiplies it (inference.rs:198-209generation_count = prompts.len()*choices). phase_tests.rs:4245-4260 already drives/v1/completionswith"n": choices— so an n=2 live case is easy and needs no tools. - tool-limit + multi-generation is NOT reachable today: decode.rs:813-815 rejects tools/tool_choice for Protocol::Completions, and n>1 is allowed only there → cancelled-sibling variant is latent; the plain happy-path n=2 mismatch (completed +2, e2e +1) is live.
- TTFR also per response: latency.rs:113-127
recordedflag. - docs/api.md:303 says e2e "counts each successful generation" — wrong for n>1.
- Clean invariant for testers: prompt_tokens_count == completed_total always (metrics.rs:460-461 unconditional).
#12 [high] Report of 2026-11-27, run 3 (head a34c4d06)
Pre-test report — PR #548 "Add request latency histograms and process metrics" (third revision, head a34c4d06)
Decision: HOLD — no hardware referral. Head unchanged since previous report; the only new item is a re-posted bot review (06:15 UTC) and a maintainer-less PR. Two blockers still open: (1) --features server build break via crate::runtime_core::open_descriptors() at process.rs:68; (2) e2e histogram observes once per response while completions are per generation → n≥2 (reachable on /v1/completions, verified) gives completed+2 / e2e+1.
EV today ~0.3/5; after fixes ~2/5, ≈1.5 GPU-hours in two jobs; no A/B.
Plan: Step A cn7 GB10 arm64 page-size/clk-tck check of process_*; Step B cn5 GLM-5.3-Flash-NVFP4 scripted scrape-delta cases (short non-stream, long streaming, max_tokens=1 guard, count_tokens exclusion, n=2 denominator, tool-limit cancel, mid-stream disconnect, histogram_quantile shell check, one scrape during active decode).
Screening: all clear; the two autobot.eidonix.com links in the review comment were not fetched.
#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.