#1 [high] Should fix: e2e histogram includes cancelled/tool-limited responses, contradicting the stated exclusion rule
helios/src/server/http.rs:631-635 (non-stream) and http.rs:614-617 (stream) observe flare_request_e2e_seconds in the Delivery::Complete arm. That arm is reached for responses whose generation the runtime counted as cancelled: at http.rs:563-567, when encoder.tool_limit_reached, generation.cancel() is called, and the runtime then counts it in metrics.cancelled, never in request_completed (runtime.rs:1343-1364 / 1334-1342). The terminal event still flows through GenerationEvent::Finished → Delivery::Complete → e2e observed.
Why it matters: docs/api.md (new paragraph, lines ~296-311) states "Cancelled and failed requests enter only flare_requests_cancelled_total and flare_requests_failed_total", and the PR description repeats "Cancelled and failed requests stay out of these histograms". For flare_request_e2e_seconds that is not true of the cancelled-by-tool-limit path, so a dashboard comparing flare_request_e2e_seconds_count against the runtime histograms/counters mixes populations.
Fix: gate the observation (e.g. skip when encoder.tool_limit_reached/termination is Cancelled), or narrow the documentation sentence so it covers only the runtime histograms (queue/prefill/decode/tpot/prompt tokens). Verified in code; a test with a tool-limit-reaching request would settle whether e2e is really observed there.
#6 [high] Research summary
Reviewed PR #548 (request latency histograms + Linux process metrics) through the correctness lens: read all 8 changed files in context (metrics.rs, runtime.rs, http.rs, latency.rs, server.rs, process.rs, phase_tests.rs, docs/api.md), followed both request_completed call sites, the reserve_and_pack/complete/publish/park paths, and both HTTP delivery arms, and checked the repo's rules (charter, AGENTS.md, docs/design-review.md).
Two findings worth fixing: (1) flare_request_e2e_seconds is observed on any Delivery::Complete, so responses the runtime counts as cancelled (the encoder.tool_limit_reached → generation.cancel() path at http.rs:563-567, which never reaches request_completed) still land in the e2e histogram, contradicting the new docs sentence and the PR description that cancelled requests appear only in flare_requests_cancelled_total; (2) streaming e2e is only recorded if the client drains the SSE body while the non-streaming path records before the body is polled, an asymmetry that makes flare_request_e2e_seconds_count diverge from flare_requests_completed_total for streamed requests and is not stated in docs/api.md.
Also noted as lower-severity items: first_scheduled_ns is stamped for GraphKind::Vision lanes too (question, may be intended given the docs wording); parse_stat's last-) heuristic returns Some on some malformed comms rather than omitting; process_open_fds counts its own directory read (+1 vs the standard exporter, but the HELP text says so). Verified-correct: the counter and histograms share one function with no leftover direct completed.fetch_add sites, bucket indexing and cumulative rendering are consistent, the non-Linux build of process.rs compiles cleanly (all libc use is Linux-cfg'd), and the JSON snapshot is untouched. Evidence limitation: the live scrape ran on a cherry-pick onto a fork commit, no CI checks exist on the head, and the Windows build and full suite were not run.
#7 [high] Citation sheet for the two findings and secondary items
Finding 1 (Should fix, e2e vs cancelled):
- helios/src/server/http.rs:563-567 —
if encoder.tool_limit_reached { if let Some(generation) = &generations[index] { generation.cancel(); } }; the terminalGenerationEvent::Finishedstill becomesDelivery::Completeat http.rs:598 (yield Delivery::Complete(response);). - helios/src/server/http.rs:614-617 (stream) and 631-635 (non-stream) —
request_e2e.observe(...)unconditional in theDelivery::Completearm, guarded only by!count(count_tokens). - Cancellation is counted in runtime.rs:1334-1342 (parked) and 1343-1364 (active) as
self.metrics.cancelled.fetch_add, and those paths never callrequest_completed. - Contradicted text: docs/api.md new paragraph (in the diff, after "The route returns one JSON object…" block start, ~lines 287-320): "Cancelled and failed requests enter only
flare_requests_cancelled_totalandflare_requests_failed_total." PR description: "Cancelled and failed requests stay out of these histograms."
Finding 2 (Should fix, streaming e2e requires body drain):
- http.rs:600-620 stream arm inside
delivery.filter_mapused bySse::new(events); observed only when the client polls to the end. - http.rs:629-641 non-stream arm observes in the handler before the body is polled.
- phase_tests.rs:4461-4465 asserts
flare_request_e2e_seconds_count 1for thepoll_body == falsecase, which proves the non-stream contrast. - Docs wording, docs/api.md: "
flare_request_e2e_secondscounts each successful generation from admission to the completed response" — no mention of body drain, while the adjacent sentence forflare_time_to_first_response_secondsdoes say "once the client reads it".
Secondary items:
- runtime.rs:2187-2203
reserve_and_packloopsstep.lanesand setsfirst_scheduled_nsbefore theif step.kind == GraphKind::Visionsplit at 2208, so vision lanes also stamp the queue end. - metrics/process.rs:19-32
parse_statlast-)heuristic; returns Some for ambiguous comms; module doc (lines 1-6) claims unreadable/unparsable sources omit the metric. - metrics/process.rs:65-67, 115-123
process_open_fdsincludes the read_dir handle, acknowledged in its HELP string. - metrics/process.rs:9-14 + helios/Cargo.toml:50
libcis non-optional and all uses arecfg(target_os = "linux"), so the Windows/non-Linux build has no new libc reference.
Coupling check: Metrics::request_completed at metrics.rs:452-480 is the only increment of completed; the two former sites were runtime.rs:1832 (user/text stop, now 1841-1846) and 1984 (natural finish, now 1993-1998).
#10 [high] Research summary
Verdict on the pushed head (a34c4d06): one new blocking build break, one should-fix counting divergence, otherwise the earlier findings are resolved. (Scratchpad notes #1–#9 describe the pre-push state; note #1 and #2 are now fixed — this report carries the new findings, as only finish was available this turn.)
Blocking (new, introduced by "Exclude cancelled responses and reuse host helpers"):
helios/src/server/metrics/process.rs:68callscrate::runtime_core::open_descriptors(), buthelios/src/lib.rs:22-26declarespub mod runtime_coreonly under#[cfg(feature = "runtime-core")], and theserverfeature (helios/Cargo.toml:25) does not enableruntime-core. Until this commit no non-test file underhelios/src/server/outside the#[cfg(feature = "runtime-core")]-gatedsessionmodule referencedcrate::runtime_core(onlymetrics/process.rs:68and the#[cfg(all(test, feature = "runtime-core"))]prompt_testsdo now). So--features server— the configuration the docs themselves invoke indocs/model-development.md:99anddocs/scheduling-runtime-design.md:735-737— stops resolving. Fix: moveopen_descriptorsintoeos/src/unix.rsnext topage_sizeandraise_open_file_limitand re-export it throughcrate::os(which ispub(crate) use flare_eos::*,helios/src/os.rs:8) — the same place the commit already took the other two helpers from, and whereAGENTS.md:20-21puts host OS operations — or gate the call. I could not compile here (no checks on this head), so this rests on the cfg reading;cargo check --manifest-path helios/Cargo.toml --features serversettles it in seconds.
Should fix (new):
- The new e2e exclusion is response-scoped while completions are per generation.
http.rs:598-605skips the observation whenencoder.tool_limit_reached, a flag on the shared encoder (protocol/encode.rs:89, set at:506), but one response can carry several generations (sizechoices,http.rs:340-353,generations: Vec<Option<Generation>>). A sibling choice that already finished before the tool limit was flagged keeps its runtime completion —Metrics::request_completedalready ran for it atruntime.rs:1841-1846/1996-2001, incrementingflare_requests_completed_totaland the queue/prefill/decode histograms — yet loses its e2e observation, soflare_request_e2e_seconds_count < flare_requests_completed_totalanddocs/api.md:315-316("Cancelled and failed requests enter only …") is wrong for that choice. Fix: decide per finished generation (e.g. skip only when the termination actually used athttp.rs:526isCancelled) instead of consulting the response-wide flag.
Nits: parse_stat's new state-character allow-list (metrics/process.rs:26, "RSDZTtWXxKPI") silently drops every stat-derived metric if a kernel ever reports another state letter; validating that the following fields parse would bound the same risk without a hard-coded alphabet.
Verified fixed since the last review: the tool-limit exclusion plus the single observation point before yield Delivery::Complete (http.rs:598-606) closes my finding #1, and the new assertion at runtime/phase_tests.rs:4604-4613 pins it; the streaming-drain asymmetry is now stated in docs/api.md:303-306, closing finding #2; the vision-step caveat is documented (docs/api.md:309-311), closing the open question in #3. "Hoist completion values" makes request_completed and the Finished event share prompt_tokens/generated_tokens (runtime.rs:1993-2001 vs :2017-2019), so the histograms and the response usage can no longer disagree. I re-derived parse_stat's index arithmetic (utime field 14 → nth(10), stime 15, starttime 22, vsize 23, rss 24) and it matches the fixture; raise_open_file_limit(0) (eos/src/unix.rs:138-147) returns the current soft limit with no side effect, so process_max_fds is sound; the process_open_fds +1 is now disclosed in its HELP text (process.rs:113).
#11 [high] Blocking: process.rs references feature-gated crate::runtime_core, breaking --features server
BLOCKING (new on head a34c4d06, introduced by "Exclude cancelled responses and reuse host helpers" d64c3ea3).
Evidence:
- helios/src/server/metrics/process.rs:68
let open_fds = crate::runtime_core::open_descriptors(); - helios/src/lib.rs:22-26:
#[cfg(feature = "runtime-core")] pub mod runtime_core;— the module does not exist without that feature. - helios/Cargo.toml:25:
server = ["dep:serde", "images", "grammar", "dep:axum", ...]— does NOT includeruntime-core. - helios/Cargo.toml:21:
runtime-core = ["dep:serde", ...]is a separate, unimplied feature. - Before this commit, no non-test file under helios/src/server/ outside the gated session module referenced crate::runtime_core. Now exactly two do: metrics/process.rs:68 (ungated) and runtime/prompt_tests.rs:13 (under
#[cfg(all(test, feature = "runtime-core"))], runtime.rs:3983). - docs invoke the server-only config: docs/model-development.md:99 (
--features server --lib frontend::), docs/scheduling-runtime-design.md:735-737 (--features server --lib scheduler::andserver::runtime::phase_tests::). - server.rs:26-29 gates only
mod session/pub use sessionon runtime-core, confirming the crate is expected to compile withserveralone. - Note the other two helpers this commit adopted are fine: crate::os is
mod os;unconditionally (lib.rs:19) andpub(crate) use flare_eos::*(os.rs:8), socrate::os::page_size()(process.rs:61) andcrate::os::raise_open_file_limit(0)(process.rs:70) resolve on every platform.
Fix: move open_descriptors (helios/src/runtime_core/protection.rs:291-302) into eos/src/unix.rs beside page_size (eos/src/unix.rs:73-75) and raise_open_file_limit (:138-165), and re-export it through crate::os — the same route the commit already used for the other two, and where AGENTS.md:20-21 puts host OS operations. Alternatively gate the call on the feature.
Caveat to state in the report: verified by cfg reading only; no compile was possible here and the head has no CI checks. cargo check --manifest-path helios/Cargo.toml --features server settles it immediately.
#13 [high] Research summary
Reviewed PR #548 at head a34c4d06 through the correctness lens. No new commits since the last round, so I re-verified the open findings against the current tree and they all still stand.
Blocking — --features server no longer compiles. helios/src/server/metrics/process.rs:68 calls crate::runtime_core::open_descriptors(), but helios/src/lib.rs:22-26 declares pub mod runtime_core only under #[cfg(feature = "runtime-core")], and helios/Cargo.toml:25's server feature does not enable runtime-core (helios/Cargo.toml:21 is a separate feature). The three references to crate::runtime_core under src/server are now session.rs:10 (not opened) (gated by server.rs:26-29), runtime/prompt_tests.rs:13 (not opened) (gated by #[cfg(all(test, feature = "runtime-core"))], runtime.rs:3983), and this ungated one. The configuration breaks the documented commands at docs/model-development.md:99-100 (not opened) and docs/scheduling-runtime-design.md:735-736 (not opened); CI (.github/workflows/native-serving.yml:63 (not opened),68) only builds runtime-core,server, which is why it is invisible there. Fix: move open_descriptors (helios/src/runtime_core/protection.rs:291-302) into eos/src/unix.rs beside page_size (eos/src/unix.rs:73) and raise_open_file_limit (:138) and re-export through crate::os (helios/src/os.rs:8), the route the same commit already took for the other two helpers, or gate the call. Verification is by feature/cfg reading — the head has no CI checks and I could not compile; cargo check --manifest-path helios/Cargo.toml --features server settles it.
Should fix — e2e exclusion is response-scoped, completions are per generation. helios/src/server/http.rs:598-605 skips the e2e observation when the shared encoder flag encoder.tool_limit_reached (protocol/encode.rs:89, set at :506) is set, but one response can carry several generations (generations: Vec<Option<Generation>>, built per choice at http.rs:351-353; n choices are accepted for /v1/completions, protocol/decode.rs:742-755, and http.rs:299 sizes from prepared.len()). A choice that finishes naturally before a sibling trips the limit is counted by Metrics::request_completed (runtime.rs:1841-1846, :1996-2001) and its queue/prefill/decode/prompt histograms, yet loses the e2e observation for the whole response, so flare_request_e2e_seconds_count < flare_requests_completed_total and the new docs/api.md sentence "Cancelled and failed requests enter only flare_requests_cancelled_total and flare_requests_failed_total" is false for that choice. Fix: decide per finished generation (e.g. skip only when the termination used at http.rs:526 is Termination::Cancelled), and pin it with an n: 2 test where one choice hits the tool limit.
Nit — parse_stat hard-codes the stat state alphabet. process.rs:26 rejects any state letter outside "RSDZTtWXxKPI" and returns None, which silently removes process_cpu_seconds_total, process_virtual_memory_bytes, process_resident_memory_bytes and process_start_time_seconds together, contradicting the module doc (process.rs:4-6) that only unreadable or unparsable sources are omitted. Validating that the five consumed fields parse (utime/stime/starttime/vsize/rss, indices re-derived and matching the fixture) bounds the same risk without a fixed alphabet.
Verified sound in code: Metrics::request_completed (metrics.rs:452-480) is the sole writer of completed, so recomputation of counter and histograms cannot diverge inside the runtime; queue/prefill require first_scheduled_ns/first_token_ns with saturating subtraction, decode and TPOT require generated_tokens > 1, and Incoming keeps its stamps through parking/readmission (runtime.rs:1334-1342, :2106-2121); each process metric renders independently so one bad /proc file never fails a scrape; raise_open_file_limit(0) (eos/src/unix.rs:138-165) only reads the soft limit; all new libc use is cfg(target_os = "linux") with a no-op non-Linux render (process.rs:8-14). Evidence limits: no CI on the head, no compile here, and the author's live scrape ran on a cherry-pick onto a fork commit rather than main.
Earlier findings are fixed on this head: the tool-limit e2e exclusion plus single observation point before yield Delivery::Complete, the documented streaming-drain asymmetry, the documented vision-step caveat, and hoisted prompt_tokens/generated_tokens shared between request_completed and the Finished event.
#14 [high] Report of 2026-11-27, run 2 (post-Autobot-comment, no new commits)
Verdict: blocking. No new commits since the last report (head still a34c4d06); the three findings from note #12 were re-verified line-by-line against the current tree, and nothing new was found. Nine changed files read in context: metrics.rs, metrics/process.rs, runtime.rs, http.rs, latency.rs, server.rs, phase_tests.rs, runtime_core/{mod.rs,protection.rs}, docs/api.md.
BLOCKING (unchanged, #12/#11) — --features server does not compile:
- helios/src/server/metrics/process.rs:68
crate::runtime_core::open_descriptors() - helios/src/lib.rs:22-26
#[cfg(feature = "runtime-core")] pub mod runtime_core; - helios/Cargo.toml:25
server = [...]omitsruntime-core(defined separately at :21) - Re-verified this round: search for
runtime_coreunder helios/src/server returns exactly three hits — session.rs:10 (gated by server.rs:26-29), runtime/prompt_tests.rs:13 (gated by#[cfg(all(test, feature = "runtime-core"))]at runtime.rs:3983), and metrics/process.rs:68 (ungated). Confirms the ungated one is the sole break. - Documented server-only configs: docs/model-development.md:99-100; docs/scheduling-runtime-design.md:735-736. CI only builds
runtime-core,server(.github/workflows/native-serving.yml:63,68), so it cannot catch this. - Suggested fix unchanged: move
open_descriptors(helios/src/runtime_core/protection.rs:291-302) into eos/src/unix.rs besidepage_size(eos/src/unix.rs:73) andraise_open_file_limit(:138) and re-export via crate::os (helios/src/os.rs:8), or gate the call. Settled bycargo check --manifest-path helios/Cargo.toml --features server; not runnable here.
SHOULD FIX (unchanged) — e2e exclusion is response-scoped, completions per generation:
- http.rs:598-605 skips on the shared
encoder.tool_limit_reached(protocol/encode.rs:89, set at :506) - Multi-generation responses: http.rs:351-353
generations: Vec<Option<Generation>>; http.rs:299size = prepared.len();naccepted for Completions only (protocol/decode.rs:742-755), decoder per choice (http.rs:391-399, :479-487, :525-527) - Runtime already counted the finished sibling (runtime.rs:1841-1846 and :1996-2001), so
flare_request_e2e_seconds_count < flare_requests_completed_totaland docs/api.md's "Cancelled and failed requests enter only flare_requests_cancelled_total and flare_requests_failed_total" is wrong there - Fix: per-finished-generation decision (skip only when termination at http.rs:526 is Termination::Cancelled); pin with an
n: 2tool-limit test
NIT (unchanged) — process.rs:26 hard-coded state alphabet "RSDZTtWXxKPI" → None removes cpu/vsize/rss/start_time together, contradicting module doc process.rs:4-6; validate the five parsed fields instead.
VERIFIED SOUND this round (no finding): metrics.rs:452-480 is the only writer of completed; queue/prefill gated on first_scheduled_ns/first_token_ns with saturating_sub; decode+TPOT require generated_tokens>1 (metrics.rs:470-479); RequestTimes survives parking (runtime.rs:2106-2121, 1334-1342); reserve_and_pack stamps every lane's first scheduled step (runtime.rs:2187-2203, called from submit at :2275); each process metric renders independently (process.rs:62-125); raise_open_file_limit(0) only reads the soft limit (eos/src/unix.rs:138-165); all new libc use is cfg(target_os="linux") with a no-op non-Linux render (process.rs:8-14); parse_stat index arithmetic (utime 14→nth(10), stime 15, starttime 22, vsize 23, rss 24) matches the test fixture at process.rs:141-148.
Evidence limits to state: no CI checks on the head; no compile available here (finding 1 rests on the cfg/feature graph); the author's live scrape ran on a cherry-pick onto fork commit 5ffe4d54, not main; the "merges in either order with #537" claim is asserted, not tested.
#16 [high] Report of 2026-11-27, run 3 (head 055663a, process metrics removed)
Head reviewed: 055663a7.
RESOLVED since last report:
- BLOCKING (old):
helios/src/server/metrics/process.rs:68calledcrate::runtime_core::open_descriptors()outside theruntime-corefeature. Commit 54e06b30 "Remove process metrics from the request latency change" deleteshelios/src/server/metrics/process.rsentirely (pr_files shows the file no longer among changed files; search forprocess_cpu_seconds|open_descriptors|metrics::processon head returns onlyhelios/src/runtime_core/protection.rs:291,354).server.rs:706no longer callsmetrics::process::render;metrics.rs:12no longer declarespub(super) mod process.open_descriptorsis back to a private fn in protection.rs (pub(crate) useremoved from runtime_core/mod.rs). Blocking finding closed.
STILL OPEN (should fix): helios/src/server/http.rs:606
if !count && !encoder.tool_limit_reached { state.model.metrics().response_completed(...) }.encoder.tool_limit_reachedis response-wide (protocol/encode.rs:89, set at:506when a choice exceedsparallel_tool_calls), whilegenerated[index]is per choice (http.rs:530). In a multi-choice /v1/completions or prompt-list response where one choice trips the tool limit, sibling choices that the runtime counted as completed (runtime.rs:1875,:2038) record noflare_request_e2e_seconds,flare_request_choices, orflare_request_max_choice_generated_tokensobservation, soflare_request_e2e_seconds_countcan fall belowflare_requests_completed_totalfor reasons other than the documented multi-choice rounding. Reachability depends on tools (rejected for Completions atprotocol/decode.rs:813-815,:753-755), so it is at minimum latent; it is the same defect class as the earlier cancelled-response finding.- Fix: gate on per-choice cancellation, e.g. track which indices were finished with
Termination::Cancelledathttp.rs:531-532and skip only those choices, or document the response-wide exclusion in docs/api.md (which currently says "responses the runtime records as cancelled").
VERIFIED SOUND on this head:
Metrics::request_completed(metrics.rs:545-603) remains the sole writer ofcompleted;output_limitedadded only whenoutput_limit(reason == "length"atruntime.rs:2037,2045); time histograms only whenfirst_token_ns/first_scheduled_nsare set; decode/TPOT requiregenerated_tokens > 1.RequestRecordmoves withIncomingthroughpark(runtime.rs:2130), keepsmax_tokens(set once atruntime.rs:1566-1570under!readmitted) andpreemptions(runtime.rs:2110), and requeue (runtime.rs:2660) preserves it too.cache_lookup_tokens(scheduler.rs:1601,1802) is added at the same site ascache_lookups, zero for prompt_logprobs, and included in the stats copy (metrics.rs:771).admission_rejectedreasons are wired at the three stated sites only (server.rs:816,http.rs:240,runtime.rs:869,:945); Paused/503 paths uncounted, matching docs.- New docs/api.md text matches the code: population statements for e2e, token, preemption, output-limited, lookup-token and model-step series all check out against
metrics.rs:545-618andruntime.rs:1721-1732;process_*claims removed from api.md. - No
process_*series remain in the tree, so the earlier "docs claim flare_-only names" nit is moot.
Evidence limits: still no compiler here; the cfg/feature claim above is from the file list plus search, which is sufficient since the file is gone.
#17 [high] Research summary
Reviewed PR #548 at head 055663a through the correctness lens. The previous round's blocking build break is gone: commit 54e06b30 deletes helios/src/server/metrics/process.rs (not opened) outright, drops mod process and the metrics::process::render call, and returns open_descriptors to a private fn in runtime_core/protection.rs (not opened), so --features server no longer reaches feature-gated runtime_core. No process_* series remain anywhere in the tree, which also makes the earlier docs nit moot and matches the documentation now shipped in docs/api.md (not opened).
One should-fix finding remains: helios/src/server/http.rs:606 gates the single response_completed call on the response-wide encoder.tool_limit_reached, while generated[] is per choice. In a multi-choice completions response where one choice trips the parallel-tool limit, the sibling choices the runtime counted as completed record no e2e, choice-count, or max-choice-token observation, so flare_request_e2e_seconds_count can diverge from flare_requests_completed_total for a reason docs/api.md (not opened) does not state. Reachability today needs tools plus more than one generation, which the decoder currently rejects for Completions, so it is at minimum latent — same defect class as the earlier cancelled-response finding, fixable by tracking the cancelled indices at http.rs:531-532.
Everything else I checked held: request_completed is still the sole writer of the completion counter, the output_limit derivation matches reason == "length", time histograms stay unobserved for zero-token completions, RequestRecord survives park/requeue with max_tokens set once at first admission and preemptions bumped at the park, cache_lookup_tokens is added at the same site as cache_lookups, the three rejection reasons are wired only at the stated paths with 503s uncounted, and the new documentation statements match the code. Evidence limit: no compiler or live scrape here, and the author's own scrape ran on a cherry-pick rather than main.
#18 [high] Should fix: response-wide tool_limit gate drops siblings' e2e observations — fix options and what settles it
FINDING (should fix): helios/src/server/http.rs:604-612
// One observation per successful response: a tool-limit cancellation reaches
// this point but the runtime counts it as cancelled, so it is excluded.
if !count && !encoder.tool_limit_reached {
state.model.metrics().response_completed(
admitted_at.elapsed().as_nanos() as u64,
decoded.request.choices,
&generated,
);
}
Evidence chain:
encoder.tool_limit_reachedis one flag for the whole response: declaredhelios/src/server/protocol/encode.rs:89, initialised false at:142, set at:506(if !self.parallel_tool_calls && self.outputs[index].has_tools() { self.tool_limit_reached = true; break; }), and read to forceTermination::Cancelledat:598and to drop the stop at:604.- Per-choice state is separate:
generated[index] = generated_tokensathelios/src/server/http.rs:530, and the per-choice finish uses the same global flag athelios/src/server/http.rs:531-532. - The runtime counts each choice as its own request and increments
flare_requests_completed_totalper choice:helios/src/server/runtime.rs:1875-1884(stop path,output_limit: false) and:2038-2047(finish path,output_limit: reason == "length"). Cancellation is counted elsewhere, inMetrics::cancelledatruntime.rs:1329-1330,:1350,:1373,:1420; the tool-limit stop is a client-side decoder cancel athttp.rs:569-573after the runtime has already completed the request, so siblings that were not cancelled lose nothing by the runtime but lose their HTTP observations here. - Consequence:
flare_request_e2e_seconds_count(andflare_request_choices/flare_request_max_choice_generated_tokens) can be lower thanflare_requests_completed_totalby every sibling choice of a multi-choice response that hit the tool limit — a causedocs/api.mddoes not list (it says only "responses the runtime records as cancelled, such as a parallel tool-limit stop", i.e. it claims the exclusion is per response the runtime recorded as cancelled, which is not what the code implements for siblings). - Reachability today: tools are rejected for
/v1/completions(protocol/decode.rs:813-815,reject(&body, &["tools", "tool_choice"])), andn > 1is rejected for every other protocol (protocol/decode.rs:753-755, "n must be 1"). So a multi-choice response with tools is currently unreachable through the public API — the defect is latent, not live. It becomes live if tools are ever allowed on Completions.
Fix options:
- Track cancelled indices in the stream (set a
Vec<bool>or reusegeneratedwith a sentinel when finishing a choice withTermination::Cancelledathttp.rs:531-532) and pass only the surviving choices toresponse_completed; still observe e2e once when at least one choice delivered. - If the behaviour is intended, say so in
docs/api.mdnext to the e2e population text: the whole response is excluded when any choice hits the parallel tool limit, so the e2e count can trail the completion count by the sibling choices too.
What would settle it: a phase test (see helios/src/server/runtime/phase_tests.rs:4303-4370 for the HTTP fixture pattern used by full_http_admission_counts_a_queue_limit_rejection) posting a two-choice completions request with tools enabled and asserting either flare_request_e2e_seconds_count == 2 (siblings counted) or == 0 (response-wide exclusion) against flare_requests_completed_total. Today the request cannot even be built, which is itself the evidence that the path is latent.
#20 [high] Report of 2026-11-28, run 1820 (head 6624592) — sample-set refactor and stamp move verified
Correctness review of PR #548 (head 6624592)
Verdict: should-fix issues only (one carried over, latent)
New commit 66245920 reviewed — both halves verified sound
-
kind.samples()replaces the inline match forflare_model_step_tokens.GraphKind::samples(helios/src/execution/manifest.rs:90-101) returns exactlyPrefill | TerminalPrefill | ScoredPrefill | Decode | Speculative | Mixed | Resume— the same seven variants the deleted inlinematches!athelios/src/server/runtime.rs:1718-1730(diff) listed, so no population change. Its pre-existing users are the logprob-binding checks (manifest.rs:944,execution/transport.rs:1319,:1334) and the sampling-admission guard (runtime.rs:2948), all of which mean "this graph samples tokens"; reusing it for the step-token histogram is semantically the same predicate.prefillis summed only for the kinds in thematches!atruntime.rs:1669-1677, which excludesResume, so a resume graph contributesprefill = 0and counts only committed tokens — matchingdocs/api.md:383-386("every completed prefill, resume, decode, speculative, or mixed graph … prompt tokens it computed plus the generated tokens it committed"; vision/init/restore/snapshot not observed, and none of them are insamples()).
-
first_scheduled_nsstamp moved from before packing to after it (runtime.rs:2259-2275).- Both pack paths precede the stamp: the vision branch (
runtime.rs:2218-2249) andcrate::model::pack_inputs(runtime.rs:2250-2258);Ok(())is returned only after the stamp loop, so a failed pack leaves the instant unset exactly as the new comment says, and the only failure path issubmitpropagatingErrout ofWorker::run(runtime.rs:1154) which fails every request — no request can complete with an unset stamp and then be counted, so no histogram/counter divergence. - The stamp loop still filters by handle (
filter(|a| a.request == lane.request)) againstself.active[lane.request.slot], so a slot recycled betweenscheduler.commit(runtime.rs:2213) and the loop cannot be stamped. - Effect on the metric:
flare_request_queue_seconds= first-token-arrival to stamp (metrics.rs:581-583) now includes the step's input packing, andflare_request_prefill_seconds/flare_request_inference_seconds(metrics.rs:584-590) exclude it.docs/api.md:329-336defines the origin as "the first model step that includes the request", which both readings satisfy; the shift is one pack of a single step. No finding.
- Both pack paths precede the stamp: the vision branch (
Carried-over should fix (unchanged by this commit, re-read and still present)
helios/src/server/http.rs:604-612 — the e2e/choice observations are gated on the response-wide
encoder.tool_limit_reached (protocol/encode.rs:89, set at :505-507, read at http.rs:476-481,
:531-532, :569-573) while generated[] is per choice (http.rs:530, generated = vec![0; size] at
:407). A sibling choice the runtime counted as completed (runtime.rs:1857-1875, :2029-2038) gets no
flare_request_e2e_seconds, flare_request_choices, or flare_request_max_choice_generated_tokens
observation, so e2e_count can trail flare_requests_completed_total by a cause docs/api.md:311-318
does not list. Latent today: tools are rejected for Completions (protocol/decode.rs:813-815) and
n > 1 is rejected for every other protocol (decode.rs:753-755).
Nits (carried over, unchanged)
http.rs:606's!countis dead — count responses return athttp.rs:284-286before the delivery stream exists.- Non-stream e2e is observed before the body is polled (
http.rs:606-612vs the lazy body athttp.rs:642-651), unlike the documented drain requirement for streams (docs/api.md:317-318). - Decode/TPOT include the preemption wait (
metrics.rs:593-601) but onlyflare_inter_token_latency_secondssays so indocs/api.md:342-345. - New, minor:
metrics.model_step(prefill + generated.len())also runs for a step whose every lane completed withstatus == 3(error frames), observing a 0-token sample and loweringflare_model_step_tokensmean.docs/api.md:383-386does not exclude zero-token steps.
Verified in this round (no finding)
flare_parked_requestspopulation matchesdocs/api.md:372-376: written only bypublish_gauges(runtime.rs:1202-1211) and zeroed at worker shutdown (runtime.rs:749-750); fed byself.parked, which receives exactly the preemption park (runtime.rs:2101-2102), the reasoning-budget park (runtime.rs:1991) and the pool/host requeue (runtime.rs:2630-2664).flare_admission_rejections_totalwriters are onlyserver.rs:816(429 http_slots),http.rs:237-240(multi-choice slot exhaustion),runtime.rs:868-869(generation capacity) andruntime.rs:943-945(channel full); the paused-admission and unavailable-runtime 503s are not counted, matchingdocs/api.md:377-382.cache_lookup_tokensis added at the single site that already countscache_lookups(scheduler.rs:1801-1802) withlooked_up = 0for prompt-scoring (scheduler.rs:1601), and is copied inmetrics.rs:768-771.Docs vLLM parity table(docs/api.md:485-515) states novllm:names are exported;kv_cache_usage_percis marked "not provided as one ratio" (line 490), so theCloses #536claim is narrowed in the doc text.
Evidence limitations
- No compiler or live scrape here. The author's scrape (comment 2026-11-28 03:26) ran on an image built from upstream main with this PR, #549 and #560 merged; unrun items are disclosed (multi-GPU cores, Windows build, isolated recording cost).
#21 [high] Research summary
Reviewed PR #548 at head 6624592 through the correctness lens, including the one new commit (66245920).
New commit verified sound. Replacing the inline matches! with GraphKind::samples() is an exact population match (manifest.rs:90-101 lists the same seven variants, and prefill is only summed for the non-Resume kinds at runtime.rs:1669-1677, so a resume step contributes only its committed tokens — consistent with docs/api.md:383-386). Moving the first_scheduled_ns stamp to after packing (runtime.rs:2259-2275) leaves the instant unset exactly on a failed pack, and a failed pack propagates out of Worker::run and fails every request, so no completion can be counted without its queue/prefill/inference observations; the slot-reuse filter is preserved. The metric effect is that queue time now includes one step's input packing, which both readings of "the first model step that includes the request" allow.
One should-fix remains, carried over unchanged: http.rs:604-612 gates the e2e/choice observations on the response-wide encoder.tool_limit_reached while generated[] is per choice, so a sibling choice the runtime counted as completed records none of flare_request_e2e_seconds, flare_request_choices, or flare_request_max_choice_generated_tokens. It is latent (tools are rejected for Completions; n > 1 is rejected everywhere else), so the fix is either per-choice observation or a documented response-wide exclusion.
Nits: the dead !count guard at http.rs:606; non-stream e2e observed before the body is polled, unlike the documented drain rule for streams; decode/TPOT include the preemption wait although only the inter-token doc says so; and a new one — model_step also observes a 0-token sample for a step whose lanes all error out, which the docs do not exclude.
Also re-verified without finding: the flare_parked_requests population and its three feeder paths, the four admission_rejections writers (503s correctly uncounted), cache_lookup_tokens at the single cache_lookups site with the prompt-scoring zero, and the parity table's "not provided" rows. No compiler or live scrape was available here; the author's scrape ran on an image built from main with #549 and #560 merged, and the unrun items are disclosed.
#22 [high] Resolved-blocker status at head 6624592 (for the report summary)
Status of earlier findings at head 6624592 (2026-11-28 run)
Previously blocking, now resolved and still resolved at this head. The build break from commit
d64c3ea3 — helios/src/server/metrics/process.rs:68 calling the feature-gated
crate::runtime_core::open_descriptors() while runtime_core is #[cfg(feature = "runtime-core")]
(helios/src/lib.rs:22-26) and server does not enable it — is gone: commit 54e06b30 deleted
helios/src/server/metrics/process.rs and its call site. The PR now changes 9 files
(docs/api.md, scheduler.rs, scheduler/tests.rs, server.rs, server/http.rs, server/latency.rs,
server/metrics.rs, server/runtime.rs, server/runtime/phase_tests.rs — pr_files), none of them
metrics/process.rs; no process_* series and no metrics::process reference remain. The newer
commit 66245920 touches only server/runtime.rs. So --features server no longer reaches
runtime_core, and the "omit process_* counters" nit from the first round is moot.
(Established from the file list and source reads — no cargo check available here.)
Verdict lines for the report:
- Blocking: none.
- Should fix (1): response-wide
tool_limit_reachedgate drops siblings' HTTP observations —helios/src/server/http.rs:604-612vshelios/src/server/protocol/encode.rs:89,505-507,helios/src/server/http.rs:407,530; latent becausedecode.rs:813-815rejects tools for Completions anddecode.rs:753-755rejectsn > 1elsewhere. Fix options and the phase test that would settle it are in scratchpad #18. - Nits (4): dead
!countat http.rs:606; non-stream e2e observed before body poll (http.rs:606-612 vs :642-651) against docs/api.md:317-318; decode/TPOT preemption span undocumented (metrics.rs:593-601 vs docs/api.md:342-345); new —model_stepobserves a zero-token sample when every lane of a step completed withstatus == 3(error frames), lowering the mean, and docs/api.md:383-386 does not exclude zero-token steps.
Verified-correct highlights to cite: request_completed (metrics.rs:543-603) is the only writer of
flare_requests_completed_total; output_limited == reason == "length" (runtime.rs:2028-2037);
RequestRecord survives park/requeue (runtime.rs:2101-2102, :2126, :2637-2664) with max_tokens
set once under !readmitted (runtime.rs:1566-1570); inter_token is fed once per step at
position == 0 (runtime.rs:1792-1796) and absorbed at completion; flare_parked_requests writers are
publish_gauges (runtime.rs:1202-1211) and the shutdown zero (runtime.rs:749-750); the four
admission_rejections sites are server.rs:816, http.rs:237-240, runtime.rs:868-869, :943-945,
with both 503 paths uncounted; cache_lookup_tokens sits beside cache_lookups (scheduler.rs:1601,
:1801-1802) and is copied at metrics.rs:768-771.
Evidence limitations: no compiler or live scrape here; the author's scrape (comment 2026-11-28 03:26) ran on an image built from main with this PR, #549 and #560 merged; unrun items (multi-GPU cores, Windows, isolated recording cost) are disclosed.
#24 [high] Report of 2026-11-28, run 1826 (head 6624592, no new commits) — re-verified, verdict unchanged
Correctness review of PR #548 (head 6624592) — no new commits
pr_comments shows no author push after the previous round; the newest PR comment is the
Autobot review of 2026-11-28 05:09. pr_files still lists the same 9 files
(docs/api.md, helios/src/scheduler.rs, scheduler/tests.rs, server.rs, server/http.rs,
server/latency.rs, server/metrics.rs, server/runtime.rs, server/runtime/phase_tests.rs) and
helios/src/server/metrics/process.rs is absent, so the earlier blocking build break
(crate::runtime_core::open_descriptors() from a non-runtime-core build, helios/src/lib.rs:22-26)
stays resolved.
Verdict: should-fix issues only
Blocking — none
Should fix (1, carried over, latent)
helios/src/server/http.rs:604-612:
if !count && !encoder.tool_limit_reached {
state.model.metrics().response_completed(
admitted_at.elapsed().as_nanos() as u64,
decoded.request.choices,
&generated,
);
}
tool_limit_reachedis response-wide: declaredprotocol/encode.rs:89, set at:505-507(if !self.parallel_tool_calls && self.outputs[index].has_tools() { self.tool_limit_reached = true; break; }), read without an index athttp.rs:476-481,:531-532,:569-573, and inencode.rs:458-460,:598,:604.generatedis per choice:vec![0u32; size]athttp.rs:407,generated[index] = generated_tokensathttp.rs:530;response_completed(metrics.rs:608-618) then emits onerequest_choices/request_max_choice_generated_tokensobservation per prompt chunk.- The runtime counts each choice as a completed request inside
Metrics::request_completed(metrics.rs:545-603, the only writer ofcompletedat:558), called fromruntime.rs:1866(stop path) and:2029-2038(finish path). - So a response whose sibling choice trips the tool limit suppresses the HTTP observations of
every choice that completed — the exact counter/histogram divergence the design avoids
elsewhere.
docs/api.md:311-318lists only count_tokens and "responses the runtime records as cancelled" as exclusions, and:322-326claims one choice observation per prompt per delivered response. - Latent today: tools are rejected for Completions (
protocol/decode.rs:813-815) andn > 1is rejected for every other protocol (decode.rs:753-755), so no public request combines them. - Fix: decide per generation (
http.rs:530-532knows which index was cancelled) or document the response-wide rule. A phase test in the style ofdisabled_parallel_calls_complete_http_and_stop_decoding(phase_tests.rs:4650-4720) building a 2-choice completions request with tools would settle it.
Nits (4, carried over, all re-read)
http.rs:606—!countis dead: count responses return athttp.rs:284-286before the delivery stream is built.http.rs:606-612vs:642-651— non-stream e2e is observed inside the generator, before the body is polled, whiledocs/api.md:317-318documents the drain requirement only for streams.metrics.rs:593-601vsdocs/api.md:342-345— decode and TPOT are last-minus-first committed token, so they include the preemption wait, but only the inter-token doc says so.runtime.rs:1721-1722—self.metrics.model_step(prefill + generated.len() as u64)runs for everykind.samples()step, including a step whose lanes all returned status 3, adding a 0-token sample;docs/api.md:383-386does not exclude zero-token steps.
Re-verified sound this round (no finding)
request_completedremains the sole writer of the completion counter and all per-request histograms (metrics.rs:545-603);completed.fetch_addappears only atmetrics.rs:558in the wholehelios/src/servertree.- Premature-completion question checked and cleared:
close_reasoning(runtime.rs:427-439) bumpscarried.generated_tokens, andrecord_decoded_token(scheduler.rs:1111) is the matching scheduler-side bump atruntime.rs:1968, so the forced reasoning close counts as a generated token on both sides andrequest_completed'sgenerated_tokensstays consistent withflare_generated_tokens_total. record.max_tokensis set once under!incoming.readmitted(runtime.rs:1566-1570) asprompt.max_new_tokens + reasoning_cut.after, i.e. the limit at first admission including the deferred budget, matchingdocs/api.md:355-358;parkre-derivesmax_new_tokensfor the continuation (runtime.rs:2125) without touching the record.record.preemptionsis bumped only inpark_if_preempted(runtime.rs:2099-2102), not for the reasoning-budget park (runtime.rs:1991) nor the host-requeue (runtime.rs:2637-2664), matchingdocs/api.md:359-360("preempted and readmitted") and the phase-test comment at:684-690.first_scheduled_nsis stamped after both pack paths (runtime.rs:2258-2275) with the slot-reuse filter, so a failed pack leaves it unset and no counted completion can lack its queue/prefight observations.cache_lookup_tokensadded at the singlecache_lookupssite (scheduler.rs:1801-1802) withlooked_up = 0for prompt scoring (scheduler.rs:1600); copied inmetrics.rs:768-771.flare_admission_rejections_totalwriters are exactlyserver.rs:816,http.rs:237-245,runtime.rs:868-874,runtime.rs:944-947; the Disconnected/Unavailable paths are uncounted, matchingdocs/api.md:377-382.flare_parked_requestsfrompublish_gauges(runtime.rs:1202-1211) and zeroed at shutdown (runtime.rs:749-750), fed byself.parked.flare_parked_requests/flare_pending_requestscannot include admitted host-restore waiters — those live inself.active(runtime.rs:1578-1591), matchingdocs/api.md:372-376.
Evidence limitations
- No compiler or live scrape here. The author's scrape (comment 2026-11-28 03:26, table in the PR
thread) ran on an image built from upstream
mainwith this PR, #549 and #560 merged; the unrun items (multi-GPU cores, Windows build, isolated recording cost) are disclosed in the description, which satisfies the repository's disclosure rule. - Re-verified from source only;
cargo check --features serverand one scrape against a tool-carrying 2-choice completions request would settle the remaining items.
#25 [high] Research summary
Reviewed PR #548 at head 6624592 through the correctness lens. No new commits since the previous round, so I re-verified the standing findings against the current tree and re-checked the paths I had not yet walked (forced reasoning close vs. generated-token accounting, max_tokens/preemption record lifecycle, first_scheduled_ns stamping after packing, every counter writer).
Verdict: should-fix issues only. No blocking items: the earlier --features server build break (metrics/process.rs (not opened) calling feature-gated crate::runtime_core) remains fixed — the file is gone from the PR's 9 files and no process_* series remain.
One should-fix (latent): helios/src/server/http.rs:604-612 gates the e2e/choice observations on the response-wide encoder.tool_limit_reached (protocol/encode.rs:89,505-507) while generated[] is per choice (http.rs:407,530) and the runtime counts each choice as a completed request (runtime.rs:1866,2029; metrics.rs:545-603). A sibling choice that finished naturally therefore records no flare_request_e2e_seconds, flare_request_choices, or flare_request_max_choice_generated_tokens — a divergence docs/api.md:311-326 does not list. Unreachable through the public API today (tools rejected for Completions, n > 1 rejected elsewhere).
Four nits: dead !count at http.rs:606; non-stream e2e observed before the body is polled, unlike the documented stream drain rule; decode/TPOT include the preemption wait though only the inter-token doc says so; model_step observes a 0-token sample for a step whose lanes all errored, which the docs do not exclude.
Newly cleared this round: the forced reasoning close bumps carried.generated_tokens and scheduler.record_decoded_token symmetrically, so it cannot desynchronise request_completed from flare_generated_tokens_total; record.max_tokens and record.preemptions are written exactly at first admission and the real preemption park, matching the doc. Evidence limit: no compiler or live scrape here; the author's scrape used main plus #549 and #560. Full detail with citations is in scratchpad entry #24.
#26 [high] Report skeleton and coverage statement for the 2026-11-28 run (head 6624592)
Skeleton for the final report (PR #548, head 6624592, 2026-11-28 run)
Use entry #24 for the body. Verdict lines:
- Blocking: none. Earlier build break stays fixed:
helios/src/server/metrics/process.rsis absent frompr_files(9 files: docs/api.md, helios/src/scheduler.rs, scheduler/tests.rs, server.rs, server/http.rs, server/latency.rs, server/metrics.rs, server/runtime.rs, server/runtime/phase_tests.rs), deleted in commit54e06b30; noprocess_*series ormetrics::processreference remain. - Should fix (1, latent):
helios/src/server/http.rs:604-612— response-wideencoder.tool_limit_reachedgate vs. per-choicegenerated[](protocol/encode.rs:89,505-507;http.rs:407,530;runtime.rs:1866,2029;metrics.rs:545-603,608-618; docs claim atdocs/api.md:311-326). Reachability blocked byprotocol/decode.rs:753-755(n > 1only for Completions) anddecode.rs:813-815(tools rejected for Completions). Fix options and the settling phase test: scratchpad #18. - Nits (4): dead
!countathttp.rs:606; non-stream e2e observed before the body is polled (http.rs:606-612vs:642-651) againstdocs/api.md:317-318; decode/TPOT include the preemption wait (metrics.rs:593-601) but onlydocs/api.md:342-345says so for inter-token;model_steprecords a 0-token sample for an all-error step (runtime.rs:1721-1722) whichdocs/api.md:383-386does not exclude.
Coverage (done-criterion): all 9 changed files read in context through this lens across rounds —
metrics.rs (buckets, Histogram, RequestRecord, request_completed, response_completed,
render, tests), runtime.rs (enqueue/Incoming, admit, park/requeue, complete/publish, token commit,
reserve_and_pack, admission rejections, gauges), http.rs (admission, delivery stream, both
response arms, the e2e gate), latency.rs (window + histogram), server.rs (metrics route,
admit_http), scheduler.rs + scheduler/tests.rs (cache_lookup_tokens), phase_tests.rs, docs/api.md.
Related scratchpad entries: #18 should-fix citation sheet and fix options; #20 review of commit
66245920 (GraphKind::samples reuse, first_scheduled_ns move); #22 resolved-blocker status;
#23 previous full report; #24 this run's findings and verified-clear list.
Evidence limitations to state: no compiler or live scrape in this review; the author's scrape
ran on an image built from upstream main with this PR, #549 and #560 merged, and the unrun items
(multi-GPU cores, Windows build, isolated recording cost) are disclosed in the description.
docs/api.md parity table (:485-515) explicitly says no vllm: names are exported and marks
kv_cache_usage_perc "not provided as one ratio" (:490), so Closes #536 is a narrowed claim
rather than a false one — that is a docs/scope observation, not a correctness finding.
#2 [medium] Should fix: streaming e2e depends on the client draining the SSE body, undocumented asymmetry with non-stream
http.rs:600-620: for streaming, the Delivery::Complete(_) arm runs inside the filter_map that back Sse, so flare_request_e2e_seconds is observed only if the client actually polls the stream to its end. A client that disconnects mid-stream (the common cancel path) never reaches it.
http.rs:629-641: the non-streaming path observes e2e in the handler before the JSON body is polled, so it records even when the client never reads the response — the added test first_response_http_nonstream_records_only_when_completed_body_is_offered (phase_tests.rs:4461-4465) asserts exactly that (count 1 for the poll_body == false case).
Why it matters: flare_request_e2e_seconds_count therefore diverges from flare_requests_completed_total for streamed requests (which are the majority for chat), in the opposite direction from the non-stream case, and docs/api.md says only "counts each successful generation from admission to the completed response" — unlike the neighbouring flare_time_to_first_response_seconds sentence, which does say "once the client reads it". The asymmetry is a real, operator-visible property that the docs do not state.
Fix: state in docs/api.md that streaming observations require the client to read to the end, and that non-streaming records at handler completion; alternatively record e2e on the runtime completion path for both. Verified by reading the two arms; the streaming early-disconnect case would need a test.
#3 [medium] Note: first_scheduled_ns is also stamped by GraphKind::Vision lanes
metrics.rs:452-480 request_completed divides decode / u64::from(generated_tokens - 1) for flare_time_per_output_token_seconds. decode is last_token_ns - first_token_ns, i.e. the interval between the first and last committed token. With exactly two tokens the denominator is 1, so TPOT equals the full first→last interval, which is correct-ish; with N tokens it divides by N-1, correct.
However at runtime.rs:1773-1775 the stamps are set inside the per-token loop only for tokens whose active[slot] entry matches a.request == token.request, and last_token_ns is overwritten for every emitted token of that request, including tokens that are then discarded by a stop (stopped.push + continue at 1780-1795 for reasoning/grammar failures, and 1822-1828 for emit_output failure). For a request that fails mid-step the stamps are updated but request_completed is never called, so no divergence in output — the observation is simply skipped, consistent with the doc.
Real edge found: reserve_and_pack (runtime.rs:2187-2203) stamps first_scheduled_ns for lanes of a GraphKind::Vision step too (it loops all step.lanes before the kind == Vision branch). A vision step is not a generation step that "includes the request" for prefill purposes, so for an image request the queue time ends at the vision step rather than at the first prefill step, making flare_request_queue_seconds understate queue delay and flare_request_prefill_seconds absorb the vision work. Worth confirming against how vision lanes are scheduled; the doc says "the first model step that includes the request", which the vision step arguably is, so this may be intended — flag as a question, not a defect, unless the lane kinds say otherwise.
#4 [medium] Nits/notes: process.rs parse heuristics and non-Linux compilation
process.rs:22-31 parse_stat splits on the last ). /proc/self/stat command name cannot contain )? It can — the comm field is parenthesized and may contain ) and spaces; the kernel does not escape them, so taking the last ) is the standard heuristic but is wrong for a process whose name itself ends with ) plus following text (e.g. comm == "a) b" gives tail from the inner )). This is a documented upstream ambiguity (proc(5) says use the last )); it only affects the metrics, never panics, and a misparse would shift all five fields consistently — but parse_stat returns Some rather than None in that case, so the reported CPU/memory would be wrong rather than omitted. The module doc claims a malformed file omits the metric; a systematic offset in the tail is not detected. Low practical impact (flare's own comm is fixed), so nit at most.
process.rs:65-67 process_open_fds counts entries of /proc/self/fd, and the read_dir handle itself is one of them — the code acknowledges this in the HELP text ("including the directory read that counts them"). Prometheus' client_golang excludes it, so the number is +1 relative to the conventional series. Since the HELP text says so, this is a documented deviation, not a defect; worth a nit only if parity with the standard exporter matters.
process.rs:79-114: process_cpu_seconds_total and process_start_time_seconds use (stat[0] + stat[1]) as f64 / ticks as f64; u64 addition can overflow only after ~2^64 ticks, not reachable. rlim_cur is printed via Display for rlim_t, fine.
process.rs:12-13 #[cfg(not(target_os = "linux"))] let _ = text; compiles on Windows — the functions parse_stat, parse_btime, metric, render_linux are all cfg(target_os = "linux"), and libc is a non-optional dependency in helios/Cargo.toml:50, so the non-Linux build of this module references no libc item. The Windows build was not run by the author (stated), but nothing in this file introduces a Windows-only compile error; libc::rlimit/getrlimit/RLIMIT_NOFILE are inside the Linux cfg. No blocking platform finding. Note helios/src/os.rs and dashboard.rs already use libc under unix cfgs, so precedent exists.
#5 [medium] Verified-correct items and evidence limitations
-
Cherry-picked base. Author states the branch was built on the AzallazA fork commit
5ffe4d54, cherry-picking this change because that model needs the fork's Engram encoding (upstream PR #482). The live-scrape evidence therefore exercises this diff on a fork, not onmain; the conflict resolution "kept only the added function". This is disclosed, so not a defect, but the merge-risk claim ("merges in either order" with #537) is asserted, not tested — CI on head has no checks (orientation packet) and the author did not run the full helios suite or Windows build. -
Prompt-token histogram includes tokens reused from the prefix cache (metrics.rs help text; docs/api.md).
prompt_tokensat runtime.rs:1838-1839 iscarried.prompt_tokens.unwrap_or(live.prompt_tokens), which is the full prompt length including reused tokens — consistent with the documented wording. Fine. -
Flare_time_to_first_response_secondshistogram lives inFirstResponseSamples(latency.rs:34-37) rather thanMetrics, so it is not exposed in the JSON snapshot (server.rs:645-658 returns before render_histogram) — consistent with docs "histograms appear only in the Prometheus text".render_histogramis called at server.rs:671 after the median gauge, before input metrics; no duplicate series names (checked: no otherflare_time_to_first_response_seconds). -
Histogram rendering emits
# HELP/# TYPEand buckets in ascending bound order with cumulative counts from per-bucket atomics;+Infbucket equals total, and_countuses the same cumulative value, so consistency holds even under concurrent observation only approximately (a concurrent observe between the last bucket load and the_countline cannot happen becausecumulativeis reused). Sum usesu64nanoseconds, so a >584-year total would wrap; irrelevant. -
Metrics::request_completedis called at both formercompleted.fetch_addsites (runtime.rs:1841 user/text stop incomplete, runtime.rs:1993 natural finish inpublish); grep confirms no remaining directcompleted.fetch_addin helios/src/server. Counter and histograms therefore cannot diverge for completed requests. Verified against main: the only two sites on main were runtime.rs:1832 and 1984. -
Bucket boundaries:
position(|bound| exposed <= bound)with the last bound infinite guarantees an index;unwrap_or(N-1)is unreachable.0.1etc. are exactly representable enough that100_000_000 ns → 0.1 slands in thele="0.1"bucket (test assertsle="0.1"is 0 for 169 ms... actually asserts 250 ms inle="0.25"and 0 inle="0.1"), matching Prometheus convention.
#8 [medium] Rules cited and evidence-limitation notes
Rules the review should cite:
- charter (read_charter): "Supported matrix & compatibility — Check interactions across every supported model, cache scheme, parallel layout, multi-host setup, and hardware target named in the docs." and "PR descriptions: Expect four parts: why, what changed, the claimed result, and the evidence."
- AGENTS.md:182-186 "Reject weakened guarantees… Do not remove validation, suppress errors…" (relevant only insofar as the docs claim an invariant the code does not hold).
- AGENTS.md:194-199 "Require focused, meaningful validation… Identify missing hardware, inputs, and unrun checks explicitly."
- docs/design-review.md principle 12 "Validate the real path and report evidence honestly… keep raw measurements and disclose unrun checks and material limitations."
Disclosed limitations in the PR description (accurate as far as I could check): Windows build not run; full helios suite not run; messages_image_hints_end_after_expansion_for_text_and_segmented_templates not run (needs FLARE_TEST_TEMPLATE_DIR from tests/frontend/prepare_templates.py). Live scrape was taken from a cherry-pick of this diff onto AzallazA fork commit 5ffe4d54 (upstream PR #482 dependency), not on main, and that instance also served the authoring agent's own requests, so the reported deltas exceed the three test requests — stated plainly in the description. CI on head ebecef1 has no checks (orientation packet). The claim that this PR and #537 "merge in either order" is asserted, not tested: they touch different functions in metrics.rs (request histograms beside the completion counter here; page gauges beside cached_pages there).
Also worth stating in the report: the author's own histogram observation buckets in the live scrape are consistent with the three-request window only after allowing for session requests (le="64" gained 1, le="2048" gained 4), which the description explains; nothing in that evidence contradicts the code reading.