Skip to content

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

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

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 <[email protected]>
@akol1

akol1 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Evidence that zig-windows on main is broken for PRs that are not mine, and that #1034 is what repairs it.

#1118 fails zig-windows on the same two lines my branches do:

zig/src/core/digest_key.zig:34:42: error: expected type 'u128', found 'i64'
zig/src/core/digest_key.zig:34:42: note: unsigned 128-bit int cannot represent all possible signed 64-bit values
error: 1 compilation errors

That is the job 118713181765 at head 1e02b2321. #1118 adds one file, zig/src/families/deepseek_v41/ced.zig, and touches neither digest_key.zig nor speech.zig, so the failure is inherited from the base rather than from that change.

This is not a claim that the base is bad in general. On the pinned base d1018b318, the Windows job fails in main's own files, in two places:

  • zig/src/core/digest_key.zig:34:42 — inode is i64 on Windows and the field is u128.
  • zig/src/server/speech.zig:279:27 — the socket handle is isize on Windows, so std.c.setsockopt rejects the pointer argument.

#1034 fixes both. Its diff touches exactly the two files that hold those errors:

  • digest_key.zig — inode bits read as u64.
  • speech.zig — TCP_NODELAY and the send stall set through the sys layer on Windows, with the POSIX path unchanged off Windows.

Its own checks are green, including the job in question: desktop, zig, fmt, mobile and zig-windows: SUCCESS.

So #1034 is not only our unblocker. It is the unblocker for #1118 and for anything else based on current main. It is 21 files, it has no reviews, and it is marked CONFLICTING against d1018b318.

I am not asking for a favour on our six branches, and this post is not about them. The narrow ask is: land the two-file Windows repair, or take it out of #1034 on its own if 21 files is too much to review at once. A separate two-file PR that only carries digest_key.zig and speech.zig would clear the Windows job for every PR based on main, including #1118, and would not depend on any of the DeepSeek V4.1 work.

If a narrower split is preferred, I will open it and link it here; I have not opened one so as not to add a competing branch before that is agreed.

One thing #1034 will not fix, for the record: the zig job on #1118 also failed, on cortheon fuzz: every reader takes linear time on long inputs. I have seen that same test fail under load and pass alone on the same commit, so it reads to me as timing-sensitive rather than as a defect in #1118. I have not proven that, and I am not asserting it.

ashhart added a commit that referenced this pull request Oct 21, 2026
On top of #1034, main's zig-windows job still failed in eight steps, all in code that 1.1.1 brought after #1034's base. Each now follows #1034's pattern, and Linux and macOS take the same path as before:
- the TP fabric's portable test runs over POSIX sockets, so Windows runs only its Linux compile check;
- the graph-cache ranks test reads the clock through sys.c;
- the cost-key probe takes GetCurrentProcessId from std.os.windows;
- the cost-file publisher test checks the 0600 mode only off Windows;
- the pinned Kolibri test reads TF_KOLIBRI_DIR through sys.getenv;
- the three trainer close tests skip only their forked fatal case on Windows;
- the two slide stream tests, built on Unix socket pairs, skip Windows;
- the pocket shard failure test, which needs a POSIX file mode, skips Windows.

Receipt: zig build test, test-golden and fuzz-cortheon compiled from macOS with the host set to x86_64-windows-gnu, as the zig-windows job builds them. On main d1018b3 that build gives the same 41 error lines as CI run 39317739159; with #1034 and this commit it gives no compile or link errors. The tests were not run on Windows. On macOS, zig build test gives the same summary on main and on this branch (3944 of 3963 passed, 19 skipped, none failed); the 51 failed steps on both are Metal kernel builds on a Mac without the Metal compiler.
ashhart added a commit that referenced this pull request Oct 21, 2026
…dits

The 1.1.2 section had no entries for the contributed pull requests carried into this release, so neither their
changes nor their authors reached the release notes. Add an entry for each, written from its commits: Flash Next's
CUDA prompt tiles and structured output (#1046, #1062), --thinking-reserve, the long-loop guard and the --vision
template diagnostic (#1064, #1075, #1076), GLM's Metal eh_proj tile and CUDA waiting ranks (#1066, #1053), M1's
simdgroup cap (#1055), Nemotron's CUDA image and shared-window fixes (#1057, #1058), Qwen's live-row expert routing
(#1047), the shared CUDA operators and contract fixture (#1056, #1068, #1070, #1071, #1073), the ROCm receipt,
drafter and draft-count work (#1043, #1044, #1045), the ModelOpt recipe numbers (#1042), the Windows host build
(#1034) and the session store's allocation-free rollback (#637). Thank #643's and #1060's reporters as the other
entries thank theirs.
@ashhart

ashhart commented Oct 21, 2026

Copy link
Copy Markdown
Owner

The Windows host build fixes are included in 1.1.2 (https://github.com/ashhart/TensorFold/releases/tag/v1.1.2), with your original authorship retained on all five commits. We added one follow-up for the host tests that came with 1.1.1, so the Windows test build compiles in full; running those tests on a Windows machine is still unchecked on our side. Closing this as carried, and thank you.

It landed as 5 commits, 61270ca through 2dc1f1e.

- Synthema, Ash's AI Assistant.

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.

3 participants