Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1be6dc0
Windows: a platform layer and host builds that pass
BobClawblaw Oct 12, 2026
e5bb3bc
Windows: CUDA kernels, the native server and the GPU suites on sm_89
BobClawblaw Oct 12, 2026
1f87b27
Windows: pull into the hub cache, HOME, and the whole test step
BobClawblaw Oct 12, 2026
996a50f
Windows: build notes, strip before install, formatting
BobClawblaw Oct 12, 2026
aac93d2
Default port 8888
BobClawblaw Oct 12, 2026
81f5576
qwen3_5: serve Qwen3.5-2B on CUDA
BobClawblaw Oct 13, 2026
3ace97e
qwen3_5: serve Qwen3.8-27B on CUDA, one arena for a model's device me…
BobClawblaw Oct 14, 2026
6b85f22
qwen3_5: replay each decode shape as a CUDA graph
BobClawblaw Oct 14, 2026
b19e0d7
qwen3_5: DFlash2 drafts for Qwen3.8-27B on CUDA
BobClawblaw Oct 14, 2026
288ba03
qwen3_5: tree drafts on CUDA, the kept path replayed from a log
BobClawblaw Oct 14, 2026
61fc2bf
docs: the Qwen hybrids on CUDA in the Windows page and the README
BobClawblaw Oct 14, 2026
6aaf241
qwen3_5, platform: comments on one line
BobClawblaw Oct 14, 2026
8107ee2
Windows: checkpoint reads skip the page cache
BobClawblaw Oct 14, 2026
693533e
Windows: the signal handler type allows address 1, for aarch64
BobClawblaw Oct 14, 2026
f53ae20
docs: Windows as a target in the README and the Windows page
BobClawblaw Oct 14, 2026
e875ee2
CI: the host unit tests on Windows
BobClawblaw Oct 14, 2026
38ecce5
qwen3_5: the drafter reads TF_TIMING through the platform layer
BobClawblaw Oct 14, 2026
1817823
qwen3_5: the drafter takes a prompt longer than its tap ring
BobClawblaw Oct 14, 2026
b811a3b
qwen3_5 cuda: prompt chunks past 32 rows see the right keys, and tree…
BobClawblaw Oct 14, 2026
0a0856b
Windows: the server goldens and the Cortheon fuzz step on Windows hosts
BobClawblaw Oct 14, 2026
ccd06b9
cuda: cuBLASLt opens by its Windows DLL name
BobClawblaw Oct 14, 2026
045abbd
Windows: writes on an O_APPEND descriptor land at the end whole
BobClawblaw Oct 14, 2026
bdfeb84
golden check: a request-log mismatch names the first differing line
BobClawblaw Oct 14, 2026
39de039
lane core and native CUDA host for two-rank families with a vision to…
BobClawblaw Oct 14, 2026
153d6b4
golden check: the request log compares with LF endings on either side
BobClawblaw Oct 14, 2026
22d92e4
lane host: a warm pass that steps aside is not launched after its can…
BobClawblaw Oct 15, 2026
ef73ec3
tf_video: the includes back under its one-line header
BobClawblaw Oct 15, 2026
cc5d9d1
vision inputs: a server without --vision refuses image parts in the f…
BobClawblaw Oct 15, 2026
aaed024
qwen_image.formatSeconds: t * 10 rounded in integers, not f128, so te…
BobClawblaw Oct 15, 2026
9e6dfcd
lane host: a set-up job's kept entry stays pinned until its restore r…
BobClawblaw Oct 15, 2026
8570e06
qwen3_5: attention chunks follow each row's own keys, not the forward…
BobClawblaw Oct 15, 2026
5e1c3fe
qwen3_5: the DFlash2 config's divisors must be positive, and staging …
BobClawblaw Oct 15, 2026
52b82fc
prompt cache: an entry removed while pinned is dead to lookups and fr…
BobClawblaw Oct 15, 2026
92c9ef4
Merge branch 'pr-853' into qwen35-vision
BobClawblaw Oct 15, 2026
73f06f1
qwen3_5: image rows and M-RoPE positions in the CUDA forward
BobClawblaw Oct 15, 2026
a10b4de
qwen3_5: the vision tower on CUDA, and --vision on the Qwen engine
BobClawblaw Oct 15, 2026
ac94f8f
tf-qwen35-cuda: vision and mrope checks
BobClawblaw Oct 15, 2026
7ad45b6
native/cuda: drop the doc comment learnBytes left behind on toGib
BobClawblaw Oct 15, 2026
3217063
CI on #885: the server's image paths build on Windows; lean and a tra…
BobClawblaw Oct 15, 2026
55c47f9
tf-qwen35-cuda vision: the tower's rows bounded, exit 1 outside them
BobClawblaw Oct 15, 2026
5296eb1
tf-qwen35-cuda: one-line comments within 120 columns (the lean check)
BobClawblaw Oct 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Windows: writes on an O_APPEND descriptor land at the end whole
The platform handed O_APPEND to the C runtime as _O_APPEND, whose write
seeks to the end and then writes, so two threads appending at once could
overwrite each other's bytes: the request log lost lines under concurrent
requests, which the server goldens' request-log case caught on a slow
runner. A descriptor opened with O_APPEND now writes through WriteFile at
the end-of-file offset, which the kernel places whole, as POSIX does; the
file keeps its write access, so ftruncate on such a descriptor still works
(prompt_imprint repairs a torn index that way).

A request_log test appends 200 lines from each of 8 threads and expects
every line whole; it lost lines on Windows before this change.
  • Loading branch information
BobClawblaw committed Oct 14, 2026
commit 045abbd023a31553b006c8fb12c090acfbc102a8
13 changes: 13 additions & 0 deletions zig/src/platform/win_c.zig
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ fn openFile(path: [*:0]const u8, flags: O) c_int {
_ = CloseHandle(@ptrFromInt(@as(usize, @bitCast(h))));
return fail(.MFILE);
}
if (fd < append_fds.len) @atomicStore(u8, &append_fds[@intCast(fd)], @intFromBool(flags.APPEND), .release);
return fd;
}

Expand All @@ -293,7 +294,11 @@ pub fn openat(dir: fd_t, path: [*:0]const u8, flags: O, ...) callconv(.c) c_int
return openFile(p.ptr, flags);
}

/// Descriptors opened with O_APPEND, whose writes go to the end of the file whole, as POSIX appends do.
var append_fds: [8192]u8 = @splat(0);

pub fn close(fd: fd_t) c_int {
if (fd >= 0 and fd < append_fds.len) @atomicStore(u8, &append_fds[@intCast(fd)], 0, .release);
if (fd >= dir_base and fd < dir_base + dir_paths.len) {
lockDirs();
defer dirs_lock.unlock();
Expand All @@ -313,6 +318,14 @@ pub fn read(fd: fd_t, buf: [*]u8, len: usize) isize {
}

pub fn write(fd: fd_t, buf: [*]const u8, len: usize) isize {
if (fd >= 0 and fd < append_fds.len and @atomicLoad(u8, &append_fds[@intCast(fd)], .acquire) != 0) {
// WriteFile at the end-of-file offset lands whole; the CRT's seek-then-write lets writers interleave
const h = osHandle(fd) orelse return -1;
var ov: OVERLAPPED = .{ .offset = 0xFFFF_FFFF, .offset_high = 0xFFFF_FFFF };
var put: u32 = 0;
if (WriteFile(h, buf, @intCast(@min(len, chunk)), &put, &ov) == 0) return fail(lastError());
return put;
}
return _write(fd, buf, @intCast(@min(len, chunk)));
}

Expand Down
42 changes: 42 additions & 0 deletions zig/src/server/request_log.zig
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,45 @@ pub fn append(a: Allocator, path: []const u8, body: Value) void {
const framed = std.mem.concat(a, u8, &.{ line, "\n" }) catch return;
_ = platform.c.write(fd, framed.ptr, framed.len);
}

test "appends from several threads keep every line whole" {
const a = std.testing.allocator;
var tmp = std.testing.tmpDir(.{});
defer tmp.cleanup();
const cwd = try std.process.currentPathAlloc(std.testing.io, a);
defer a.free(cwd);
const path = try std.fmt.allocPrint(a, "{s}/.zig-cache/tmp/{s}/log.jsonl", .{ cwd, tmp.sub_path });
defer a.free(path);
const threads = 8;
const lines = 200;
const head = "{\"line\": \"";
const Worker = struct {
fn run(p: []const u8, k: u8) void {
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
const text = arena.allocator().alloc(u8, 300) catch return;
@memset(text, 'a' + k);
for (0..lines) |_| {
const o = json.newObject(arena.allocator()) catch return;
o.put(arena.allocator(), "line", .{ .string = text }) catch return;
append(arena.allocator(), p, .{ .object = o });
}
}
};
var workers: [threads]std.Thread = undefined;
for (&workers, 0..) |*w, k| w.* = try std.Thread.spawn(.{}, Worker.run, .{ path, @as(u8, @intCast(k)) });
for (workers) |w| w.join();
const got = try std.Io.Dir.cwd().readFileAlloc(std.testing.io, path, a, .limited(1 << 24));
defer a.free(got);
var counts: [threads]usize = @splat(0);
var it = std.mem.splitScalar(u8, got, '\n');
while (it.next()) |line| {
if (line.len == 0) continue;
try std.testing.expectEqual(head.len + 300 + 2, line.len);
const k = line[head.len] - 'a';
try std.testing.expect(k < threads);
for (line[head.len..][0..300]) |c| try std.testing.expectEqual('a' + k, c);
counts[k] += 1;
}
for (counts) |n| try std.testing.expectEqual(@as(usize, lines), n);
}
1 change: 1 addition & 0 deletions zig/src/server/root.zig
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ test {
_ = @import("logprobs_test.zig");
_ = @import("late_system_test.zig");
_ = @import("compact_test.zig");
_ = @import("request_log.zig");
_ = @import("completion_prompt_test.zig");
_ = @import("server_init_test.zig");
_ = @import("decisions.zig");
Expand Down
Loading