From 74e839d9c583d822227e8afd535aa223740e43cf Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 7 Oct 2026 12:09:08 +0100 Subject: [PATCH] fix(zig): use the Io awake clock in the bench harness (Zig 0.16) Zig 0.16's std.Io.Clock has real, awake and boot; .monotonic does not exist, so zig build failed with 13 errors in src/bench.zig and the E2E and Bench jobs on main were red. .awake is the monotonic clock that excludes suspend time, which is what a latency benchmark wants. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019j8She9eTFx54r6aL6sCHP Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> --- ffi/zig/src/bench.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ffi/zig/src/bench.zig b/ffi/zig/src/bench.zig index 214413fc..6173063c 100644 --- a/ffi/zig/src/bench.zig +++ b/ffi/zig/src/bench.zig @@ -23,14 +23,14 @@ fn benchmarkFn(comptime name: []const u8, comptime func: anytype) void { } // Measure (std.time.Timer was removed in Zig 0.16; the monotonic Io - // clock is the replacement) - const started = std.Io.Clock.Timestamp.now(shim.io(), .monotonic); + // clock, `.awake`, is the replacement) + const started = std.Io.Clock.Timestamp.now(shim.io(), .awake); for (0..BENCH_ITERS) |_| { func(); } - const ended = std.Io.Clock.Timestamp.now(shim.io(), .monotonic); + const ended = std.Io.Clock.Timestamp.now(shim.io(), .awake); const elapsed_ns: u64 = @intCast(started.durationTo(ended).raw.nanoseconds); const per_op_ns = elapsed_ns / BENCH_ITERS; const ops_per_sec = if (per_op_ns > 0) @as(u64, 1_000_000_000) / per_op_ns else 0;