#1 [high] PR #178 root cause verified on its base
PR #178 head 85fb08c7 (opened 2026-11-03, base main 5fd4070d per comment; base predates the Nov 9 refactor).
Base flare/src/main.rs (PR head):
- Handler registered in
main()at lines 146-152, beforeload_package/NativeModel::load_agreeing. stop_console(lines 643-652) returns 1 for CTRL_C_EVENT | CTRL_BREAK_EVENT -> marks handled -> suppresses default termination. Returns 0 for other events (correct).- STOP readers before the serving loop:
flare/src/distribution.rs:193(rendezvous wait) andflare/src/launch.rs:176— both in Unix-only modules (mod distribution/mod launchare#[cfg(unix)], main.rs lines 17-33). - Serving loop reader:
flare/src/main.rs:614. => On Windows, download + weight load + graph instantiation had zero STOP readers while the handler swallowed Ctrl-C. Diagnosis confirmed; #113 symptom real on Windows (issue #113 reporter was on Linux and said it was fixed/closed).
Fix places registration at main.rs 571-581, immediately before Server::start. Net diff -6/+8. No new deps (windows-sys Win32_System_Console already in flare/Cargo.toml:49). All code is #[cfg(windows)]; zero Unix risk.
Placement before Server::start is strictly better than after (Unix installs libc::signal after start, main.rs 605-609): before, a Ctrl-C during start sets STOP and the loop at 614 exits at once; a registration failure returns before replay begins, so no owner needs std::mem::forget.
Minor: PR description's "instead of dropping the package owner without a confirmed drain" is imprecise for the base (registration previously happened before any owner existed). Rationale for placement is still sound.
#2 [high] Blocker: file deleted on main; correct new home is serve_local
On current main, flare/src/main.rs DOES NOT EXIST (list_files flare/src/* and read_file confirm). The code moved to flare-cli/src/main.rs in fa158284 "Add a native Windows desktop backed by the shared Flare library" (2026-11-09), after this PR was opened (2026-11-03). So the PR edits a deleted file; it needs a port, not a rebase conflict resolution.
On main the same bug still exists: flare-cli/src/main.rs:187-192 registers SetConsoleCtrlHandler before loading; CI builds windows-2022 (native-serving.yml uses --manifest-path flare-cli/Cargo.toml).
CRITICAL PORT DETAIL: the fix must go into serve_local (flare-cli/src/main.rs:692-734), NOT into serve()'s "Start server" phase (line 628). On Windows serve() always delegates:
- flare-cli/src/main.rs:602-603
if cluster.is_none() { return serve_local(owner, config, progress); } - membership is always None on Windows (line 273-274), and rank/rendezvous/hosts/roce are rejected at lines 178-186, so
clusteris always None on Windows (match at 321-325 -> None). - Multi-host serving is unsupported on Windows (docs/windows.md:155-157).
So inserting the handler before
loaded.start()(line 702) is the equivalent edit; inserting it inserve()would compile but never run on Windows.
Maintainer yatesdr already requested changes 2026-11-18 asking for: port to flare-cli/src/main.rs (before the server starts), Windows build/run evidence, docs update, and DCO sign-off. All four are still unaddressed.
#3 [high] Secondary gaps: docs, DCO, evidence, simpler alternative
docs/windows.md:141-142 (main): "Ctrl-C and Ctrl-Break drain native work before releasing CUDA resources." After this change that sentence becomes misleading: before the serving loop starts, Ctrl-C kills the process immediately without draining (that is the intended new behavior). Docs need a sentence like "before the server starts, Ctrl-C ends the process immediately."
CONTRIBUTING.md:9 requires sign-off on all commits; head 85fb08c has no Signed-off-by trailer and the PR commit body carries Design-Signed-Off-By: Cursor Agent (Auto); design-review=1c01 (design ack tied to the old base). Real process blockers.
Testability cost (charter's "bring real evidence"): the only cheap test is a source assertion
include_str!("main.rs").contains("SetConsoleCtrlHandler") placed before loaded.start(). There is no behavioral test for console handler ordering, so the actual symptom can only be proven by running on Windows. Charter line: "Bug fixes need to address the root cause" + PR descriptions need evidence. A cargo check --target x86_64-pc-windows-msvc (cross-check works on Linux; MSVC link not needed for check) is the minimum feasible evidence and was not done.
Deeper alternative (same user-visible end, no new Windows code): use heliopause's existing scoped CliSignals (heliopause/src/processes_windows.rs:29-51), which on Windows calls ExitProcess(130) immediately (line 26) and also restores the terminal (line 23: ESC[0m + show-cursor). Tradeoff: ExitProcess during loading is a hard exit — no CUDA teardown — and the ~48 MiB guest-memory carveout per RTX Spark process (docs/windows.md:119-120) may be reclaimed late. That is acceptable during load (nothing was serving), saves 126, and arguably also fixes the cosmetic banner problem below.
Cosmetic issue the PR does not touch: on Windows the banner prints its final frame instead of animating (helios/src/startup.rs:72 if cfg!(windows) || ...). A hard exit during loading/user the "force-end" case would leave that frame, and possibly a stale cursor. heliopause's handler restores the terminal; flare's stop_console does not. This is not fatal but is a small polish gap in the chosen approach.
Ordinary abrupt-exit risk is low: Hub downloads resume from partial files (flare/src/hub.rs:278 comment; hub.rs:576), so Ctrl-C during download is safe, and Ctrl-C during loading leaves at worst a CUDA crash/log noise.
#5 [high] PR #178 updated head 43c6ea78 — final state verified (2026-11-29)
Head 43c6ea78 (parent 167f22c8 = current base of the PR). Diff: flare-cli/src/main.rs +7/-6, docs/windows.md +2/-2.
Fixed vs. my 2026-11-26 review:
- Removed the early
#[cfg(windows)] SetConsoleCtrlHandlerfromrun()(was flare-cli/src/main.rs:187-192 on base; still present at main:187-192). - Added it in
serve_local()immediately afterloaded.start()and beside the#[cfg(unix)]libc::signal block (flare-cli/src/main.rs:704-710, loop at :714-715, close at :718). This is exactly the placement the maintainer (yatesdr, 2026-11-18) and my prior review required:Server::startruns startup tuning graphs under a 120 s deadline (helios/src/execution/transport.rs:759-773) with no STOP reader, so registering after start keeps default termination through startup. - Docs rewritten in place: docs/windows.md:141-142 now "Ctrl-C and Ctrl-Break end loading immediately and drain native work before releasing CUDA resources once serving has started."
- Commit has
Signed-off-by: Mark YongandDesign-Signed-Off-By: Antigravity (Gemini 4 Neon); design-review=c3a9(43c6ea78 body); CONTRIBUTING.md:9-11 satisfied.
Still open:
- PR description is stale: still says "Register the handler immediately before
Server::start", "A Ctrl-C duringServer::startsetsSTOP... exits at once", and "Registering before the start ... instead of dropping the package owner". All three contradict the code (handler is after start). Body also uses the retired word "package" where the repo now says "core". Author's comment claims the description was updated to 43c6ea78; it was not (fetched body at 2026-11-28T19:37 unchanged). - No Windows evidence. GitHub check-runs for 43c6ea78 = 0 and workflow runs for that head_sha = 0 (fork PR, workflow needs approval). Linux
cargo test current manifest(221 passed) never compiles#[cfg(windows)]code.cargo xwin build --target x86_64-pc-windows-msvcis documented at docs/windows.md:29-34, needs no GPU, and was not run..github/workflows/native-serving.yml:6,20-21,45builds flare-cli on windows-2022 on every pull_request.
Why heliopause::CliSignals reuse should be rejected (resolves my earlier open question): heliopause is a pyo3 cdylib (heliopause/Cargo.toml:9-11,22,48) so depending on it would pull pyo3/openssl into the CLI; its Windows handler (heliopause/src/processes_windows.rs:16-27) calls ExitProcess(130), bypassing CUDA teardown and would break the drain guarantee the docs state. Current minimal relocation is the better answer.
Bonus effect not claimed in the PR: removing the early registration also stops swallowing Ctrl-C for flare download and flare models download on Windows (flare-cli/src/hub.rs:12-28 never reads STOP). Interrupted transfers resume from .part files (flare/src/hub.rs:3875-3918, 4585-4598).