Repository navigation
Conversation
Zig 0.17.0's std.c.timespec is void on Windows and its CRT has no nanosleep, so three call sites fail to compile for x86_64-windows on current main: - cuda/roce.zig:456 builds a timespec literal for the proxy's 20 us nap. - tests/cuda/exl3_tp2_tests.zig:344 casts socket()'s result to a fd. - tests/cuda/flashnext_rank_tests.zig:48 builds a 0.6 s timespec delay. The nap becomes a helper that returns null where the timespec is void; the socket test helpers return before the fd cast on Windows (socket() returns SOCKET there, and the test is a CUDA NCCL run); the rank test's delay moves behind the same guard. No POSIX behaviour change: the nap helper returns the same 20 us timespec and the same nanosleep call off Windows.
|
On the
None of these files are touched by this PR ( #1193 carries the three fixes against Once #1193 lands, rebasing this branch onto the new main should turn |
… request The helper switched over @typeof(std.c.timespec), which is type, so it returned null on every host and turned the RoCE proxy's 20 us nap off on POSIX too. The nap now lives in roce_nap.zig, inspects the timespec type itself and is absent only on Windows. Two CPU tests cover the POSIX request and its single sleeper call, and an absent request that calls nothing. roce.zig stays under 600 lines and the rank test's delay keeps a one-line comment.
|
Thank you, @cshintov. This is on main now. Your commit landed as you wrote it (193e955), recorded under your GitHub noreply address so your personal address stays out of the public history. One maintainer commit follows, e67ece3. Your nap helper switched over
|
|
On the
Those lines come from The two runs use different seeds ( What this PR does fix is the Windows compile: |
What this changes
zig-windowsfails on current main (e658ac9) with three compile errors, all the same theme: Zig 0.17.0'sstd.c.timespecisvoidon Windows and its CRT has nonanosleep, so a POSIX-only construct is instantiated forx86_64-windows.This carries the three remaining sites.
digest_key.zigandspeech.zigwere fixed in 1.1.2 (61270ca, 476e16d) and #1129 was closed as superseded; these three were not.cuda/roce.zig:456—expected type 'void', found 'comptime_int'on the proxy's 20 us nap literalnapTimespec(), which returnsnullwherestd.c.timespecisvoid; the spin loop skips the sleep theretests/cuda/exl3_tp2_tests.zig:344—expected integer or vector, found '*anyopaque'on@intCast(socket())serve/receivereturn before the fd cast on Windows:socket()hands backSOCKET(usize) there, and this test is a CUDA NCCL run that never executes on Windowstests/cuda/flashnext_rank_tests.zig:48— same timespec literal for the injected 0.6 s delayNo POSIX behaviour change: off Windows
napTimespec()returns the identical 20 ustimespecand the proxy makes the identicalnanosleepcall.Receipt
e658ac9,zig build -Dtarget=x86_64-windows→ 3 compile errors intf-cuda-test,Build Summary: 18/21 steps succeeded (1 failed).tensorfold.exe,tf-cuda-test.exe,tf-qwen35-cuda.exe,tf-qwen35-learn.exe,tf-tp-watch-check.exeall produced.zig build test -Dtarget=x86_64-windows→ zero compile errors; the run steps refuse with "host cannot execute windows binaries", as expected off Windows.zig build -Dtarget=x86_64-linux→ clean.zig build teston macOS → 102 failures before this branch and 102 after, allxcrun: unable to find utility "metal"(this machine has no Metal toolchain). No non-Metal errors either way.Caveat: nothing here was executed on Windows. Compile-correctness is proven; runtime behaviour of the guarded paths is not, and the CI
zig-windowsjob is where that gets checked.