#1 [high] Should fix: inline GraphKind list duplicates GraphKind::samples()
helios/src/server/runtime.rs:1746-1757 (head ce44060) gates self.metrics.model_step(...) on
if matches!(kind, GraphKind::Prefill | GraphKind::TerminalPrefill | GraphKind::ScoredPrefill
| GraphKind::Resume | GraphKind::Decode | GraphKind::Speculative | GraphKind::Mixed)
That is exactly the complement of GraphKind::Init | Restore | Snapshot | Vision, i.e. exactly GraphKind::samples():
helios/src/execution/manifest.rs:90-101
pub fn samples(self) -> bool {
matches!(self, Self::Prefill | Self::TerminalPrefill | Self::ScoredPrefill
| Self::Decode | Self::Speculative | Self::Mixed | Self::Resume)
}
Established precedent for consuming it in this same file: runtime.rs:2988 if !step.kind.samples() { return Ok(()); }, plus execution/transport.rs:1319,1334, execution/manifest.rs:944, model/testing.rs:170.
Why it matters: a second spelling of "which graphs run the model" drifts when a GraphKind is added; the manifest predicate also drives the logprob/timestamp outputs the same step produces, so the two answers must agree. Fix: if kind.samples() { self.metrics.model_step(prefill + generated.len() as u64); } and drop the seven-arm match. Same helper also expresses the docs claim in docs/api.md (added text: "initialization, restore, vision, and snapshot graphs are not observed").
#5 [high] Research summary
Reviewed PR #560 (head ce44060) through the conventions-and-duplication lens: read the diff of all 18 changed files, plus the surrounding code (http.rs generate path, encode.rs Encoder, runtime.rs Worker::complete/reserve_and_pack/enqueue_many, metrics.rs histogram machinery, config.rs bootstrap, latency.rs, observation.rs, flare-cli/src/cli.rs) and the repository rules (AGENTS.md, docs/design-review.md, .agents/skills/repo-prose/SKILL.md (not opened), the charter).
Four findings recorded in the scratchpad (no blockers):
-
Should fix —
helios/src/server/runtime.rs:1746-1757gatesmetrics.model_stepon a seven-armmatches!(kind, Prefill | TerminalPrefill | ScoredPrefill | Resume | Decode | Speculative | Mixed), which is exactlyGraphKind::samples()(helios/src/execution/manifest.rs:90-101). The same file already consumes that predicate atruntime.rs:2988, as doexecution/transport.rs:1319 (not opened),1334andexecution/manifest.rs:944. Second spelling of "which graphs run the model" drifts when a GraphKind is added. Fix:if kind.samples(). -
Should fix —
helios/src/server/protocol/encode.rs: the newTiming.streaming(line 80, fed byenable_request_metrics's argument, line 245) duplicates the existingEncoder.streaming(line 97, set byset_logprobs, line 192). Both happen to be feddecoded.streamin http.rs (:352, :363), but nothing enforces it andset_logprobsis called directly by tests.record_commit/metrics_valueshould readself.streaming. -
Nit — the new
Buckets<N>/Histogram<N>(metrics.rs:211-322) migrates onlylatency.rs; the three pre-existing host-cache histograms (HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETS,host_cost_sums,host_lookup_cost, the bespoke render loop at :1178-1214) keep their own implementation. The stacked PR #548's review raised the same conversion. -
Nit —
config.rs:353-357re-spells the three-arm boolean match already atconfig.rs:183-187(history_drafts), andconfig.rshas aninteger()helper but noboolean().
Nothing else in the lens stood out: the commits flag is threaded as a plain bool through the existing observation-style plumbing rather than a new abstraction, Finished/Committed follow the existing GenerationEvent variant conventions, the flag reaches rank zero the same way --api-key-file does (cli.rs:671-701), the bootstrap key has no [server] config-file counterpart consistently with --bypass-performance-check, and the docs changes replace stale claims rather than layering history.
#6 [high] Coverage: PR #560 conventions/duplication lens — files read and what came back clean
PR #560 "Emit vLLM-compatible per-request metrics from runtime instants", open, head ce44060, base main, 18 files +1898/−123. Lens: conventions and duplication. Rules read: AGENTS.md (esp. §Required PR descriptions, §Contribution scope, §Configuration), docs/design-review.md (principles 1, 3, 10, 15, 16, 17), .agents/skills/repo-prose/SKILL.md, and read_charter (line 12 model-agnostic runtime, line 13 don't silently drop API fields, line 43 no per-model flags).
Read in context (not only the diff): helios/src/server/http.rs generate//:100-680 (encoder construction, submission, event loop, terminal delivery), protocol/encode.rs :1-300 and :520-867 (Encoder, apply, finish, response, usage_value), runtime.rs :60-500 (Prompt::output_event_capacity, GenerationEvent, Incoming, emit) and :1700-1860 (Worker::complete, model_step, commit stamping) and :900-1000 (enqueue_many), metrics.rs :120-400 and :810-845 and :1140-1240 (Buckets/Histogram, host histograms, render), config.rs :150-420 and :719-740, server.rs :124-180 and :620-720, latency.rs (whole), observation.rs (whole), flare-cli/src/cli.rs :470-760 and the new test, flare-cli/src/main.rs :340-360, scheduler.rs + scheduler/tests.rs diff, docs/api.md, docs/cli-design.md, helios/model-contract.md, plus protocol/decisions/mod.rs :830-881 (the other GenerationEvent consumer) and flare crate greps.
Confirmed clean against precedent:
commitsis threaded as a plain bool along the existingobservation: Option<bool>pipeline (generate_observed/generate_many_observed/enqueue_many/enqueue) instead of a new builder or struct; output_event_capacity keeps the singlechecked_mul(1 + observed + commits)expression and its existing.max(minimum)/ Semaphore::MAX_PERMITS guards (runtime.rs:62-84).GenerationEvent::Committed { at_ns }follows the existing variant style (struct-likeObservedToken { token, timestamp_ns }), andIncoming::emit'spublishesclassification (runtime.rs:365-389) is untouched, so the new variant is not miscounted as a publication.Finishedgainingarrival_ns/timessits beside the existing carried-vs-live accounting; both call sites (runtime.rs:1915 stop path, :2088 terminal path) andfinish_cancelled(:307-318) were updated consistently, and the only other consumer (protocol/decisions/mod.rs:850) matches with...- The flag reaches rank zero exactly like
--api-key-file:rank_zero_options()(cli.rs:671-701) appends--enable-per-request-metrics,run_args()mirrors it, and the new CLI test re-parses rank zero's forwarded options, matching the--api-key-fileprecedent. ServerConfig::per_request_metrics+HttpStatefield +Bootstrapkey follow thethinking_token_budgetpath one-for-one (server.rs:124-180, :330-340; config.rs:346-357), and the absence of a[server]config-file key matches--bypass-performance-check/--verify-weightsas the description claims.observation.finishgaining a third tuple element is the minimal change to the existing(ingress_ns, enqueue_ns)tuple; no parallel mechanism added.- Prose: docs/api.md's "Per-request metrics" section replaces stale claims rather than narrating history; the two deleted lines about "the only histograms" were made false by the stacked change and are correctly replaced (docs/api.md:287-300 region).
Not verified by execution: no GPU, no exported core, no live server, no Windows build. CI on the head commit reports no checks. All four findings above are read from the code only; the drift argument for finding 1 and the divergence risk for finding 2 would be settled by a compile-time/test check only if someone adds a GraphKind or calls set_logprobs/enable_request_metrics asymmetrically — no test currently pins either pairing.
#8 [high] Stale: findings 1 and 2 fixed at head 046aaef
At head 046aaef (7 commits after the reviewed ce44060):
- Finding 1 (/tmp scratchpad #1, inline GraphKind list) is fixed: helios/src/server/runtime.rs:1727 now reads
if kind.samples() { self.metrics.model_step(...) }. - Finding 2 (dup
Timing.streaming) is fixed:Timing(helios/src/server/protocol/encode.rs:75-79) now holds only arrival_ns/times/generated;record_commitis gone;enable_request_metrics(streaming)(encode.rs:233-241) uses its argument once andEncoder.streaming(encode.rs:91) is untouched.
So the previous verdict must be recomputed against the new head. New review surface in the last 7 commits: flare-cli/src/config.rs:73-75 ([server] per_request_metrics -> flag), flare/src/{configuration,settings,controller}.rs, flare-cli/src/main.rs:355-357, plus the reworked encode.rs metrics state, http.rs:411-412/538/609, and the phase_tests.rs harness (StepBounds/timed_pass/served_through_worker, +535 lines).
#11 [high] Report of 2026-11-28, run 2 (head 046aaef): no blockers, no should-fix, 4 nits
Review of PR #560 — conventions and duplication lens (head 046aaef)
PR #560 "Emit vLLM-compatible per-request metrics from runtime instants", open, head 046aaef, base main, 22 files, +1757/−77. This supersedes entries #1-#7, which were written against ce44060.
Verdict
Blocking: none. Should fix: none. Nits: 4 (two of them in this PR's own new test harness).
Both should-fix findings from the previous head are now fixed in 046aaef:
runtime.rs:1727now callsself.metrics.model_step(...)underif kind.samples()instead of re-spelling the seven graph kinds (entry #1 closed).Timing(protocol/encode.rs:75-79) no longer carriesstreaming;record_commitis gone, andenable_request_metrics(streaming)(encode.rs:233-241) uses its argument once, leavingEncoder.streaming(encode.rs:91, set byset_logprobs:184-187) as the single answer (entry #2 closed).
Nits
helios/src/server/runtime/phase_tests.rs:4541-4543— the newtimed_passcopies the "does this step commit a generated token" expression that already exists at:452-454(budget_pass) and:5028-5030; three copies now. The authoritative semantics are in the scheduler (helios/src/model/tests.rs:1705,helios/src/scheduler/lifecycle_tests.rs:49). Extract one helper besidecompletion(:372) and call it from all three. See entry #9.helios/src/server/runtime/phase_tests.rs:4563-4610—served_through_workerre-implements the state/ingress/request/group scaffolding ofhttp_generation_request_observed(:4488-4517); then = 2block at:4810-4850copies it a third time inline. Follow the existing thin-wrapper precedent (http_generation:4358,http_generation_request:4477). See entry #10.helios/src/server/metrics.rs:199-209— the newBuckets<N>/Histogram<N>(:211-322) migrates onlylatency.rs(FirstResponseSamples.histogramlatency.rs:36,observe:121,render_histogram:101);HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETS,host_missing_tokens/host_transfer_ns/host_prefill_ns,host_cost_sums(metrics.rs:475-478) and the bespoke render loop (:1178-1214) stay behind, so two histogram mechanisms now coexist in one module. The host time histograms are nanoseconds onu64bounds, so the conversion needsscale: 1.0-style u64 bounds rather than the decimal grid — real but out of scope unless the maintainer wants one mechanism. See entry #3.helios/src/server/config.rs:353-357— theper_request_metricsparse re-spells the three-arm boolean match atconfig.rs:183-187(history_drafts);observation.rs:78-84flag()is the third.config.rshasinteger()(:56) andoptional_text()(:303) but noboolean(). The error-string style does match the file. Addboolean(name, default)and use it for both keys. See entry #4.
Checked and conventional (no finding)
New in 046aaef (this turn's fresh work)
[server] per_request_metricsplumbing —flare/src/configuration.rs:34(Option<bool>inServer, consistent with the siblingOption<_>fields in the same struct),flare/src/settings.rs:32+:224(unwrap_or(false)at resolve time, same shape asthinking_token_budgetat:171/:222),flare/src/controller.rs:2566(config["per_request_metrics"] = self.settings.per_request_metrics.into();immediately beside thethinking_token_budgetandscheduler_checkpoint_extra_work_fractionwrites at:2562-2565— the desktop controller path named in the description),flare-cli/src/config.rs:73-75(if !run.enable_per_request_metrics { run.enable_per_request_metrics = self.server.per_request_metrics.unwrap_or(false); }— the same "flag wins, else config" shape as the two neighbours at:70-72and asserving.memory_limitat:77-80), andflare-cli/src/main.rs:355-357(an unconditional-but-guardedconfig["per_request_metrics"] = true.into()beside theconfig["thinking_token_budget"] = json!(...)write at:354).first_scheduled_nsinobservation::finish's timing tuple (observation.rs:58-74) — extends the existing(ingress_ns, enqueue_ns)tuple to three, the minimal change to an existing mechanism; no parallel struct. Callers updated athttp.rs:564(stream, per choice) and:609(body, aggregated with.min()).first_scheduled_nsaggregation inhttp.rs:412+:538(first_scheduled_ns.into_iter().chain(times.first_scheduled_ns).min()) is the file's existing.into_iter().chain(...)idiom (also atencode.rs:618), not a new helper.- The five
arrival_ns: 0, times: Default::default()test-literal updates inphase_tests.rs/response_lifecycle_tests.rsfollow the existing pattern of spelling out newGenerationEvent::Finishedfields in fixtures; the production sites (runtime.rs:305,:1894,:2073) all forwardrequest.incoming.arrival_nsandrequest.incoming.record.times, so there is no second source for either. RequestTimespromoted topub(metrics.rs:326, re-exportedserver.rs:33) is the minimum visibility change; the fields were alreadypub, and the siblingSnapshotis exported the same way.
Carried over from the ce44060 review (still clean)
commits threading along the existing observation: Option<bool> pipeline; GenerationEvent::Committed following existing variant style and emit's publishes classification; the flag reaching rank zero exactly like --api-key-file (cli.rs:671-701, test at cli.rs:1378-1401); ServerConfig::per_request_metrics + HttpState field following thinking_token_budget (server.rs:124-180,330-340); docs replacing stale claims rather than narrating history.
Not verified by execution
No GPU, exported core, live server, llama-swap, Windows build, or cargo test run. CI on head 046aaef reports no checks. All findings read from code. The drift arguments for nits 1-2 would be settled by a test that pins the predicate once; nit 3's conversion cost is unmeasured.
#12 [high] Research summary
Reviewed PR #560 at head 046aaef through the conventions-and-duplication lens. Both should-fix findings from the earlier head are fixed in the new commits: runtime.rs:1727 now gates metrics.model_step on kind.samples() instead of a seven-arm matches!, and Timing no longer carries a duplicate streaming flag (record_commit is gone; Encoder.streaming is the single answer). I verified the fresh [server] per_request_metrics plumbing across flare/src/{configuration,settings,controller}.rs, flare-cli/src/config.rs:73-75 and main.rs:355-357 against the thinking_token_budget / scheduler_checkpoint_extra_work_fraction precedents, and the first_scheduled_ns tuple extension in observation.rs (not opened) against its two call sites — all conventional.
Two nits remain from before (metrics.rs new Histogram/Buckets leaves the host-cache histograms on the old bespoke code; config.rs:353-357 re-spells the history_drafts boolean parse with no boolean() helper), and this turn found two new test-only duplications introduced by the PR's own harness: timed_pass adds a third copy of the "this step commits a token" expression (phase_tests.rs:4541-4543 vs :452-454 and :5028-5030), and served_through_worker (:4563-4610) plus the n = 2 block (:4810-4850) re-implement http_generation_request_observed's setup rather than wrapping it. No blockers and nothing should-fix; all findings are read from code, with no GPU, live server, Windows build or test run and no CI checks on the head commit.
#13 [high] Entry status map for the report writer (head 046aaef)
Use entry #11 as the report. Status of the other entries so nothing stale is quoted:
- #1 (Should fix: inline GraphKind list) — FIXED at head 046aaef,
runtime.rs:1727nowif kind.samples(). Do not report as a finding. - #2 (Should fix:
Timing.streamingduplicatesEncoder.streaming) — FIXED at head 046aaef,Timingis{arrival_ns, times, generated}(protocol/encode.rs:75-79),record_commitdeleted. Do not report as a finding. - #3 (Nit: new
Histogram/Bucketsleaves the host-cache histograms behind) — still valid, carried into #11 nit 3. Citations:metrics.rs:199-209,:211-322,:475-478,:1178-1214;latency.rs:36,101,121. - #4 (Nit:
per_request_metricsparse duplicateshistory_drafts) — still valid, carried into #11 nit 4. Citations:config.rs:353-357vs:183-187;observation.rs:78-84; helpersconfig.rs:56,:303. - #5, #6, #7 — superseded coverage/summary of the old head ce44060. #6's "absence of a
[server]config-file key matches--bypass-performance-check" is now obsolete: 046aaef adds[server] per_request_metricson thethinking_token_budgetpath. #7 is the previous report. - #8 — confirms #1/#2 are fixed; lists the new review surface in the last 7 commits.
- #9 — new nit (head 046aaef):
phase_tests.rs:4541-4543third copy of the step-generates predicate. - #10 — new nit (head 046aaef):
served_through_worker(:4563-4610) and then = 2block (:4810-4850) duplicatehttp_generation_request_observed(:4488-4517).
Counts for the report: blocking 0, should fix 0, nits 4. Rules cited: docs/design-review.md:31 (principle 3, shared mechanisms), AGENTS.md:348, charter line 12. Not verified by execution: no GPU, no live server, no cargo test, no Windows build, no CI checks on 046aaef.
#15 [high] Blocking: [server] per_request_metrics is missing from Ignition's config schema, so every Ignition command rejects it
New finding at head 046aaef. Severity: blocking.
What. This PR documents and reads a new [server] per_request_metrics configuration key, but registers it only on the Rust side. The Python reader that Ignition uses never learns the key:
ignition/cli/config.py:21-33_SECTIONS["server"]listshost,port,api_key,thinking_token_budget,scheduler_checkpoint_extra_work_fraction— noper_request_metrics.ignition/cli/config.py:37-53_BUILT_INhas noserver.per_request_metricsentry (:38-40cover the other server keys).ignition/cli/config.py:112-114_validateraisesUsageError(f"{path}: unknown key {key} in [{section}]")for any key outside the schema, andConfiguration.load(:79-106) runs that validation for every load.Configuration.load(args.config)is called on every Ignition path:ignition/cli/serve.py:127(export),:174(_export_hosts),:264(_prepare),:431(debug_serve),:590(join), plusignition/cli/publishing.py:31,73,174,194andignition/cli/bench.py:144.ignition/cli/config.py:183-213write_initialis the template "written on first export with the resolved values present as comments" (docs/cli-design.md:1311-1312); it emits the other four[server]keys (:189-192) and noper_request_metricsline.
Why it matters. A user who follows this PR's own documentation — docs/cli-design.md:1349 (# per_request_metrics = false in the sample config.toml) or docs/api.md:1007 — and uncomments the key gets a hard failure from every Ignition command, including ignition export, the documented preparation path. The repository states both halves of the rule the PR breaks: docs/cli-design.md:1313 "Ignition and native Flare read this file", and :1385 "Ignition rejects any section or key outside its schema. Native Flare ignores keys it does not use". Every other [server] key is present in all four places (schema, built-in, template, and the Rust Server struct at flare/src/configuration.rs:26-35); this one is in only the last. flare/src/configuration.rs:26-35 has no deny_unknown_fields, so the Rust reader silently tolerates the key while the Python one rejects it — a divergence in a file both are documented to read.
Fix. Add "per_request_metrics": bool to _SECTIONS["server"] (ignition/cli/config.py:23-24), "server.per_request_metrics": False to _BUILT_IN (:39-40), a commented # per_request_metrics = false line to write_initial (:192), and the forwarding line beside options["thinking_token_budget"] in ignition/cli/serve.py:486 if debug-serve is meant to honour it. Add the key to the invalid-file matrix in tests/cli/test_config.py:151-177 (or a positive load test) so the next key cannot repeat the omission.
Lens note. This is a conventions finding: the closest precedent is scheduler_checkpoint_extra_work_fraction, which the same author's own neighbouring commits registered in ignition/cli/config.py (schema :24, built-in :40, validator :119), ignition/cli/serve.py:487, and docs/cli-design.md:1348; thinking_token_budget likewise spans schema :23, built-in :39, validator :138, serve.py:486, and template :192. The new key copies the Rust half of that chain (flare/src/configuration.rs:34, flare/src/settings.rs:224, flare/src/controller.rs:2566, flare-cli/src/config.rs:73-75, flare-cli/src/main.rs:355-357, helios/src/server/config.rs:353-357) and drops the Python half.
Verified from the code above. Would be settled by running ignition export (or tests/cli/test_config.py) with a config file containing [server]\nper_request_metrics = true; no test in tests/cli/ mentions the key.
#16 [high] Report of 2026-11-28, run 3 (head 046aaef): 1 blocker, no should-fix, 4 nits
Review of PR #560 — conventions and duplication lens (head 046aaef)
PR #560 "Emit vLLM-compatible per-request metrics from runtime instants", open, head 046aaef, base main, 22 files, +1757/−77. Supersedes entries #11 and #14 (same head, but a new blocking finding below).
Verdict
Blocking: 1. Should fix: 0. Nits: 4.
Blocking
B1 — [server] per_request_metrics is absent from Ignition's configuration schema, so every Ignition command rejects it.
ignition/cli/config.py:21-33 (_SECTIONS["server"] omits the key), :37-53 (_BUILT_IN omits server.per_request_metrics), :112-114 (_validate → unknown key {key} in [{section}]), :183-213 (write_initial emits the other four server keys at :189-192, not this one). That validation runs on every Ignition path: ignition/cli/serve.py:127,174,264,431,590, ignition/cli/publishing.py:31,73,174,194, ignition/cli/bench.py:144.
Why it matters: the PR documents the key in the shared file — docs/api.md:1007 ("[server] per_request_metrics = true in the host configuration"), docs/cli-design.md:1349 (the sample config.toml) — while docs/cli-design.md:1313 says "Ignition and native Flare read this file" and :1385 says "Ignition rejects any section or key outside its schema. Native Flare ignores keys it does not use". A user who uncomments the documented key breaks ignition export, the documented preparation path. Every other [server] key exists in all four places (thinking_token_budget: schema :23, built-in :39, validator :138, template :192; scheduler_checkpoint_extra_work_fraction: :24, :40, :119, and serve.py:487), and the Rust reader flare/src/configuration.rs:26-35 has no deny_unknown_fields, so the two readers now disagree about one file.
Fix: add "per_request_metrics": bool to _SECTIONS["server"], "server.per_request_metrics": False to _BUILT_IN, a commented line in write_initial, and the options["per_request_metrics"] = ... forwarding beside ignition/cli/serve.py:486-487 if debug-serve is meant to honour it; cover it in tests/cli/test_config.py:151-177.
Precedent/lens: the previous head ce44060 deliberately had no config key, mirroring --bypass-performance-check/--verify-weights. Commit f0ccabcc added the key on the Rust chain only (flare/src/configuration.rs:34, flare/src/settings.rs:224, flare/src/controller.rs:2566, flare-cli/src/config.rs:73-75, flare-cli/src/main.rs:355-357, helios/src/server/config.rs:353-357), leaving the Python half of the same setting's precedent out.
Nits (unchanged from entry #11)
helios/src/server/runtime/phase_tests.rs:4541-4543— third copy of the "step commits a generated token" expression (:452-454,:5028-5030); extract a helper besidecompletion(:372).helios/src/server/runtime/phase_tests.rs:4563-4610—served_through_workerre-implementshttp_generation_request_observed(:4488-4517) instead of wrapping it, and then=2block at:4795-4849copies it again; the file's precedent is the thin wrapper (http_generation:4358,http_generation_request:4477).helios/src/server/metrics.rs:211-322— newBuckets<N>/Histogram<N>migrates onlylatency.rs(:36,101,121); the host-cache histograms keep the old mechanism (HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETS:199-209,host_cost_sums:475,host_lookup_cost:819-841, bespoke render at:1198-1214), so two histogram implementations coexist in one module.helios/src/server/config.rs:353-357— re-spells the three-arm boolean match at:183-187(history_drafts);observation.rs:78-84(flag) is the third.config.rshasinteger()(:56) andoptional_text()(:303) but noboolean().
Checked and conventional (no finding)
[server] per_request_metricson the Rust side followsthinking_token_budgetone-for-one:flare/src/configuration.rs:34,flare/src/settings.rs:32+:224,flare/src/controller.rs:2566(beside:2562-2565),flare-cli/src/config.rs:73-75(flag-wins shape of:70-72),flare-cli/src/main.rs:355-357,helios/src/server/config.rs:353-357, docsdocs/cli-design.md:736,1318,1349,docs/api.md:1007.- CLI flag reaches rank zero like
--api-key-file(flare-cli/src/cli.rs:671-701, test:1379-1401). first_scheduled_nsextends the existing(ingress, enqueue)tuple (helios/src/server/observation.rs:56-75) rather than adding a struct; aggregation uses the file's.into_iter().chain(...).min()idiom (http.rs:412,:538).RequestTimes/RequestRecordsit beside the existingSnapshotexport path;metrics.rs:142-149reusesscale-based observation rather than a new atomic per metric.GenerationEvent::Finishedgained fields beside existing ones (runtime.rs:99-108), and both emit sites plusfinish_cancelled(:302-308) forward the samerequest.incomingvalues; no second source.- Encoder-side:
RequestMetrics/Timing(protocol/encode.rs:67-79) is new but minimal, and the earlier duplicateTiming.streamingis gone;enable_request_metricsreadsself.streaming-equivalent data (include_usage,protocol,prompts.len(),choices_per_prompt) thatEncoder::newalready owns. - Prose:
docs/api.md:287-300replaces the now-false "the only histograms" claim rather than stacking a correction;helios/model-contract.md:343-358extends the existingperformanceparagraph.
Not verified by execution
No GPU, exported core, live server, llama-swap, Windows build, cargo test, or pytest run; CI on 046aaef reports no checks. B1 is read from the code and its own docs; pytest tests/cli/test_config.py with a per_request_metrics key would demonstrate it directly, and no test in tests/cli/ mentions the key.
#17 [high] Entry status map for the report writer (head 046aaef, run 3)
Use entry #16 as the report for the current head 046aaef; entry #15 holds the new blocking finding in full detail.
- #14 (previous report, same head) — superseded: it said "clean" because it missed the Ignition config-schema gap now recorded as B1 in #15/#16. Do not quote its verdict.
- #11 (report, same head) — superseded by #16; its 4 nits are carried forward verbatim into #16 with the same citations.
- #13 (status map) — still accurate for the nit citations (#3, #4) and for the two FIXED findings (#1, #2 at old head ce44060; do not report).
- #1/#2 — fixed at 046aaef:
runtime.rs:1727useskind.samples();Timingno longer holdsstreaming. Do not report. - #9/#10 — the two phase_tests nits, folded into #16 nits 1-2.
Counts: blocking 1, should fix 0, nits 4. Rules cited: docs/cli-design.md:1313,1385 (one file, two readers; Ignition rejects unknown keys), docs/api.md:1007 and docs/cli-design.md:1349 (the docs that name the key), docs/design-review.md:31 (principle 3), AGENTS.md:346-351, charter line 12.
#18 [high] Research summary
Reviewed PR #560 at head 046aaef through the conventions-and-duplication lens (all 22 changed files read in context, compared against each construct's closest precedent in the repository). The two should-fix findings from the earlier head ce44060 are fixed and are not reported.
Verdict: 1 blocking, 0 should fix, 4 nits.
Blocking: the new documented [server] per_request_metrics key exists only in the Rust reader, not in Ignition's Python configuration schema, so every Ignition command rejects it — ignition/cli/config.py:21-33 _SECTIONS["server"], :37-53 _BUILT_IN, :112-114 _validate ("unknown key … in [server]"), :183-213 write_initial, and Configuration.load runs that validation at ignition/cli/serve.py:127,174,264,431,590, ignition/cli/publishing.py:31 (not opened),73,174,194, ignition/cli/bench.py:144 (not opened). The PR documents the key in the shared file (docs/api.md:1007, docs/cli-design.md:1349) while docs/cli-design.md:1313 says Ignition and native Flare both read it and :1385 says Ignition rejects unknown keys; the neighbouring thinking_token_budget and scheduler_checkpoint_extra_work_fraction are present in all four places, and this one copies only the Rust half of the chain. A user who uncomments the documented key breaks ignition export.
Nits: (1) helios/src/server/runtime/phase_tests.rs:4541-4543 is a third copy of the "step commits a generated token" expression (:452-454, :5028-5030); (2) phase_tests.rs:4563-4610 (served_through_worker) and the n=2 block at :4795-4849 re-implement http_generation_request_observed (:4488-4517) instead of wrapping it as http_generation (:4358) does; (3) helios/src/server/metrics.rs:211-322 adds Buckets<N>/Histogram<N> but migrates only latency.rs, leaving the three host-cache histograms on the old mechanism (:199-209, :475, :819-841, render :1198-1214); (4) helios/src/server/config.rs:353-357 re-spells the three-arm boolean parse at :183-187, with observation.rs:78-84 a third instance and no boolean() helper beside integer() (:56).
Everything else checked out against precedent: the Rust-side per_request_metrics plumbing follows thinking_token_budget one-for-one, the CLI flag reaches rank zero like --api-key-file, first_scheduled_ns extends the existing timing tuple, Finished/Committed follow existing variant style with one source of values, and the docs replace stale claims rather than narrating history. No GPU, live server, llama-swap, cargo test or pytest run was possible; CI on the head commit reports no checks, so every finding is read from the code. Scratchpad entries #15 (blocking finding), #16 (the report) and #17 (entry status map) hold the detail.
#19 [high] Confirmation: no per_request_metrics anywhere under ignition/
Final verification for B1 (entry #15) at head 046aaef:
search_code "per_request_metrics"over the whole tree returns hits only indocs/api.md:1007,docs/cli-design.md:736,1318,1349,flare-cli/src/{cli,config,main}.rs,flare/src/{configuration,controller,settings}.rs, andhelios/src/{server.rs,server/config.rs,server/http.rs,server/protocol/tests.rs,server/runtime/phase_tests.rs}.- A scoped search of
ignition/for the same word returns no matches, andtests/cli/contains no reference either — so no Ignition schema entry, no_BUILT_INdefault, nowrite_initialtemplate line, noserve.pyforwarding, and no Python test pins it. - Re-read
ignition/cli/config.py:79-114to confirm the mechanism:Configuration.loaditerates every section, calls_validatefor sections in_SECTIONS, and_validateraisesUsageError(f"{path}: unknown key {key} in [{section}]")at:113-114for any key missing from the schema.[server]is in_SECTIONS(:21-24), so the failure is the key-level rejection, not an unknown-section rejection.
This is the decisive evidence for the blocking severity: the key the PR's own docs tell users to write (docs/api.md:1007, docs/cli-design.md:1349) is rejected by every command that loads the shared configuration file, including ignition export (ignition/cli/serve.py:127).
Report-ready conclusion unchanged: 1 blocking, 0 should fix, 4 nits, per entry #16.
#2 [medium] Should fix: Timing.streaming duplicates Encoder.streaming
helios/src/server/protocol/encode.rs: Encoder already carries streaming: bool (declared line 97, set only by set_logprobs line 192 from the same decoded.stream). The new per-request-metrics state adds Timing.streaming (line 80), set from the separate argument of enable_request_metrics(streaming) (lines 244-252), and then read by record_commit (line 257) and metrics_value's doc/behaviour (lines 268-294).
Two booleans in one struct answer "is this a stream". In http.rs both are fed decoded.stream (line 352 encoder.set_logprobs(..., decoded.stream) and line 363 encoder.enable_request_metrics(decoded.stream)), so today they agree, but nothing enforces it: set_logprobs is public and called by tests directly (helios/src/server/protocol/tests.rs), so a future caller can set one without the other and record_commit will silently drop or keep commit instants against the wrong mode.
Fix: drop Timing.streaming and read self.streaming in record_commit/metrics_value, taking only include_usage/protocol/choices into enable_request_metrics (or have that function take no streaming argument at all).
#3 [medium] Nit: new Histogram/Buckets leaves the host-cache histograms on the old bespoke code
Two histogram implementations now coexist in helios/src/server/metrics.rs at head ce44060.
Pre-existing (still present, lines 199-209, 475-477, 819-841, 1178-1214): HOST_TIME_BUCKETS/HOST_TOKEN_BUCKETS ([u64; 8]), the host_missing_tokens/host_transfer_ns/host_prefill_ns arrays, host_cost_sums: [AtomicU64; 3], Metrics::host_lookup_cost doing .position(|limit| value <= *limit).unwrap(), and a bespoke 37-line render loop emitting _bucket/_count/_sum.
New in this PR (lines 211-322): Buckets<const N> + Histogram<const N> with observe, absorb, render. latency.rs was converted to use it (FirstResponseSamples field at latency.rs:36, observe at :121, render_histogram at :101).
So the PR adds the general mechanism and migrates one of the three existing hand-rolled histograms, leaving the host-cache trio on the old one. The earlier autobot review of the stacked PR #548 made exactly this point as a subtractive suggestion ("Convert the three host-cache histograms to Histogram<8>/Buckets<8> ... ~40 lines"). Not filed as a blocker: the host histograms' exposed unit is nanoseconds/tokens, not the scale grid Buckets assumes, so the conversion is scale: 1.0 plus u64 bounds for the time histograms — worth doing in this PR only if the maintainer wants one mechanism; otherwise the duplication is real and should be noted.
Cite: metrics.rs:199-209 vs :211-322; metrics.rs:819-841 vs :271-321; latency.rs:34-37.
#9 [medium] Nit: timed_pass copies the step-generates predicate now in three places
At head 046aaef the expression deciding whether a step commits a generated token appears three times in helios/src/server/runtime/phase_tests.rs:
let generates = matches!(step.kind, GraphKind::Decode | GraphKind::Resume)
|| (step.kind == GraphKind::Prefill
&& lane.start_position + lane.tokens as u64 == live.prompt_tokens as u64);
:452-454inbudget_pass(pre-existing):4541-4543in the newtimed_pass(added by this PR):5028-5030in the tool-limit cancellation test (pre-existing)
This PR copies the pre-existing shape into a second harness function instead of extracting the predicate. The real semantics live in the scheduler (helios/src/model/tests.rs:1705 let emits = plan.kind.is_prefill() || plan.kind == GraphKind::Resume;, helios/src/scheduler/lifecycle_tests.rs:49), so a test-side helper fn commits(step: &ScheduledStep, lane: &ScheduledLane, live: &LiveRequest) -> bool (or reuse of the existing completion() in the same file, which already derives generated_tokens from sampled.is_some()) would keep the three harness loops consistent when the sampling graph set changes. Severity: nit (test-only duplication, but it is the third copy and the new copy is this PR's).
Fix: extract one helper beside completion (phase_tests.rs:372) and call it from budget_pass, timed_pass and the cancellation test.
#10 [medium] Nit: served_through_worker duplicates http_generation_request_observed setup
helios/src/server/runtime/phase_tests.rs:4563-4610 (served_through_worker, new) repeats the HTTP-drive scaffolding of http_generation_request_observed (:4488-4517, pre-existing):
both create mpsc::sync_channel, http_state_for(...), acquire state.ingress_slots.clone().acquire_owned(), build axum::http::Request with content-type: application/json, tokio::spawn(http::generate(State(state), Extension(ingress), request)), then tokio::task::spawn_blocking(move || receiver.recv_timeout(5s)).
Differences are only the return values (an Arc<HttpState> plus the group and the raw response future, versus the axum Response handle) and the per_request_metrics mutation via Arc::get_mut. http_generation (:4358) and http_generation_request (:4477) are already thin wrappers over the same path, which is the precedent for extending it rather than writing a second driver.
Same duplication in the n = 2 case in per_request_metrics_are_absent_without_the_option_and_null_for_several_choices (:4810-4850), which re-spells the whole 40-line setup inline rather than calling either helper.
Fix (nit): have served_through_worker call http_generation_request_observed for the state/ingress/request/group part and add the two differences (metrics flag, raw response future) as parameters, or return the response future from one shared helper. Test-only; no production behaviour involved.
#4 [low] Nit: per_request_metrics parse duplicates the history_drafts boolean arm
helios/src/server/config.rs:353-357 parses the new key as
per_request_metrics: match object.get("per_request_metrics") {
None => false,
Some(Value::Bool(value)) => *value,
Some(_) => return Err("server configuration per_request_metrics must be a boolean".into()),
},
The nearest precedent for a boolean server key is history_drafts a few hundred lines above, config.rs:183-187:
history_drafts: match object.get("history_drafts") {
None => false,
Some(Value::Bool(value)) => *value,
_ => return Err("history_drafts must be a boolean".into()),
},
and observation.rs:78-84 flag() is the third instance of the same three-arm match (there it also accepts null, because those are request fields). The new arm is a copy with an error string in the "server configuration must be …" form used by optional_text (config.rs:303-307) and the integer helper — i.e. the error style matches the file, but the parse shape is duplicated rather than shared. Also note config.rs has an integer(name, default) helper but no boolean(name, default) helper; two boolean keys now exist and the third will copy again.
Suggestion (nit, not blocking): add fn boolean(name, default) beside integer and use it for both history_drafts and per_request_metrics. Severity: nit.