PR #178 — "Keep the default Windows Ctrl-C termination while loading"
Author: mark-yong (CONTRIBUTOR). Head 85fb08c (single commit, 2026-11-03), base main, branch fix-113-windows-loading, based on 902c88e (2026-11-02). Size: 1 file, +8 / −6. Labels: area:api, bug, priority:P2, triage:review. State: open, "ready for review" per the packet, changes requested by yatesdr, no CI checks. Link: https://github.com/NVIDIA/hyperflare-inference/pull/178
Key findings
- The file this PR edits no longer exists on main, and the fix cannot simply be moved.
flare/src/main.rswas replaced byflare-cli/src/main.rsin fa158284 ("Add a native Windows desktop backed by the shared Flare library", Luke Alonso, 2026-11-09) — the only commit on main touching that path since the branch was cut (list_files/read_fileatmain; yatesdr's review, 2026-11-18). The PR never rebased. - A mechanical port would compile and fix nothing. On main,
serve()early-returns for single-host runs:if cluster.is_none() { return serve_local(owner, config, progress); }(flare-cli/src/main.rs:602-604). The PR inserts intoserve(); the Windows single-host path isserve_local, where the handler must go immediately beforeloaded.start()(flare-cli/src/main.rs:702, next to the Unix handlers at705-709). This is more than the "make the change there" the reviewer asked for, and the description does not mention the split at all. - The defect is real on main, independently of the port. The
SetConsoleCtrlHandler(Some(stop_console), 1)block still sits inrun()atflare-cli/src/main.rs:187-192, after the Windows multi-host rejection (178-186) and beforebind_address/download/load. - The diagnosis is verifiable at the PR head.
stop_consolereturns 1 ("handled") forCTRL_C_EVENT|CTRL_BREAK_EVENT, suppressing default termination; everySTOPreader other than the serving loop is Unix-only (distribution.rs:193/:192on main,launch.rs:176), and Unix installs its own handlers only afterServer::start. So on Windows nothing observedSTOPbetween registration and the serving loop. - The invoked issue was closed as resolved on Linux, and nobody has reported the Windows symptom. #113 "Loader ignores Control C to cancel loading" (officiallymarky, 2026-10-27) was closed by the reporter on 2026-11-02 with "No Linux but it is no longer an issue with recent builds", after mark-yong asked "@officiallymarky are you running on windows?". The PR opened the next day "Refs: #113". Searches for any other Ctrl-C/cancel-loading report returned only this PR.
- No evidence beyond code review. Description: "code review only. No Windows toolchain or GPU was available, so this was neither compiled for nor run on Windows." The claim that Ctrl-C during loading now exits at once, and that Ctrl-C after "Start server" still drains, has no run behind it.
- The docs promise is left unqualified.
docs/windows.md:141-142on main: "Ctrl-C and Ctrl-Break drain native work before releasing CUDA resources." After this change that is false during download/loading; the PR does not touch the doc.
The change
Verified from pr_diff (nothing else in the diff):
- Removed 6 lines from
run()inflare/src/main.rs(PR head:138-146region, immediately after the Windows multi-host rejection at:138-146and beforelet bind = args.bind_address()), i.e. the#[cfg(windows)] unsafe { if SetConsoleCtrlHandler(Some(stop_console), 1) == 0 { return Err(last_os_error) } }block. - Added 8 lines inside
serve(), afterlet phase = progress.phase("Start server", None)/let context_tokens = bootstrap.model.limits.max_sequence_tokensand immediately beforeServer::start(...)(PR head:571-581): the same block plus two comment lines — "Loading keeps the default Ctrl-C termination because nothing observes STOP before serving." / "A registration failure must return before replay starts." - Untouched:
stop_consoleitself (still returns 1 for Ctrl-C/Ctrl-Break, 0 otherwise, settingSTOP), theSTOPstatic,serve_peer, the Unixlibc::signal(SIGINT/SIGTERM)registration at the PR head:605-609(afterServer::start), and every doc, test, workflow and manifest.
What the description does not say:
- That the target file was moved out from under the branch (fa158284), and that on main the counterpart insertion point is
serve_local, notserve(see Key findings). - That on main a second early-return shape exists:
serve()is only reached for cluster runs (flare-cli/src/main.rs:602-604); Windows rejects cluster runs before this code (:178-186), so on the ported target the handler is only ever Windows-relevant inserve_local. - The change is Windows-only by construction (
#[cfg(windows)]), so a Unix build is not evidence about the edited code path either.
What the description says that the change does not do: nothing material. The stated drain ordering ("a registration failure returns before replay begins, instead of dropping the package owner without a confirmed drain") is consistent with the code: the new return Err(...) precedes Server::start and therefore the std::mem::forget(owner) error paths at PR head :594-598; replay has not begun, so the owner can drop normally. The description's "its only earlier reader, the multi-host rendezvous wait, is Unix-only" is accurate at the PR head (mod distribution/mod launch are #[cfg(unix)]; distribution.rs:193, launch.rs:176).
The why
- #113 "Loader ignores Control C to cancel loading" — officiallymarky, 2026-10-27 13:09; mark-yong commented 2026-11-02 18:23 asking whether the reporter was on Windows; the reporter closed it 2026-11-02 23:18 with "No Linux but it is no longer an issue with recent builds." So the issue closed as resolved and the Windows gap is inferred by the author from code reading. The window from report to close is six days; the PR opened one day after the close.
- No other report of the symptom exists:
search_itemsfor "Ctrl-C" / "Windows console handler" / "cancelled loading model" / "cannot cancel loading force kill process" returned only #178 itself, plus #175's incidental note that Ctrl-C shut the server down cleanly on Windows (the post-start path only).
Related work
- #177 (open, original-el8) "Run Windows CI on Server 2025 and fix Windows cache file handling" — same files pre-split (
flare/src/main.rs) and nowflare-cli/src/main.rs; its 2026-11-13 comment lists.github/workflows/native-serving.yml(not opened),flare-cli/src/{cache_commands,main}.rs,flare-cli/tests/inspect.rs(not opened),flare/src/{cache_support,download_cache,hub}.rsas conflicting with main. Substance: the Windows CI job fails on every main commit (windows-2022 lacks I/O rings →STATUS_DLL_NOT_FOUND) and 8 flare unit tests fail on Windows. This is what makes the reviewer's requested--target x86_64-pc-windows-msvccheck meaningful — today a Windows job would be red for unrelated reasons. - #175 (merged, 534537c8, 2026-11-05) "Bound Windows integrated-GPU cache sizing by available commit" — original-el8; commit authored by "Jason Cook" (suggesting original-el8 and jasonc are the same person). Its validation reports Ctrl-C shutting the server down cleanly on Windows: evidence the post-start drain path works, no coverage of the loading window.
- #6 (closed 2026-11-19 as done) — the architecture change (fa158284,
flarebecomes the shared application library, Helios ownsLoadedSession/ServingSession) that explains whyflare/src/main.rsceased to exist. #178 targets the pre-move layout. - heliopause/src/processes_windows.rs:1-51 — a second, different Windows Ctrl-C policy already in the tree:
CliSignalsrestores the terminal (\x1b[0m\x1b[?25h) and callsExitProcess(130). The project therefore has two policies: preparation exits immediately, serving setsSTOPand drains. #178 moves the boundary of the serving policy. - No competing, stacked, or superseding PR for the same fix was found in search.
Recent activity
- Branch point
902c88e(yatesdr, 2026-11-02, "Add a hard reasoning-token budget and DeepSeek V4.1 sampling ranges (#167)"); PR commit85fb08c7dated 2026-11-03. Stale by roughly three weeks at the review. - Only one default-branch commit touched
flare/src/main.rsafter the branch point: fa158284 (Luke Alonso, 2026-11-09).flare-cli/src/main.rssince then: fa158284, 617ef929 (2026-11-11, checkpoint slots), 70069281 (2026-11-13, RoCE rails #232), da037284 (2026-11-22, recipes separation), 9710cadc (2026-11-23, hub download/verification speedups), 0067b242 (2026-11-23, Linux PCIe doctor + CLI startup/download output), f646bebc (2026-11-24, parallax CLI #507). - Recent activity in the area has added new Unix-only
STOPconsumers (flare-cli/src/parallax.rs:217,:197-202installs SIGINT/SIGTERM), so nothing new observesSTOPon Windows during loading.serve_peer(flare-cli/src/main.rs:540) still has no console handler, but Windows rejects multi-host (:178-186), so the Windows path isserve_localonly. - Net: the change builds on nothing recent and conflicts with none of the recent behavior — it is simply attached to a snapshot before the split.
People
- mark-yong: 9 merged PRs in 180 days, concentrated in
helios/src(7),docs(5),tests/preparation(3),ignition/preparation(2); e.g. #331 "Isolate cuBLAS warmup workspaces from CUDA graph capture" merged. Their open items are kernel/export defects (#395, #332) and their closed issues (#201–#206) are GPU-kernel correctness reports. The Windows CLI console path is outside their usual area; this is a one-off, self-contained fix, not a series. - yatesdr — the only reviewer; author of many Selene/scheduling commits (#138–#141, #167, #232 work) and of the commit the branch is based on; an established committer, though the charter's named priority contributors are @voipmonitor, @original-el8, @lukealonso. Review opens by accepting the substance: "Restoring the default Ctrl-C exit before serving is right for main's Windows path".
- Luke Alonso — owns fa158284, the move that invalidated the branch; the dominant committer in
flare/src(60 in 180 days) and named as the captured-graph reviewer indocs/design-review.md:22-25. - original-el8 / jasonc — priority contributor, author of the adjacent Windows PRs #175 (merged) and #177 (open); posted the only ordinary comment, on mergeability (2026-11-13): head
85fb08c7"merges cleanly into main 5fd4070d… the earlier GitHub conflict indication should not be treated as an outstanding rebase request" — which yatesdr's later review directly contradicts. - officiallymarky — filed #113, answered "No Linux" to the Windows question, closed the issue.
Community
One review, no approvals, no inline comments, no reactions. One ordinary comment (original-el8, mergeability). No re-review after the changes-requested review. Interest is low and confined to two of the area's regulars.
Project fit
Where it lines up:
- Smallest footprint: a relocation in shared CLI code, no new flag, no config key, no environment switch (
AGENTS.md:448-468forbids env switches), no per-model branch — consistent with the charter's "staying focused" / "keep the runtime small and model-agnostic" lines (charter lines 10, 12, 43). - Windows is in scope only as the documented subset:
docs/windows.mdis careful about "qualified / not qualified", multi-host, Orbit and multi-GPU desktop are unsupported on Windows; this change sits on the supported single-GPU CLI path. - The change is mechanical:
windows-sys 0.61withWin32_System_Consoleis already a dependency of both crates (flare/Cargo.toml:58-59,flare-cli/Cargo.toml:48-49), so no manifest change is needed after the port.
Where it does not:
- Docs vs behavior:
docs/windows.md:141-142promises "Ctrl-C and Ctrl-Break drain native work before releasing CUDA resources"; after this change Ctrl-C during download/loading terminates without draining. The PR does not amend the doc. (Same sentence exists at the PR head,docs/windows.md:66-70, untouched.) Related:docs/cli-design.md:1559"Shutdown restores the terminal after draining active execution." - Evidence rule:
AGENTS.md:155-169anddocs/design-review.md:97-105,181-208require a demonstrated defect and evidence, with a PR description stating why / what changed / claimed result / evidence. The description gives why, what and an explicit limitation, but the claimed result has no run behind it. - TODO policy:
AGENTS.md:52-60says unresolved defects and unrun checks belong indocs/TODO.txt.docs/TODO.txtalready lists Windows qualification gaps (lines 88, 93, 102, 284-295) but nothing about Ctrl-C/console handling — a place a qualification gap for this change would belong. - Label mismatch:
area:apidoes not describe a CLI console-handling change.
Claims and evidence
| Claim | Evidence offered | Status |
|---|---|---|
| Windows swallowed Ctrl-C during download/loading | code reading | Verified in code at the PR head (stop_console returns 1; every other STOP reader is #[cfg(unix)]) and still true on main (flare-cli/src/main.rs:187-192) |
| Ctrl-C during loading now ends the process | none | Unverified — no Windows build or run |
Ctrl-C during Server::start/after start still sets STOP and drains |
none | Structurally plausible (the loop at PR head :614 checks STOP; on main :714/:728), no run |
| A registration failure now returns before replay instead of dropping the owner without a confirmed drain | code reading | Consistent: the new early return precedes Server::start and the mem::forget(owner) paths at :594-598 |
| Unix behavior unchanged | #[cfg(windows)] |
True by construction; note this also means no Unix test can exercise the new lines |
| "no longer an issue" on Linux (#113) | reporter's word | Not independently verified, and not evidence about Windows |
Reach
- Who: Windows
flare runoperators on the single-host path only. Unix untouched. Windows multi-host/Orbit rejected before the code in question (flare-cli/src/main.rs:178-186). - Configuration and defaults: none changed. No flag, config key or env var.
- Dependencies: none added (
windows-sysalready present in both crates). - Deployment/compatibility: no package, core or ABI effect. The Windows desktop app (
flare-winui) loads in-process viaLoadedSession/ServingSessionand never used the CLI's console handler, so it is unaffected (helios/src/server/session.rs:14-108). - Drain machinery is unchanged; the guarantee still comes from
Server::close()reportingdrainedandDrainGuard/NativeModel::Dropretaining CUDA contexts when drain is unconfirmed (helios/src/server/session.rs:96-130,helios/src/runtime_core/model.rs:1053-1074). The PR only changes whenSTOPcan be set. - Open question — terminal state: relying on default Ctrl-C termination during loading means no cleanup runs, whereas the preparation CLI's Windows handler restores terminal colors/cursor (
heliopause/src/processes_windows.rs:16-27). No equivalent restore was found on theflare runloading path, so the startup banner/progress output and cursor may be left as-is on a Ctrl-C during load. Plausible cosmetic regression to check when someone runs the ported change on Windows. - Docs surface:
docs/windows.md:141-142, possiblydocs/cli-design.md§5.2 (1526-1560), which describesflare runloading and says nothing about interrupting it.
Process
- Open ~22 days at the packet; last activity 2026-11-18 22:47 (the review); no author reply, no re-review, no approval.
- CI: "no checks" on
85fb08c7. The PR-head workflow still buildsflare/Cargo.tomlon ubuntu-24.04 and windows-2022; after the split main's workflow targetsflare-cli. Even with checks, the windows-2022 job is documented as failing on every main commit (#177), so a Windows result would not have been meaningful. - Review: CHANGES_REQUESTED by yatesdr, four asks — (1) port to main, naming
serve_localand "the console handler is installed at line 148", "GitHub reports the branch as conflicting"; (2)cargo check --manifest-path flare-cli/Cargo.toml --target x86_64-pc-windows-msvcplus a realflare run COREsession with Ctrl-C during loading and after "Start server"; (3) state the pre-server behavior indocs/windows.md:141-142; (4)Signed-off-byperCONTRIBUTING.md:7-21and a fresh design acknowledgment, since "1c01matches the old base" (AGENTS.md:31-41,docs/design-review.md:161-208). - DCO/design trailer:
85fb08c7has noSigned-off-by; the design digest is keyed todocs/design-review.mdand is stale after main changed. - Disclosed limitation: "code review only… Written with AI assistance; reviewed before opening."
- Contradiction in the record: original-el8's comment says the branch merges cleanly into
5fd4070d; yatesdr says GitHub reports a conflict. Both can be "true" mechanically, but the substantive fact is that the edited file does not exist on main.
Open questions / not found
- No Windows compile or run exists anywhere in the record; nobody has reproduced the symptom on Windows.
- Whether the default-termination path during loading leaves the console in a bad state (cursor hidden, colors) is unverified; no cleanup equivalent to
heliopause's was found on theflare runloading path. - Whether the ported change belongs in
serve_localonly, or also in the clusterserve()path for symmetry (harmless but dead on Windows), is not settled by the review — the reviewer's "make the change there" does not distinguishservefromserve_local, and on main a copy intoserve()would compile silently and have no effect. - No competing or superseding fix was found for the Windows loading-time Ctrl-C; #177 is adjacent (Windows CI) rather than overlapping.
- Nothing found in the packet's remaining candidate leads (#317, #452, #438, #54, #332, #404, #506, #507, #426, #424, #318, #487, #479, #416) beyond sharing
main.rsor labels; none concern console handling.