Skip to content

Windows: main's host tests build again on Windows hosts - #1034

Open
jayleaton wants to merge 5 commits into
ashhart:mainfrom
jayleaton:fix/windows-host-build
Open

jayleaton wants to merge 5 commits into
ashhart:mainfrom
jayleaton:fix/windows-host-build

Conversation

@jayleaton

@jayleaton jayleaton commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

On current main (76aafcf2), zig-windows fails 15 build steps on every pull request based on it. The errors are in main's own files.
This PR makes main's host tests build and pass on Windows again. It uses the sys layer (zig/src/platform/sys.zig) and the Windows gates main already has.
It unblocks the Windows job for every PR based on current main, and changes no POSIX behaviour; the touched lines are listed below.

zig-windows on main 76aafcf2: 15 failed steps, 51 error lines
  std.DynLib, std.c HANDLE types ... sys.DynLib, sys.c (the same calls on POSIX)
  Environ.getPosix ................. sys.getenv
  POSIX-only tests and hints ....... existing Windows gates / SkipZigTest
zig-windows on this branch: success

Error groups and the files fixed

Error on Windows Fix Files
std.DynLib: "unsupported platform", or not the sys.WinDynLib a Driver holds sys.DynLib (which is std.DynLib off Windows); the native load fakes open kernel32.dll on Windows, as the copy-custody tests do core/picture/webp.zig, cuda/roce.zig, families/drama3/cuda/blas.zig, cuda/copy_source_close_test.zig, cuda/copy_source_race_test.zig, native/cuda_load_gpu.zig
std.c types that are HANDLEs on Windows: clock_gettime's void parameter, pid_t (which JSON cannot carry), write sys.c.clock_gettime, nanosleep, pid_t, getpid, getenv, write; the digest probe writes through std.Io on Windows, because it is built without sys families/flashnext/cuda_rank_wire.zig, cuda/memory_receipt.zig, core/digest_cache_probe.zig
Environ.getPosix: no view on Windows' environment block sys.getenv, as the JPEG case in the same file already does core/picture/picture_test.zig
inode is i64 on Windows, but the field is u128 its bits read as u64 core/digest_key.zig (portable fallback only)
Socket handle is isize on Windows (std.c.setsockopt, getsockopt) Windows sets TCP_NODELAY and the send stall through sys.posix; the test reads the option back only off Windows server/speech.zig, server/listener.zig
ws2_32.MSG has no NOSIGNAL / DONTWAIT send, receive and checkPeer refuse off Linux, as Link.open already does families/flashnext/cuda_rank_wire.zig
Benchmark command (termios, SIG.HUP, Permissions.toMode, posix_openpt) benchmark_config_test.zig joins the benchmark tests' existing non-Windows gate server/root.zig
std.c.socketpair is void on Windows Windows skips tests built on Unix socket pairs server/root.zig (speech stream test), families/flashnext/cuda_rank_media.zig, families/flashnext/cuda_lanes_restore_test.zig
fork / waitpid death tests SkipZigTest on Windows vision/qwen_cuda_test.zig, families/nemotron/cuda_pages_safety_test.zig
mmap / munmap undefined at link H3's host targets and its checkpoint test skip Windows, like the fake fabric's at build.zig:595 zig/build/cuda.zig
Digest reuse across runs, which digest_key.persistent keeps only on Linux and macOS skip on !persistent, as every digest_cache_test does core/checkpoint_identity_test.zig
std.posix.MADV is void on Windows the madvise read hint skips Windows families/flashnext/cuda_ple.zig

No POSIX behaviour change: the touched lines

Each line below falls into one of five groups. Lines in the first group take the same path on Linux and macOS, where sys.DynLib == std.DynLib, sys.c == std.c and sys.posix == std.posix. The other groups add a branch taken only on Windows, or are unreachable on POSIX.

  • Same call on POSIX: webp.zig:69, roce.zig:4, 216, 288, drama3/cuda/blas.zig:3, 37, 53, copy_source_close_test.zig:87, copy_source_race_test.zig:100, cuda_load_gpu.zig:159, 281 (libc.so.6 / libSystem are unchanged), memory_receipt.zig:3, 10-11, 21-22, 26, 31, 36, cuda_rank_wire.zig:4, 47-48, 57-58, picture_test.zig:122, speech.zig:3, 282-283.
  • Windows-only branches: speech.zig:280 (POSIX keeps its std.c.setsockopt), listener.zig:158-163, digest_cache_probe.zig:33-34 (POSIX keeps its std.c.write), cuda_ple.zig:391, server/root.zig:42, cuda_rank_media.zig:61, cuda_lanes_restore_test.zig:52, qwen_cuda_test.zig:248, nemotron/cuda_pages_safety_test.zig:162, zig/build/cuda.zig:228-229, 362-363.
  • Off-Linux refusals: cuda_rank_wire.zig:135, 153, 185. On macOS these are unreachable, because Link.open already returns error.RankPlatform there.
  • !persistent skips: checkpoint_identity_test.zig:127, 172. persistent is true on Linux and macOS.
  • Moved inside an existing gate: server/root.zig:113. benchmark_config_test.zig still runs on Linux and macOS.
  • Portable fallback only: digest_key.zig:34. Linux and macOS return from their own statx / fstat branches above it.

Receipt

  • Environment: GitHub Actions windows-latest and ubuntu-latest, Zig 0.17.0, base 76aafcf2.
  • Before: zig-windows on PRs based on 76aafcf2: "Build Summary: 124/156 steps succeeded (15 failed); 1243/1256 tests passed (13 skipped)", with the same 51 error lines in each run (for example run 39129528327).
  • After: run 39133116461 on 023975f1, with zig-windows and zig both successful. The Windows job's zig build test, zig build test-golden ("303/315 equal to the frozen Python answers, 0 unexpected differences") and zig build fuzz-cortheon steps all pass. fmt, desktop and mobile pass too.
  • Exactness, decode and prompt speed: n/a. No engine arithmetic or serving path changes on Linux or macOS.
  • Not run: no local Zig build or tests; CI is the only test environment for this change. Lean rule: an emulation of tools/zig/lean_check.py's rules reports no new finding against 76aafcf2.

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (No serving change.)
  • No precision traded for speed. No bits change.
  • No GPU kernel added or changed.
  • Prompt processing is no slower than the last release. (No prompt path change.)
  • The description says which platforms I ran, Metal M1 to M5 and CUDA, and which I could not. (Windows and Linux host CI only; no device runs.)
  • New tests fail before the change, pass after it, and skip cleanly without their dependency. (No new tests; existing tests skip on Windows where they need POSIX.)
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths. No AI attribution lines.

The zig-windows job fails 15 build steps on main 76aafcf. Each fix uses the sys layer or an existing Windows gate,
and none changes what Linux or macOS run:
- std.DynLib, which does not build on Windows, becomes sys.DynLib (which is std.DynLib off Windows): webp, drama3 BLAS,
  and the copy-custody, native load and H3 runtime test fakes.
- std.c.clock_gettime and nanosleep become sys.c's (the same calls on POSIX): Flash Next's rank wire, H3's clock.
- Environ.getPosix becomes sys.getenv in the picture tests, as their JPEG case already does.
- digest_key's portable fallback reads Windows' signed inode as its unsigned bits.
- speech.zig sets TCP_NODELAY and the send stall through sys.posix on Windows; POSIX keeps its std.c call.
- The rank wire's send, receive and peer check refuse off Linux as its open already does; Windows has no MSG.NOSIGNAL.
- Windows skips POSIX-only tests: benchmark_config_test joins the benchmark tests' existing gate, the speech stream
  test and Flash Next's rank tests use Unix socket pairs, two death tests fork, the H3 checkpoint test maps with
  mmap, the listener test reads TCP_NODELAY back with getsockopt, and Flash Next's madvise hint has no Windows call.
…o; H3's host tests skip Windows

The first Windows run of these fixes left 8 failed steps:
- memory_receipt's pid is a HANDLE in std.c on Windows, which JSON cannot carry; sys.c's pid_t, getpid, clock and
  getenv are the same calls on POSIX.
- roce.zig loads libibverbs through sys.DynLib.
- digest_key reads Windows' signed 64-bit inode as u64 (std.meta.Int is gone in Zig 0.17).
- H3's library opens its checkpoint with mmap too, so its host targets skip Windows like the checkpoint test; the
  H3 clock and runtime fake edits are no longer needed and are reverted.
- Flash Next's rank media test runs over a Unix socket pair: Windows skips its import instead of its session.
…entity tests skip without persistent keys

The second Windows run built everything but the digest probe and failed 13 tests:
- cuda_load_gpu's fake driver opened libc.so.6; on Windows it opens kernel32.dll, as the copy-custody tests do.
- Two checkpoint identity tests need digests reused across runs, which digest_key keeps only on Linux and macOS;
  they skip on !persistent like every digest_cache test.
- digest_cache_probe writes its count through sys.c.write (std.c.write takes a HANDLE on Windows).
…cutable has no sys module

The third run's only failure: digest-writer is built outside the sys walk, so it cannot import sys. POSIX keeps
its std.c.write.
@ashhart

ashhart commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Thanks @jayleaton. The native fakes now use kernel32.dll, and H3's host roots are excluded on Windows, so that part of the earlier ask is addressed. Your Windows and Linux CI receipts are useful.

The rank-wire issue remains: the restore and media tests construct links directly from socket pairs on macOS, bypassing Link.open, so send, receive and checkPeer still hit the new off-Linux refusal. Please keep those Mac controls working by limiting the new refusal to Windows or retaining their POSIX transport, and attach Mac and Linux host results. We'll carry the Windows fixes onto our line once those gates pass.

Posted by Ash's AI Assistant Synthena

…dows only

macOS's restore and media tests build links straight from socket pairs, bypassing Link.open, so the earlier off-Linux
refusal stopped their controls. Every POSIX OS keeps its transport; Winsock has no MSG.NOSIGNAL or DONTWAIT.
@ashhart

ashhart commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Thanks @jayleaton. The Windows-only rank-wire guards now preserve the macOS socket-pair restore and media controls, closing our remaining source finding. The native fake DLL fixes and Windows-only H3 exclusions remain intact. We'll carry this onto the 1.1.2 line, preserving the newer build registrations, optional-library errors and server recovery behavior. The next gate is the restored Mac controls plus Linux and Windows host checks on that integrated source. No new model or GPU run is needed for this portability change.

Posted by Ash's AI Assistant Synthena

GarupanOjisan added a commit to GarupanOjisan/TensorFold that referenced this pull request Oct 19, 2026
ジョブ単位の continue-on-error ではワークフローの結果だけが成功になり、
PR のチェックでは zig-windows が失敗のまま表示されていた。
3 つのステップに付け替え、ジョブは成功、各ステップの失敗は注記として残す。
upstream の Windows 修正(ashhart#1034、1.1.2 の系列に入る予定)を
取り込んで zig-windows が通るようになったら外す。

Refs #2

Co-Authored-By: Claude Opus 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.

2 participants