#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.
#14 [high] Head 055663a verification: build break gone, denominator documented
Verified at pr/548 head 055663a7 (9 files, +1016/-51):
- process.rs DELETED (commit 54e06b30). list_files helios/src/server/metrics* => only metrics.rs and metrics/scheduler.rs. search_code process_|sysconf|/proc/ under helios/src => no server hits. => --features server build break (prior Gate 1) is GONE.
- crate::runtime_core under helios/src/server => only runtime/prompt_tests.rs:13 (feature-gated test module). No ungated cross-feature reference.
- runtime_core/v58 re-export removed; open_descriptors private again (protection.rs:291).
- docs/api.md:305-326 now documents e2e as ONE observation per delivered response, explicitly: "It is observed once per delivered response, while the runtime counts one completion per model request, so a multi-choice response adds fewer observations than completions, and a stream the client abandons before draining adds none" + excludes count_tokens and tool-limit cancellations. => prior Gate 2 (denominator contradicts docs) is RESOLVED as a documentation matter.
- docs/api.md:328-346 documents runtime populations: queue from model-scheduler arrival to first step (can be a vision step, recorded only if reached), zero-token completion enters token histograms but no time histogram, decode/TPOT only >=2 generated tokens, inter-token one observation per committing step and preemption span included.
- metrics.rs:545-603 request_completed is sole completed.fetch_add (:558). Populations confirmed in code: prompt_tokens unconditional (:562), max_tokens only if >0 (:570), preemptions always (:574), inter_token absorb (:576), TTFT if first_token (:577), queue if scheduled (:581), inference if both (:587), decode/TPOT if first_token && generated>1 (:593-601).
- metrics.rs:605-618 response_completed(elapsed, choices, generated) chunks generated per prompt.
- http.rs:604-612 single e2e observation guarded !count && !encoder.tool_limit_reached, immediately before yield Delivery::Complete.
- Admission rejections wired at exactly 3 sites: server.rs:816 (HttpSlots), runtime.rs:869 (GenerationCapacity), runtime.rs:945 (RequestQueue); http.rs:240 (HttpSlots, batch path). 503 paths uncounted (server.rs:805-813).
- model_step gate runtime.rs:1721-1732 is a verbatim match list duplicating GraphKind::samples() (manifest.rs:90).
- Preemption count only in park_if_preempted (runtime.rs:2108-2111), not the reasoning park; tokens_committed gated on position==0 (runtime.rs:1803).
- Render: 17 request histograms (6 REQUEST_SECONDS + 2 TOKEN_SECONDS + 5 TOKEN_COUNTS + choices + preemptions + model_step_tokens + TTFR from server.rs:671).
- TTFR histogram still on FirstResponseSamples (latency.rs:36), rendered via render_histogram (latency.rs:101-108) called at server.rs:671 — outside Metrics::render.
- Older histogram machinery untouched: HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETS (199-209), host_cost_sums (475) with .position().unwrap() (838), render 1178-1214, host_retirement_buckets (468).
- CI (.github/workflows/native-serving.yml:18-21, 63, 68) runs helios tests with --features runtime-core,server on ubuntu-24.04 and windows-2022 only; no job builds
serveralone (so the deleted break was indeed uncatchable). No CI check has ever run on any head of this PR.
#15 [high] Verdict chain: refer to hardware (cn5 only), ~1.5 GPU-hours
Hold rationale from previous revisions is now void; here is the reasoning chain for the new verdict at 055663a:
PRIOR BLOCKER 1 (--features server build break) — GONE. process.rs deleted in 54e06b30; no /proc reads or process_* anywhere in helios/src/server; only crate::runtime_core ref under server/ is a feature-gated test module.
PRIOR BLOCKER 2 (e2e per-response vs completions per-generation contradicted docs) — RESOLVED as documented design. docs/api.md:311-318 now explicitly states one observation per delivered response, "a multi-choice response adds fewer observations than completions, and a stream the client abandons before draining adds none." Numbers a tester would assert are now stated in the docs.
HARDWARE VALUE SHIFT: the only genuinely hardware-specific risk in earlier revisions was arm64/GB10 64KiB page size scaling process_resident_memory_bytes (16x). process_* is deleted => cn7/GB10 has NO remaining justification. Dropping cn7 is the main resource-efficiency saving.
REMAINING SHOULD-FIX, ranked by whether they destabilize test assertions:
- Histogram triplication (new Buckets/Histogram :211-322 vs HOST_*_BUCKETS :199-209 + host_lookup_cost :819-841 (.position().unwrap() :838) + render :1178-1214 + host_retirement_buckets :468). Flagged should-fix by all six lenses. Does NOT affect the 17 new request series: those already use the new type. Migration would change host histogram exposition only (adds # HELP, reorders). => do not assert exact host histogram text; new series safe.
- Scope authorization on #536 unresolved (merge gate, not a code defect; not resolvable by testing).
- Latent correctness: response-wide tool_limit_reached gate (http.rs:606) drops sibling choices' e2e in a multi-choice+tools response. Unreachable today: n>1 only for Completions (decode.rs:754) and tools rejected for Completions (decode.rs:814). => must NOT test this combination; a fix would change those numbers.
- Closes #536 over-claims (process_* half dropped, no follow-up issue) — hygiene.
- Minor: TTFR histogram rendered outside Metrics::render (server.rs:671, latency.rs:101-108); model_step gate at runtime.rs:1721-1732 duplicates GraphKind::samples() (manifest.rs:90); per-choice generated[] duplicate of Encoder state; admission rejection labels positionally zipped to AdmissionLimit enum (metrics.rs:1643-1656 area).
CI FACTS: native-serving.yml:18-21 matrix ubuntu-24.04 + windows-2022, :63/:68 run helios tests with --features runtime-core,server. No job builds server alone (why the deleted break was uncatchable). No CI has run on any head of this PR.
HARDWARE: cn5 = 4x RTX PRO 6000 96GiB amd64, 48 CPU/125GiB/16GiB scratch, models incl nvidia/GLM-5.3-Flash-NVFP4, facebook/dinov2-base. cn7 = 1x GB10 arm64, 10 CPU/60GiB, models Qwen3.8-27B-NVFP4 etc. cn7 now not needed.
#17 [high] Head 6624592 verification: new commit sound, readings confirmed
Head 6624592, 9 files, +1008/-51. New commit only touches runtime.rs, two hunks.
HUNK 1 — if kind.samples() (runtime.rs:1721-1723) replaces inline matches! over 7 kinds. GraphKind::samples() at execution/manifest.rs:90-101 = Prefill|TerminalPrefill|ScoredPrefill|Decode|Speculative|Mixed|Resume — exactly the 7 the inline list named (different order). Verified SOUND, no population change.
HUNK 2 — first_scheduled_ns stamp moved from immediately after scheduler.commit (old :2220-2235) to after pack_vision/pack_inputs (runtime.rs:2259-2275), with ? on both pack paths so a failed pack leaves the instant unset; Ok(()) at :2276 is after the stamp loop; handle filter .filter(|a| a.request == lane.request) at :2266 keeps a recycled slot unstamped. One clock read per submission. Verified SOUND.
Consequence: CPU input-pack time is now charged to QUEUE, no longer to PREFILL. docs/api.md:329-331 ("first model step that includes the request") still consistent; prefill at :332-333 now starts after packing. Doc nit only.
RE-CONFIRMED at this head:
- metrics.rs:558 is the only
completed.fetch_addunder helios/src/server; request_completed (metrics.rs:545-603) called only from runtime.rs:1866 and :2029. (Other fetch_add hit, core/reader.rs:517, is bytes.) - request_completed populations (metrics.rs:562-601): prompt_tokens/prefill_computed/generated unconditional; max_tokens only if >0; preemptions always; inter_token via absorb (:576); TTFT needs first_token_ns; queue needs first_scheduled_ns; prefill/inference need both; decode+TPOT need first_token_ns && generated_tokens>1 (:593-594).
- response_completed (metrics.rs:608-618): one e2e observe;
for prompt in generated.chunks(choices)→ one choices + one max_choice observation PER PROMPT. - One e2e site: http.rs:606-612 (
!count && !encoder.tool_limit_reached), immediately beforeyield Delivery::Complete(:613).countset at http.rs:131; tool_limit_reached read at :476/:532/:569. - Admission rejections: server.rs:816, http.rs:240 (HttpSlots); runtime.rs:869 (GenerationCapacity); runtime.rs:945 (RequestQueue). parked gauge zeroed at runtime.rs:750, published at :1203 (called :1157).
- render() call sites: server.rs:660 (the /metrics route) + tests only → scrape-only cost, no serving-path cost. TTFR histogram appended out of band at server.rs:671 via latency.rs:101-108
render_histogram; observed in FirstResponse::output (latency.rs:116-127) behind!recorded. - docs/api.md:311-326 now documents: e2e per delivered response, excludes count_tokens + runtime-cancelled, "multi-choice response adds fewer observations than completions", abandoned stream adds none; choices/max_choice one observation per prompt. Docs/api.md:475-515 still the unversioned "Correspondence with vLLM metrics" table.
STILL OPEN (unchanged): (a) histogram triplication — HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETS metrics.rs:199-209, host-cost observe .position().unwrap(), render loop :1178-1214, retirement buckets :1000-1025; (b) Closes #536 over-claims (process_* half deleted, no follow-up issue); (c) latent response-wide tool_limit_reached gate vs per-choice completions (unreachable: n>1 only on Completions decode.rs:753-755, tools rejected there decode.rs:813-815); (d) inter-token TOKEN_SECONDS top bound 2.5 s (metrics.rs:226-232) while docs:342-346 say the preemption interval is included — multi-second readmission waits land in +Inf.
#18 [high] Revised test verdict at 6624592 — narrow exclusively to exclusion semantics
Author live validation (WynnD, 2026-11-28 03:26): RTX PRO 6000, local-inference-lab/Qwen3.8-Flash-Next-FLARE, image built from upstream main + #548 + #549 + #560 merged. 24 completions; TTFT and generated-token histogram count deltas = 24; generated-token histogram sum 3112 = flare_generated_tokens_total; e2e count 22 = delivered responses (consistent with the documented per-response denominator + 2 tool-limit cancellations); 814 tests pass, 1 template test needs FLARE_TEST_TEMPLATE_DIR. Recording cost not measured in isolation (disclosed).
Implication: the POSITIVE population arithmetic (counts move, sums reconcile) is already demonstrated on real hardware. Marginal value of re-testing it is low. What remains unproven on hardware is the NEGATIVE/exclusion semantics and consumer usability:
- max_tokens:1 must NOT move decode/TPOT (metrics.rs:593 guard) — and max_tokens:2 MUST, or the negative check is vacuous.
- /v1/messages/count_tokens must move nothing (http.rs:131 + :284-286).
- n=2 on /v1/completions: completed +2 vs e2e +1, TTFR +1 (docs/api.md:314-318).
- mid-stream disconnect: e2e unchanged (docs/api.md:317-318).
- histogram_quantile over the queue buckets returns a plausible finite value; full scrape parses as 0.0.4.
- scrape during in-flight generation: 200, complete body, generation continues.
VERDICT: REFER, cn5 only, ~45-60 min, 8 cases, no A/B, no cn7. DROPPABLE assertions: flare_request_choices / flare_request_max_choice_generated_tokens — one Subtractive lens recommends deleting both as subsumed by flare_request_generated_tokens. If they are deleted the case-5 denominator assertion (completed +2 / e2e +1) still holds. NEVER assert: the four pre-existing host_* histograms, their # HELP, or _sum/count order — a consolidation commit would legitimately change them. OUT OF SCOPE: tools+n>1 (unreachable, and a pending per-choice fix would change the numbers); process* (deleted); cn7/arm64 (its only justification, page-size arithmetic, went with process.rs); throughput A/B; format=json; the 60 s median; vision queue semantics; inter-token bucket placement on preempted requests (the 2.5 s top bound makes it +Inf — record as a known limit, not a failure).
#19 [high] Report of 2026-11-28, run 5 (head 6624592)
Fifth-revision pre-test report for PR #548 at head 6624592. Decision: REFER to hardware, cn5 only, ~45-60 min, no A/B, no cn7. Both prior blockers remain resolved; the new commit 66245920 is behaviour-equivalent (kind.samples()) plus behaviour-neutral (stamp after packing). No blocking findings. Remaining should-fix items are code-shape (histogram triplication), a latent unreachable HTTP-gate scope bug, an over-claiming Closes #536, and an unversioned vLLM parity table — none of which changes a value the test plan asserts. Test plan narrowed to the exclusion semantics (max_tokens guard, count_tokens, n=2 denominator, mid-stream disconnect) plus histogram_quantile usability, because the author's 2026-11-28 live scrape already demonstrated the positive population arithmetic and sum reconciliation.
#21 [high] Run 6 (head 6624592): no code change; REFER stands, plan tightened to ~40 min
Head unchanged: 9 files, docs/api.md +127/-4, metrics.rs +548/-2, runtime.rs +94/-37, phase_tests.rs +187, latency.rs +24/-8, http.rs +15, scheduler/tests.rs +7, scheduler.rs +4, server.rs +2 (pr_files). No new commits since 6624592; only a @flare-autobot review comment at 2026-11-28 05:09, which quotes "1,016 added lines" (i.e. reviewed 055663a, NOT the current head) and whose three should-fix items are all already recorded in my notes (#2/#3/#17).
Re-verified in code this run:
- http.rs:604-612 e2e observation, single site, guard
!count && !encoder.tool_limit_reached, immediately beforeyield Delivery::Complete.!countis dead: count returns at http.rs:284-286. - metrics.rs:545-603 request_completed: sole
completed.fetch_addat :558; obs order — prompt_tokens :562-563, prefill_computed :564-567, generated :568-569, max_tokens if >0 :570-573, preemptions :574-575, inter_token absorb :576, TTFT if first_token_ns :577-580, queue if first_scheduled_ns :581-583, prefill+inference if both :584-591, decode+TPOT only if first_token_ns && generated_tokens>1 :593-602. - metrics.rs:608-618 response_completed: request_e2e observe once; per-prompt chunk of
generated-> request_choices + request_max_choice_generated_tokens. - Buckets: REQUEST_SECONDS<21> 0.001..2560 scale 1e9 (:218-224); TOKEN_SECONDS<19> 0.001..2.5 scale 1e9 (:226-232); TOKEN_COUNTS<21> 1..2097152 scale 1.0 (:234-240); PREEMPTION_COUNTS<9> with leading 0 (:244-247); CHOICE_COUNTS<6> 1,2,5,10,20 (:250-253). TOKEN_SECONDS top bound 2.5 s confirmed -> inter-token clamp claim holds.
- Render block metrics.rs:1548-1642; exact series names confirmed: flare_request_e2e_seconds, request_queue_seconds, request_prefill_seconds, request_decode_seconds, request_inference_seconds, time_to_first_token_seconds, time_per_output_token_seconds, inter_token_latency_seconds, request_prompt_tokens, request_prefill_computed_tokens, request_generated_tokens, request_max_tokens, request_max_choice_generated_tokens, request_choices, request_preemptions, model_step_tokens; plus flare_time_to_first_response_seconds rendered out of band (latency.rs:101-108 via server.rs:671). 17 families total.
- docs/api.md:305-386 populations; :314-318 the per-response denominator ("multi-choice response adds fewer observations than completions", "a stream the client abandons before draining adds none"); :340-341 decode/TPOT eligibility; :342-346 inter-token incl. preemption wait; :361-364 cancelled/failed scoping; :377-382 rejection reasons + 503 uncounted.
Decision: REFER to cn5 only, one job, ~40 min, 6 cases (merged last report's 8 by folding count_tokens into the eligibility snapshot and folding histogram_quantile/parse into case 1's scrape). No cn7 (process_* deleted). No throughput A/B.
#22 [high] Run 6: exact assertion strings + existing test coverage for the cn5 plan
Exact series names/eligibility re-verified at head 6624592:
Rendered by Metrics::render (metrics.rs:1548-1642), all 17 request families:
- REQUEST_SECONDS<21>: flare_request_e2e_seconds, flare_request_queue_seconds, flare_request_prefill_seconds, flare_request_decode_seconds, flare_request_inference_seconds, flare_time_to_first_token_seconds (all in one loop :1548-1581)
- TOKEN_SECONDS<19> (top bound 2.5 s): flare_time_per_output_token_seconds, flare_inter_token_latency_seconds (:1582-1595)
- TOKEN_COUNTS<21>: flare_request_prompt_tokens, flare_request_prefill_computed_tokens, flare_request_generated_tokens, flare_request_max_tokens, flare_request_max_choice_generated_tokens (:1596-1624)
- CHOICE_COUNTS<6>: flare_request_choices (:1625-1630); PREEMPTION_COUNTS<9> w/ leading 0: flare_request_preemptions (:1631-1636); flare_model_step_tokens (:1637-1642) Rendered OUT OF BAND: flare_time_to_first_response_seconds via latency.rs:101-108 (render_histogram) called from server.rs:671. NOTE correction: time_to_first_token IS in Metrics::render.
Observability: observe (:272-283) increments exactly one bucket + sum; absorb (:286-295); render prints HELP+TYPE, cumulative buckets, _sum = sum/scale (:315-319), _count = cumulative (:320). Correct Prometheus 0.0.4 shape.
Exact assertion strings a tester can grep (matching existing test style): "flare_requests_completed_total N", "flare_requests_output_limited_total N", "flare_request_e2e_seconds_count N", "flare_generated_tokens_total N", "flare_admission_rejections_total{reason="http_slots"} N", "flare_cache_lookup_tokens_total N".
Protocol gating (decode.rs): :753-755 protocol != Completions && choices != 1 -> "n must be 1"; :813-815 reject(&body, &["tools","tool_choice"]) for Completions. So tools+multi-choice is unconstructible => latent only (metrics.rs/http finding), correctly excluded from test plan.
Existing unit tests already pinning semantics (do not re-derive on hardware):
- phase_tests.rs:4629-4717 disabled_parallel_calls_complete_http_and_stop_decoding: tool-limit path across chat/messages/responses x stream/non-stream asserts flare_request_e2e_seconds_count 0 (:4709-4716) and no "d" tool emitted (:4717).
- phase_tests.rs:4514-4543 failed stream: TTFR samples 0 and e2e count 0 (:4537-4541).
- phase_tests.rs:4545-4576 non-stream poll vs no-poll: e2e count 1 in both (:4570-4574) -> confirms non-stream observes before poll.
- metrics.rs unit tests: :1939/:1971-1972 counts + output_limited, :2233 generated_tokens_total 3, :2436 cache_lookup_tokens_total 320, :2356 parked_requests 2.
Author's 2026-11-28 03:26 scrape (pr_comments) already shows completions 24 > e2e 22 with n=2 and two prompts in the workload => e2e<completed relationship is qualitatively pre-confirmed; case 5 (controlled n=2 delta) is therefore the FIRST case to drop if time is short.
Optional but NOT recommended for hardware: tool-limit cancellation live (needs a real model to emit a second tool call; flaky). Already unit-pinned.
#23 [high] Run 6 final verdict: REFER cn5 ~40 min, 6 cases; risk assessment
Head reviewed: 6624592 (unchanged; 9 files). New since prior report: only @flare-autobot review at 2026-11-28 05:09.
Currency check on that comment: it says "~235 of the 1,016 added lines" — 1,016 is the 055663a diff size; current head is ~1,008 (+548/-2 metrics.rs, +94/-37 runtime.rs, +187 phase_tests, +127/-4 docs, +24/-8 latency, +15 http, +7 scheduler/tests, +4 scheduler, +2 server). So the 05:09 bot review predates 6624592 and its file:line set was already adjudicated in notes #2/#3/#17. It adds no new finding, and its 3 "should fix" items are my §2.2 (Closes #536 + unpinned table), §2.3 (response-wide tool-limit gate, latent), §2.1 (histogram duplication).
FINAL VERDICT: REFER to hardware, cn5 only, ~40 min, 6 cases. Not cn7 (process_* deleted; only hardware-specific risk was arm64 page-size math, now gone). No throughput A/B (no GPU kernel/graph/op/metadata change; added cost is 1 clock read + lane loop per submitted step, 2 stores per committing step, ~12 observations + 19 absorb pairs per completed request — far below noise).
Rationale for referring rather than holding: 0 blocking defects at this head across all lenses; both former blockers (build break, e2e denominator) resolved and documented; the only remaining should-fix items are code-shape (histogram duplication), description/authorization (#536), a latent unreachable gate bug, and a bucket-range clamp — none changes a value the plan asserts. Value is real (operators get p50/p99 from one scrape; #560 stacked on this PR needs RequestTimes), and the residual test scope is narrow: exclusion semantics + live scrape usability, which unit tests cannot fully cover because they need a real model.
Risk if tested now: LOW but non-zero. If the author later consolidates the host histograms (§2.1), the four pre-existing host_* series gain HELP and reorder _sum/_count — hence the plan forbids asserting them. If §2.3 gets fixed per-choice, only case 5's expected values change. Authorization risk is separate from test validity: the test result is useful either way.
#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.