Skip to content

Zig 0.17 - #1

Closed
filipnyquist wants to merge 6 commits into
JagritGumber:mainfrom
filipnyquist:zig-0.17
Closed

filipnyquist wants to merge 6 commits into
JagritGumber:mainfrom
filipnyquist:zig-0.17

Conversation

@filipnyquist

Copy link
Copy Markdown

No description provided.

Filip Nyquist and others added 6 commits November 10, 2026 09:24
- build.zig: run_smoke.addPassthruArgs() replaces b.args
- Replace removed array-repeat (**) with @Splat / comptime fill
- zig fmt: @intFromEnum/@enumFromInt -> @backingInt/@fromBackingInt
- TcpTransport: Io.VTable.netRead/netWrite are gone; socket I/O now goes
  through Io.Operation (net_read/net_write). Read/write timeouts use
  Io.Batch.awaitConcurrent instead of racing two concurrent tasks per
  I/O call, and always cancel the batch so evented backends never keep
  a pending op pointing at a dead stack frame.
- Bump .zigversion, build.zig.zon, VERSION and CI to Zig 0.17

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Breaking API change: the ?*const std.atomic.Value(bool) cancel token is
removed from Client.connectTcp/fromTransport/ping/sendQuery/query/insert
and Pool.acquire. Cancellation is now std.Io cancellation (Future.cancel,
Group.cancel) and surfaces as error.Canceled (was error.Cancelled).

- Map error.Canceled recorded by the transport back to Canceled instead
  of ConnectionFailed.
- When a query is canceled while waiting for the next server packet
  (or via the new ResultStream.cancel()), send the protocol Cancel packet
  and drain to EndOfStream/Exception with cancellation blocked and a
  Config.cancel_drain_timeout_ms budget, so the connection stays usable
  and the server stops the query. Mid-packet cancels still mark the
  connection broken.
- Check for a pending cancel before writing a query/ping so a task
  canceled before it started leaves the connection intact.
- Pool.acquire waits and locks cancelably (no slot leak on cancel).
- Export QueryError; add Event.query_cancel_sent.
- tests/smoke_async.zig + zig build smoke-async: cancel-query,
  stream-cancel, cancel-race, pool-cancel, fanout.
- Example 04 rewritten around io.concurrent + Future.cancel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- examples/06_concurrent_queries.zig: Pool + Io.Group fan-out and a
  query deadline via io.concurrent + Future.cancel
- CI runs zig build smoke-async and example 06 against ClickHouse
- README/docs: Zig 0.17, async + cancellation semantics table,
  cancel_drain_timeout_ms, Io.Evented networking gap in Zig 0.17.1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pre-0.11 @Frame-based async client and other legacy prototypes were
not built or referenced anywhere; async now lives in the main client via
std.Io.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The native protocol is request/response with small trailing packets
(Data terminators, Ping, Cancel), which Nagle can hold back waiting for a
delayed ACK. Matches what the reference ClickHouse clients do. Opt out
with Config.tcp_no_delay = false (TcpOptions.no_delay). Best effort:
skipped on Windows/WASI where std.posix.setsockopt is unavailable.

Also tighten the cancel-race smoke scenario to 250us steps so it keeps
covering both the mid-query and the already-finished outcomes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- bench/bench.zig (zig build bench -Doptimize=ReleaseFast): read
  throughput (UInt64/String, with and without LZ4), INSERT into a Null
  table (none/LZ4/ZSTD), ping latency, and concurrent query scaling
  over a Pool with Io.Group workers
- bench/reference_clickhouse_client.sh: clickhouse-client reference
  timings for the same workloads
- bench/collect.py merges runs (medians) into bench/results.json;
  bench/plot.py renders assets/benchmarks.svg (light/dark aware)
- README: benchmarks section with the chart, a table of the same
  numbers, and reproduction steps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d20d9bb6-5d61-4b30-a485-5c80aff804a0
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@filipnyquist
filipnyquist deleted the zig-0.17 branch November 10, 2026 08:54
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.

1 participant