Opened by a workflow run, Nov 30, 2026 4:53 AM EST. decide malicious: all_clear (100%): No malicious content found
explore
Author: salignatmoandal (CONTRIBUTOR; 3 merged ops/docs PRs #601/#602/#603, first work in scripts/; Discord: none provided) Motivation: The scheduler benchmark issues traffic continuously, so it cannot show how streaming behaves when the first request arrives after a server has been idle. #540 made idle-surviving timing credit possible but deferred live qualification to docs/TODO.txt:110-114, and this PR adds the opt-in driver pause needed to replay that case. Scale: +21 / −4 lines in 1 file (scripts/benchmark_scheduler.py) Proposal:
- Adds a keyword-only
requests_per_lanetotrial()so each worker loop is bounded by completed requests instead of a deadline (:140, :147-148). - Adds
--idle-secondsand--requests-per-laneCLI flags with finite/positive validation (:187-190, :198-201). - In idle mode, sleeps once per trial after the previous trial's streams join and metrics scrape, then runs a count-bounded burst (:217-231).
- Records
idle_seconds_before_burstin each JSONL trial row asmin(row['started']) − pause_started(:227-228). - Continuous deadline mode remains the default (:220-221); no new imports or dependencies. Touches:
- scripts/benchmark_scheduler.py (the whole change)
- Indirectly the measurement story for #540's Helios timing-refresh/acceptance credit (helios/src/scheduler)
- Documentation gap: docs/TODO.txt:110-114 is the intended consumer but is neither cited nor closed Related items:
- #540 Retain bounded timing-refresh and acceptance credit across idle (merged): the PR this exists to qualify; its own limitations defer live GPU/HTTP idle-resume measurement to docs/TODO.txt
- #280 (merged): explicitly says its runs do not establish first-request-after-idle latency — precedent for hand-rolled idle probes
- #353 (closed): measured TTFT after 150 s idle by hand; closed for lack of measured benefit
- #548 / #560 (open): server-side per-request metrics, same measurement theme, different layer and files
- #601, #602, #603 (merged): author's prior small, accurately-scoped PRs, each with an autobot intake comment #634 did not get
Link: https://github.com/NVIDIA/hyperflare-inference/pull/634
Autobot comments: The new field is not a first-token latency:
row['started']is stamped before the POST (:27), soidle_seconds_before_burstmeasures sleep + client connect and will read ≈--idle-secondsagainst a local server — a self-check, not a server measurement; the real idle-latency number is the pre-existingttft_median_seconds(:169). Idle-mode rows also keep the keyissue_duration_secondsbut with valuenull, andtokens_per_secondbecomes burst throughput rather than the sustained rate, so the same JSONL keys mean different things across modes — undeclared. The pause starts after the previous trial's metrics scrape, so effective server idle exceeds the flag. Nothing measures the behavior the PR exists to observe (no GPU serving, no example JSONL, no comparison of two builds), and the description does not name #540's TODO entry or close it, so a future reader of docs/TODO.txt:110-114 will not find this tool. The file is Luke Alonso's alone (all 3 commits, 57 scripts/ commits in 180 days); no other PR in 180 days touches it and nothing in CI, docs or tests references the script, so the blast radius is a manual operator tool. Untriaged: no labels, no CI checks, no flare-autobot case file, zero comments; the commit's Signed-off-by could not be verified.
Classify intake
Selected: triage:review, enhancement
Threshold: 65%
Triage
- [✓]
triage:review: 98.7% -
triage:validation: 1.0% -
triage:design-review: 0.2% -
none: 0.0% -
triage:investigate: 0.0% -
triage:integration: 0.0% -
triage:partial: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
-
none: 100.0% -
priority:P1: 0.0% -
priority:P2: 0.0%
Type
- [✓]
enhancement: 83.5% -
community: 34.9% -
duplicate: 8.5% -
performance: 1.6% -
documentation: 0.1% -
bug: 0.1%
Area
-
area:scheduling: 59.3% -
area:api: 16.5% -
area:preparation: 4.7% -
area:selene: 0.3% -
area:engram: 0.1% -
area:caching: 0.1% -
area:orbit: 0.0% -
area:rocenante: 0.0% -
area:kernels: 0.0% -
area:memory: 0.0% -
area:packaging: 0.0%
Model
-
model:deepseek-v4: 0.3% -
model:deepseek-v4.1: 0.2% -
model:inkling-small: 0.2% -
model:qwen3.8-flash-next: 0.2% -
model:kimi-k3.1: 0.1% -
model:glm-5.3: 0.1% -
model:gemma4: 0.1% -
model:nemotron-3.5-bolt: 0.1% -
model:muse-glimmer: 0.0% -
model:qwen3.8-27b: 0.0% -
model:mimo-v2.6: 0.0%
Apply Labels (Intake)
Applied: +triage:review, +enhancement
Value Proposition
Value Proposition: PR #634 "Measure streaming latency after scheduler idle periods"
Charter alignment — real but thin. #634's only charter hook is "address a maintainer request": #540 (merged 59adc480) left core-Flare's open item docs/TODO.txt:110-114 asking to qualify idle/resume in live Helios, and a client-side idle probe is the natural counterpart to #540's simulator work (which models idle as an in-run arrival gap in scripts/scheduling_sim/). But #634 never cites that item, does not close it, and no issue, roadmap item, bug, or docs change backs it. It adds two opt-in switches to scripts/, brushing against "Stay focused" and "Be explicit and pin everything" (requests_per_lane or 1, :226; duration or 0, :156). Placement is contestable: AGENTS.md:9-13 and commit 17bb3c4a put qualification drivers in hyperflare-recipes — though tests/server/test_scheduler.py is an in-repo precedent for scheduler SSE-gap measurement, and the TODO lives in core Flare.
Novelty & status — genuinely additive. Nothing on main since the base 0a8c20f, and no other open or merged PR in 180 days, touches scripts/benchmark_scheduler.py. tests/server/test_scheduler.py has no idle-resume case. Not superseded, not obsolete.
Value vs cost — small cost, weakly supported benefit. +21/−4, stdlib only (math already imported), continuous path behaviour-identical, zero runtime/scheduler effect. Maintenance cost is genuinely low. But the headline benefit is not what the code measures: post-pause first-token latency is only available via the pre-existing ttft_median_seconds (:169), which the description never names, while the new idle_seconds_before_burst (:227-228) is computed against a started timestamp taken before the POST (:27) — a pause self-check, not a wakeup latency. Burst rows also silently redefine issue_duration_seconds (now null, :164) and tokens_per_second (:165) under unchanged keys. Evidence is a prose-described stub SSE server; nothing ran against flare run, and the flags are undiscoverable from docs/, which never mentions the script (docs/core-design.md:1818-1838 has no idle-resume row). This area has precedent for demanding measured benefit (#353 closed for lack of it).
Verdict: Worth it with changes. Keep the tool — small, additive, correctly client-side for the docs/TODO.txt:110-114 item — but require: (1) cite that TODO and add a discoverable docs note/row; (2) report post-pause TTFT via ttft_median_seconds, rename/scope idle_seconds_before_burst as a pause-verification check, and use distinct keys for burst-mode fields; (3) remove the or 1 / or 0 implicit defaults; (4) attach one real JSONL sample against an exported core through flare run (AGENTS.md:497-499); (5) confirm a Signed-off-by trailer (CONTRIBUTING.md:19) and obtain triage labels plus CI on the head commit.
Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Subtraction and simplicity
Subtraction review of #634 (+21/−4, scripts/benchmark_scheduler.py). The diff is already lean — no new import, function, wrapper or dead code, and the continuous default path is untouched — so this is one high-value subtraction plus one low-value one, not a rewrite.
- (High) Delete
--requests-per-lane(:189-190) and collapse the tri-state loop. It is unexercised (evidence ran 1 per lane), its extra repeats are flattened into onerowslist (:158) sottft_median_seconds(:169) stops isolating the post-idle first token, and it forces both magic defaults:start + (duration or 0)(:156) andargs.requests_per_lane or 1(:226) — against the charter's "No magic defaults" and AGENTS.md:188-193. Its help text says "(default: 1)" while argparse default is None, so the JSONLconfigurationline (:214) logsnullfor a burst of 1. Replace withrequests_per_lane=math.inf, one conditionwhile len(results) < requests_per_lane and time.perf_counter() < deadline[0],deadline[0] = start + duration, andtrial(..., 0.0, requests_per_lane=1); drop the arg and its validation branch (:200-201). Net −1 flag, −1 branch, −1 ternary, −2 implicit defaults. - (Low)
idle_seconds_before_burst(:223-228) is redundant withconfiguration.idle_secondson the same line (:214) and measures sleep + connect + thread jitter, sincestartedis stamped before the POST (:27). Drop it, or keep onlytime.perf_counter() - pause_startedaround the sleep.
Lean and correct as-is: math already imported (:11), parser.error style matches benchmark_prefill.py:23 (not opened) / benchmark_roce.py:49-65 (not opened), CLI append-only, no duplication (nothing imports the script; scheduling_sim idle gaps are a different layer). Pre-existing dead --pair-index/--variant/--pair-order (:192-194) are not this PR's debt.
Open: whether any use case needs >1 request per lane rather than more --trials; whether the new field ever differed from --idle-seconds (unreported); whether a0467e2 has a Signed-off-by trailer.
Correctness and contracts
Reviewed PR #634 (scripts/benchmark_scheduler.py, +21/−4) for correctness, contracts and system-level consequences. The client-side edits are safe — no runtime change, continuous mode behavior-identical — but the burst tool does not reach the state it exists to observe, and its new headline field measures nothing about the server.
Findings, most important first:
- Major — the burst cannot trigger a funded refresh (the PR's stated target). A refresh needs a cost stale beyond
estimate_ttl_ns = 30_000_000_000(helios/src/scheduler/policy.rs:38,cost.rs:100-101) and a differing previously-executed stale key:self.costs.stale_keys().filter(|key| *key != ordinary.cost_key())(policy.rs:1238-1240), wherestale_keysyields only observed keys (cost.rs:271-274). The PR's evidence ("at least 100 ms") is ~300× below the TTL, and a homogeneous burst only ever executes the ordinary shape. Nothing in the CLI help (:187-190) or validation (:198-201) says so. - Major —
idle_seconds_before_burstis a self-check, not latency. It ismin(row['started']) − pause_started(:227-228) wherestartedis taken before the POST (:25-29), so it can never be less than the sleep. The real post-pause number is the pre-existingttft_median_seconds(:169), unnamed in the description. - Major — no server-quiescence gate, and the window is contaminated. The pause is a bare
time.sleep(:223-224) entered only aftertrial()returns, which includes two blocking/metricsscrapes (:141,:174); the runtime parks only when nothing is outstanding (helios/src/server/runtime.rs:1236-1251), so the flag's idle gap cannot be correlated with the latency seen. - Major —
flare_scheduler_executions_total{reason="timing_refresh"}is scraped but never parsed (:174,helios/src/server/metrics.rs:931-938), so no JSONL row can distinguish a post-idle wakeup from ordinary service.
Minor: idle mode reuses JSONL keys with new meanings (issue_duration_seconds becomes null, tokens_per_second spans a burst, :164-165); --requests-per-lane N is N sequential rounds, so only round one is concurrent post-idle traffic (:147-151); the docs/TODO.txt:110-114 authorization is neither referenced nor closed; no automated check exercises the new branches.
Open questions: stub server and sample rows are not attached, so the field's accuracy is unverified; no Signed-off-by could be confirmed.
Final review
Recommendation: Changes Requested
This +21/−4 change to scripts/benchmark_scheduler.py is well-scoped, safe, and leaves the default continuous benchmark path behavior-identical with zero runtime or dependency impact. However, two concrete issues should be fixed before merge: (1) omitting --requests-per-lane with --idle-seconds writes "requests_per_lane": null into the JSONL configuration header while silently running 1 via an implicit or 1 default—and the unexercised --requests-per-lane > 1 path runs requests sequentially per lane while flattening all rounds into ttft_median_seconds/burst_gap_*, diluting the post-idle first-request latency it aims to measure; and (2) the new CLI validation and burst path have no automated test coverage in tests/ (which is all .github/workflows/python-cpu.yml (not opened) runs), leaving the locally described stub-server smoke check unverifiable in CI. Both are small fixes, and the cleanest resolution for (1) is simply deleting --requests-per-lane so each burst issues one request per lane.
Merge Risk
Level: Low
- Client-side benchmark script only (
scripts/benchmark_scheduler.py, +21/−4); zero changes to Helios Rust runtime, scheduler, caches, CUDA graphs, wire formats, or dependencies (mathwas already imported at:11). - Default continuous mode (
--idle-secondsomitted) is unchanged (scripts/benchmark_scheduler.py:220-221), and nothing intests/,docs/, or.github/workflows/imports or invokes this script. - Failure blast radius is confined to manual operator runs of
scripts/benchmark_scheduler.pywith--idle-seconds; invalid CLI values fail loudly viaparser.error(...)(:198-201).
Walkthrough
scripts/benchmark_scheduler.py:140-158: Adds keyword-onlyrequests_per_lane=Nonetotrial(); switches worker loop termination from deadline-bounded (time.perf_counter() < deadline[0]) to request-count-bounded (len(results) < requests_per_lane) when set, and guardsdeadline[0] = start + (duration or 0).scripts/benchmark_scheduler.py:187-190, 198-201: Adds opt-in--idle-secondsand--requests-per-laneCLI flags withparser.error(...)validation requiring finite positive--idle-secondsand requiring--requests-per-lane >= 1only when--idle-secondsis set.scripts/benchmark_scheduler.py:220-228: Keeps the existing continuoustrial(..., args.seconds)path as the default; when--idle-secondsis set, sleepsargs.idle_secondsbefore each measured burst, callstrial(..., None, requests_per_lane=args.requests_per_lane or 1), and recordsidle_seconds_before_burst(min(row['started']) - pause_started) on the trial row.
Pre-merge Checks
- [PASS] Security / malicious screen: Pure stdlib Python CLI change in
scripts/benchmark_scheduler.py; no new dependencies, network targets, shell execution, or untrusted input sinks. - [PASS] Charter & value fit: Small opt-in instrumentation tool aligned with the open live-Helios idle/resume qualification item in
docs/TODO.txt:110-114(following #540), though removing the unexercised--requests-per-laneswitch and implicitordefaults improves compliance with the charter's "Be explicit / No magic defaults" andAGENTS.md:188-193. - [PASS] Related / duplicate / conflict check: No other open or recent PR touches
scripts/benchmark_scheduler.py; complements #540's simulator scenarios without duplication or conflict. - [WARN] Tests & verification evidence: No automated test covers the new flags/burst mode under
.github/workflows/python-cpu.yml(not opened) (pytest tests/ -q), the local SSE stub run in Evidence is unattached, liveflare runserving was not run (honestly disclosed), and commita0467e2DCOSigned-off-by(CONTRIBUTING.md:9-20) could not be inspected from review metadata—verify before merge.
Blockers
None.
Should Fix
-
Fix recorded JSONL
configurationprovenance mismatch and implicitordefaults (best fixed by removing--requests-per-lane) —scripts/benchmark_scheduler.py:147-151, 156, 189-190, 214, 225-226- Verified behavior & impact:
--requests-per-laneadvertises(default: 1)in help text (:190) but leaves argparse's default asNone, then relies onrequests_per_lane=args.requests_per_lane or 1(:226) alongsideduration or 0(:156). Because:214serializes{**vars(args), ...}into the JSONL header before the trial loop, an idle run that omits--requests-per-lanerecords"requests_per_lane": nullin its measurement artifact while actually executing 1 request per lane (and logs"seconds": 120even though--secondsis unused in burst mode and each trial row records"issue_duration_seconds": nullat:164). In addition, when--requests-per-lane > 1, each worker lane issues requests synchronously in awhileloop (:147-151) andtrial()flattens all rounds intottft_median_seconds/ttft_p99_seconds/burst_gap_*(:158-171) with no round/ordinal marker—so rounds 2..N are non-idle back-to-back requests that dilute the post-idle first-request latency summary, and the> 1path was never exercised in Evidence. - Fix: Prefer deleting
--requests-per-lane(see## Subtract / Simplifybelow) so each idle burst always issues one request per lane with zero implicit defaults. If--requests-per-laneis intentionally kept, resolve its effective integer value before loggingconfigurationat:214, replaceduration or 0at:156withif duration is not None: deadline[0] = start + duration, emitrequests_per_laneon burst trial rows, and document in the flag help that values> 1issue sequential follow-up requests per lane whose timings are aggregated into the trial summary.
- Verified behavior & impact:
-
Add a CPU unit test exercising CLI validation and idle/continuous modes against a local SSE server —
scripts/benchmark_scheduler.py:140-158, 198-201, 220-228- Verified behavior & impact:
.github/workflows/python-cpu.yml:33(not opened) runs.venv/bin/python -m pytest tests/ -q, and nothing intests/importsscripts/benchmark_scheduler.py. The PR's Evidence section relies on a manual, unattached local SSE stub run, so neither the newparser.error(...)guards nor the burst-mode JSONL output andidle_seconds_before_burstcalculation are verified by CI or protected against regression. - Fix: Add a focused test module (e.g.,
tests/test_benchmark_scheduler.py(not opened), loading the script viaimportlib.util.spec_from_file_locationas intests/preparation/test_setup_preparation.py:15-18) with a small localhttp.serverSSE handler covering: (a) rejection of non-finite /<= 0--idle-seconds(and--requests-per-lanemisuse if retained), (b) idle-mode burst execution emittingidle_seconds_before_burst >= idle_seconds, exact per-lane request count, and accurateconfigurationmetadata, and (c) continuous-mode control output remaining deadline-bounded.
- Verified behavior & impact:
Subtract / Simplify
- Delete
--requests-per-laneand collapsetrial()to a single explicitduration is Noneburst branch —scripts/benchmark_scheduler.py:140-158, 189-190, 200-201, 225-226- Deleting
--requests-per-laneremoves an unexercised CLI switch (AGENTS.md:188-193), eliminates the sequential-round TTFT dilution footgun, fixes the"requests_per_lane": nullconfiguration provenance mismatch, and removes both implicitordefaults (duration or 0andargs.requests_per_lane or 1). Operators already control the number of post-idle samples via--trials. - Clean, bug-free replacement in
trial(url, bodies, duration):
and calldef trial(url, bodies, duration): ... def worker(lane, body): results = [] barrier.wait() while (not results if duration is None else time.perf_counter() < deadline[0]): row = request(url, body, stream=True) row['lane'] = lane results.append(row) return results with concurrent.futures.ThreadPoolExecutor(max_workers=len(bodies)) as pool: jobs = [pool.submit(worker, lane, body) for lane, body in enumerate(bodies)] start = time.perf_counter() if duration is not None: deadline[0] = start + duration barrier.wait() rows = [row for job in jobs for row in job.result()]trial(args.base_url, bodies[:concurrency], None)in the idle branch (:225). Continuous mode (duration=args.seconds) remains byte-for-byte identical in behavior, while burst mode (duration=None) runs exactly one request per lane without touchingdeadline.
- Deleting
Nits
- Note in
--idle-secondshelp text (or the PR description) that exercising Helios's stale-cost timing-refresh wakeup requires an idle pause longer thanestimate_ttl_ns(30 s,helios/src/scheduler/policy.rs:38), and referencedocs/TODO.txt:110-114in the PR's Why section so reviewers can trace the live-qualification context directly. - Confirm commit
a0467e2carries aSigned-off-bytrailer perCONTRIBUTING.md:9-20.
Dropped on verification
- Correctness Finding 1.1 (
idle_seconds_before_burstmislabeled as latency / includes DNS+connect / proposedfirst_token_after_idle_secondsfix): Dropped. The PR description accurately states the field records "the observed interval from the start of the pause to the first request, alongside the existing streaming metrics"—it never claimsidle_seconds_before_burstis first-token latency. In addition,connection(url)(scripts/benchmark_scheduler.py:19-22) constructs a lazyhttp.client.HTTPConnectionwithout connecting (TCP connect happens insideclient.request()at:29, afterstart = time.perf_counter()at:27), and the upstream proposed fixmin(row['groups'][0]['seconds'] for row in rows) - pause_startedis mathematically broken becausegroup['seconds'](:40, :56) is already relative tostart, not an absoluteperf_counter()timestamp. - Correctness Finding 2.1 ("by construction the burst cannot reach the funded-refresh episode / homogeneous run only executes one
cost::Key"): Dropped.--idle-secondsaccepts any positive float (operators can pass> 30s to exceedestimate_ttl_ns = 30_000_000_000athelios/src/scheduler/policy.rs:38; the 100 ms figure was only the author's local mock smoke test). The claim that a run only ever executes onecost::Keyis false for a real Helios server: default--concurrency 1,2,4,8,16,32(:181), multi-phase request lifecycles (prefill, mixed, full-batch and tail decode/speculative widths), and initialPlanOrigin::Discoverypopulate multiplecost::Keyentries, and #540 also retainsacceptance_learningcredit across idle (helios/src/scheduler/refresh.rs:11, 76,helios/src/scheduler/policy.rs:1275), which does not depend onstale_keys(). - Correctness Finding 2.2 ("pause window contaminated by two blocking
/metricsscrapes before sleep / must poll/metricsfor server quiescence"): Dropped. The upstream scrape ordering was misread:metrics_afterof trial k-1 (:174) runs beforepause_started(:223), whilemetrics_beforeof trial k (:141) runs aftertime.sleep(args.idle_seconds)(:224)—which is actually the right place so the burst'smetrics_after - metrics_beforedelta excludes post-previous-trial drain. Requiring Prometheus scraping/polling in the driver would add coupling contrary to the script's raw-capture design (AGENTS.md:512). - Correctness Finding 2.3 ("probe-episode counters fetched and never parsed"): Dropped.
scripts/benchmark_scheduler.py:174, 233already persists the full rawmetrics_beforeandmetrics_afterPrometheus blobs (which includeflare_scheduler_executions_total/flare_scheduler_execution_nanoseconds_totalfromhelios/src/server/metrics.rs:931-939) on every JSONL row for offline analysis; adding in-driver Prometheus parsing is unnecessary scope creep. - Correctness Finding 1.2 (part claiming
tokens_per_secondpreviously divided by--seconds): Dropped as overstated. Even in continuous mode,tokens_per_seconddivides byelapsed(time.perf_counter() - startat:159, including drain tail), not--seconds; in burst modetokens / elapsedremains well-defined burst throughput (generated_tokens / elapsed_seconds). The real schema asymmetry (issue_duration_seconds: null+requests_per_lane: nullinconfiguration) is captured in Should Fix #1. - Subtraction Suggestion 1's proposed code snippet (
while len(results) < requests_per_lane and time.perf_counter() < deadline[0]withduration=0.0): Dropped and replaced. Passingduration=0.0setsdeadline[0] = start, which is already expired by the time worker threads exitbarrier.wait(), causing 0 requests to run and crashingstatistics.median(ttfts)withStatisticsError. A correct bug-free replacement is provided under## Subtract / Simplify. - Subtraction Suggestion 2 ("drop
idle_seconds_before_burstor replacemin(row['started'])withtime.perf_counter()aftertrial()"): Dropped. Recording the actual observed pre-burst pause (min(row['started']) - pause_started) is a reasonable, cheap 2-line per-trial sanity measurement (and the upstream alternativetime.perf_counter() - pause_startedaftertrial()returns would have erroneously included the entire burst duration!). - Value Proposition requirement to attach a live GPU
flare runmeasurement and add a row todocs/core-design.md(not opened): Dropped as disproportionate scope creep for a +21/−4 CLI utility PR that makes no performance claim and honestly discloses live GPU serving was not run; a CPU unit test against a local SSE server is the right verification bar here.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 99.9% -
triage:validation: 0.0% -
triage:design-review: 0.0% -
triage:partial: 0.0% -
none: 0.0% -
triage:integration: 0.0% -
triage:investigate: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Apply labels
No label changes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.