Skip to content

feat(windows): Windows 11 port — CUDA server runtime and tray launcher - #317

Open
dvcdsys wants to merge 2 commits into
developfrom
feat/windows-port
Open

dvcdsys wants to merge 2 commits into
developfrom
feat/windows-port

Conversation

@dvcdsys

@dvcdsys dvcdsys commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Summary

Ports the server and the desktop launcher to Windows 11 (x64, NVIDIA/CUDA), shaped like the macOS app. Experimental — see the status notes in doc/WINDOWS_APP.md.

  • Server / runtime: Windows builds of server/ and cli/; Job Object process tree (internal/procgroup); cix-server -env-file and -log-dir so Task Scheduler runs the server directly; CUDA 13.3 llama-server fetch with pinned checksums; win/scripts/build-runtime.sh + verify-runtime.ps1; windows-runtime job in release-server.yml; Windows test jobs in CI.
  • Launcher: shared logic moved out of *_darwin.go; per-platform seams for shell (Win32 tray + WebView2, pure Go), service (Task Scheduler), runtime archive/current (zip + junction), self-update (silent installer), dialogs, takeover. panel.html is shared.
  • Packaging: per-user Inno Setup installer (no admin prompt), release-windows.yml on a new win/v* tag stream, docs in doc/WINDOWS_APP.md and win/README.md.
  • Fixes that also touch macOS: release.Client.AssetSuffix (a shared tag stream only counts releases that carry the platform's asset); the panel no longer opens on every launch when no download is needed.

Verified on a real Windows 11 + CUDA machine

Runtime install, start/stop with GPU use, graceful shutdown with no orphan llama-server, runtime update, automatic rollback of a runtime that dies after install, installer self-update and relaunch, uninstall. Launcher unit tests pass on Windows and macOS.

Not verified

Anything built by CI (the release workflows were never run), other hardware or Windows builds, non-NVIDIA machines.

🤖 Generated with Claude Code

dvcdsys and others added 2 commits November 6, 2026 16:37
Ports the server and the desktop launcher to Windows 11 (x64, NVIDIA/CUDA)
with the same shape as the macOS app. Experimental: tested on one machine.

Server / runtime
- server and cli build for windows/amd64. New internal/procgroup (unix process
  group / Windows Job Object with KILL_ON_JOB_CLOSE) replaces Setpgid/Kill in
  the llama supervisor and the tunnel runners; the CLI daemon gets proc_{unix,
  windows}.go. Sidecar transport is TCP on Windows.
- cix-server -env-file <path> (internal/envfile: the dialect the launcher's
  server.env writes; the real environment wins) and -log-dir <dir>
  (internal/stdio: stdout/stderr into cix-server.log/.err, down to the Windows
  std handles so llama-server inherits them). Together they let Task Scheduler
  run the server directly, with no wrapper process.
- llama.cpp for Windows: fetch-llama-windows.sh pins the CUDA 13.3 build plus
  the cudart archive (Blackwell needs CUDA >= 12.8), SHA256-checked.
- win/scripts/build-runtime.sh + verify-runtime.ps1 produce and prove
  cix-runtime-<ver>-windows-amd64.zip; release-server.yml gets a
  windows-runtime job; ci-server/ci-cli get Windows test jobs.
- Real Windows bugs found by running the suites there: directory fsync,
  key-file permission check, path-traversal guards (rooted paths, NTFS
  streams, 8.3 names), OS separators leaking into signatures and prompts.

Launcher (cli/launcher)
- Shared logic (menu, first run, poller, updater, runtime layout) moved out of
  *_darwin.go into neutral files; the OS differences sit behind one file per
  platform: shell (AppKit | Win32 tray + WebView2, pure Go, no cgo), service
  (launchd | scheduled task), runtime archive + `current` (tar.gz + symlink |
  zip + junction), self-update (DMG swap | silent installer), dialogs, takeover.
  panel.html is shared and picks its bridge from window.cixPlatform.
- Server stop sends Ctrl+Break via a throwaway helper process: the event goes
  to every process on the console and kills the sender; neither
  SetConsoleCtrlHandler(NULL) nor signal.Notify protected the launcher.
- The launcher reads the runtime through the junction's resolved target:
  Windows 11 Redirection Guard makes a user-created junction untraversable for
  processes that inherited the policy (setup programs and their children).
- release.Client.AssetSuffix: a shared tag stream only counts releases that
  carry this platform's asset. startupFlow no longer opens the panel at every
  launch when no download is needed (shared with macOS).
- Test seam, off by default: CIX_TEST_CONTROL=1 + `cix-launcher -send <action>`.

Packaging: win/installer/cix.iss (per-user Inno Setup, no admin prompt, PATH and
sign-in entries, self-update via /VERYSILENT /RELAUNCH=1), win/scripts/
build-app.sh, release-windows.yml (win/v* tag stream). Docs: doc/WINDOWS_APP.md,
win/README.md, doc/WINDOWS_RUNTIME.md.

Verified on a real Windows 11 + CUDA machine: runtime install, start/stop with
GPU use, graceful shutdown with no orphan llama-server, runtime update, automatic
rollback of a runtime that dies after install, installer self-update and relaunch,
uninstall. Not verified: any release built by CI, other hardware, non-NVIDIA.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant