Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 7 additions & 6 deletions .github/workflows/native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ jobs:
python3 - <<'PYTHON'
import hashlib, json, os, pathlib, platform, tarfile, urllib.request
version = pathlib.Path('.zig-version').read_text().strip()
assert version == '0.16.0', 'Expected exact Zig 0.16.0'
assert version == '0.17.0', 'Expected exact Zig 0.17.0'
architecture = {'x86_64': 'x86_64', 'arm64': 'aarch64', 'aarch64': 'aarch64'}[platform.machine()]
system = {'Linux': 'linux', 'Darwin': 'macos'}[platform.system()]
with urllib.request.urlopen('https://ziglang.org/download/index.json', timeout=30) as response:
artifact = json.load(response)[version][f'{architecture}-{system}']
metadata = json.loads(pathlib.Path('.github/zig-release.json').read_text())
assert metadata['version'] == version
artifact = metadata['artifacts'][f'{architecture}-{system}']
assert artifact['tarball'].startswith('https://ziglang.org/')
directory = pathlib.Path(os.environ['RUNNER_TEMP']) / 'bounded-http-zig'
directory.mkdir()
Expand All @@ -58,9 +59,9 @@ jobs:
packet="$RUNNER_TEMP/bounded-http-native"
mkdir -p "$packet"
{ git rev-parse HEAD; uname -a; zig version; python3 --version; } > "$packet/environment.log"
zig build verify -Doptimize=Debug -j2 --summary all 2>&1 | tee "$packet/debug.log"
zig build verify -Doptimize=ReleaseSafe -j2 --summary all 2>&1 | tee "$packet/release-safe.log"
zig build -Doptimize=ReleaseSafe -j2 2>&1 | tee "$packet/install.log"
zig build verify -Doptimize=debug -j2 --summary all 2>&1 | tee "$packet/debug.log"
zig build verify -Doptimize=safe -j2 --summary all 2>&1 | tee "$packet/release-safe.log"
zig build -Doptimize=safe -j2 2>&1 | tee "$packet/install.log"
python3 tests/test_compare.py -v 2>&1 | tee "$packet/comparator.log"
for suite in integration inline_integration gather_integration batch_integration arena_lifecycle_integration; do
python3 "tests/$suite.py" --timeout 120 --json "$packet/$suite.json" 2>&1 | tee "$packet/$suite.log"
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/windows-runtime-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,16 @@ jobs:
- name: Check out the selected revision
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Install checksum-verified exact Zig 0.16.0
- name: Install checksum-verified exact Zig 0.17.0
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$baseline = (Get-Content -Raw ".zig-version").Trim()
if ($baseline -cne "0.16.0") { throw "This gate requires the exact repository 0.16.0 baseline" }
$indexUrl = "https://ziglang.org/download/index.json"
if ($baseline -cne "0.17.0") { throw "This gate requires the exact repository 0.17.0 baseline" }
$headers = @{ "User-Agent" = "bounded-http-windows-verification/1" }
$index = Invoke-RestMethod -Uri $indexUrl -Headers $headers -TimeoutSec 30
$release = $index.PSObject.Properties[$baseline]
if ($null -eq $release) { throw "Official index lacks the requested release" }
$entry = $release.Value.PSObject.Properties["x86_64-windows"]
if ($null -eq $entry) { throw "Official index lacks the native x64 compiler" }
$artifact = $entry.Value
$metadata = Get-Content -Raw .github/zig-release.json | ConvertFrom-Json
if ($metadata.version -cne $baseline) { throw "Compiler metadata version mismatch" }
$artifact = $metadata.artifacts.PSObject.Properties["x86_64-windows"].Value
$url = [string] $artifact.tarball
$expected = ([string] $artifact.shasum).ToLowerInvariant()
if ($url -notmatch '^https://ziglang\.org/' -or $expected -notmatch '^[0-9a-f]{64}$') {
Expand Down
32 changes: 32 additions & 0 deletions .github/zig-release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"artifacts": {
"aarch64-linux": {
"shasum": "9e8d11661d4ae3bd57702a3832781e23ad151dde5798e16a5ccd503f65234ff8",
"size": "52877280",
"tarball": "https://ziglang.org/download/0.17.0/zig-aarch64-linux-0.17.0.tar.xz"
},
"aarch64-macos": {
"shasum": "b607e9b9234790a008116ae5bdb71c6243b84b9fb42a53a9e70fde41c06c536a",
"size": "53985220",
"tarball": "https://ziglang.org/download/0.17.0/zig-aarch64-macos-0.17.0.tar.xz"
},
"x86_64-linux": {
"shasum": "1cbe9df9f27e6b78d14ccbca43b6703a404ef79ef1c463de901d7f088d4e2026",
"size": "57332648",
"tarball": "https://ziglang.org/download/0.17.0/zig-x86_64-linux-0.17.0.tar.xz"
},
"x86_64-macos": {
"shasum": "4f9a1c5269aa17ebda5e6d3c2b89d6cbf36f7d2b22a0306e9ab98f25f95529c6",
"size": "59317572",
"tarball": "https://ziglang.org/download/0.17.0/zig-x86_64-macos-0.17.0.tar.xz"
},
"x86_64-windows": {
"shasum": "b5663f69581dcf391293fbf16c06cb80d81d806545ce618b4d0bab7f0eb8c428",
"size": "100268137",
"tarball": "https://ziglang.org/download/0.17.0/zig-x86_64-windows-0.17.0.zip"
}
},
"signature_verification": "Ed25519 prehashed minisign archive and trusted-comment signatures verified against the official download-page public key",
"signing_key": "RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U",
"version": "0.17.0"
}
2 changes: 1 addition & 1 deletion .zig-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.16.0
0.17.0
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Use `bounded-http` for the repository, directory, executable, and HTTP Server to
Use `bounded_http` for the Zig package, dependency key, and module.
Preserve historical evidence names and the shared `/tmp/zig-http-measurement.lock` path.

Use exact Zig 0.16.0 from `.zig-version`. This standalone M4 implementation is
Use exact Zig 0.17.0 from `.zig-version`. This standalone M4 implementation is
informed by `../zigllmwiki`; runnable server code belongs here under `src/` and
tests, not copied into wiki pages. Preserve the wiki's source/evidence hierarchy.

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Fast by design. Explicit about limits.**

An experimental HTTP/1.1 framework and reference server for **Zig 0.16.0**, built on **native event-driven networking**.
An experimental HTTP/1.1 framework and reference server for **Zig 0.17.0**, built on **native event-driven networking**.

| Platform | Native backend | Network progress |
| --- | --- | --- |
Expand Down Expand Up @@ -61,8 +61,8 @@ ReleaseSafe is the preferred experiment mode; assertions remain enabled.

```sh
zig version
zig build verify -Doptimize=ReleaseSafe
zig build -Doptimize=ReleaseSafe
zig build verify -Doptimize=safe
zig build -Doptimize=safe
./zig-out/bin/bounded-http --port 8080 --connections 128
```

Expand All @@ -85,7 +85,7 @@ Linux shard listeners and the Windows acceptor receive the same configured addre

See the [architecture guide](docs/ARCHITECTURE.md#windows-socket-handoff) and [native shard receipt](reports/2026-09-06-windows-shards.md).

The version must print `0.16.0`. The server prints `READY` to stderr after
The version must print `0.17.0`. The server prints `READY` to stderr after
startup. Linux and macOS accept SIGINT or SIGTERM; Windows consoles accept Ctrl-C or Ctrl-Break.
`--duration-ms 30000` requests
shutdown after a finite run. `--port 0` asks the OS for an available
Expand Down Expand Up @@ -114,7 +114,7 @@ Debug as well:

```sh
python3 tests/integration.py --server zig-out/bin/bounded-http --json .zig-cache/integration.json
zig build verify -Doptimize=Debug
zig build verify -Doptimize=debug
```

For Linux Debug, `build.zig` explicitly selects bundled LLVM/LLD after the native
Expand Down Expand Up @@ -242,7 +242,7 @@ capacity, so heap usage multiplies with shard count even though admission is
a shared process-wide ceiling. This is not an RSS limit: allocator
metadata, libc/pthread metadata and actual stack mappings, mapped kernel rings,
socket queues, loaded assets and arbitrary application allocations require
separate accounting. Zig 0.16's pthread implementation uses its C allocator for
separate accounting. Zig 0.17's pthread implementation uses its C allocator for
thread bookkeeping despite the supplied spawn allocator. The demo seals its
framework allocator after startup and counts/refuses subsequent allocation
attempts through it. See [Budget](src/budget.zig) for the implementation.
Expand Down
7 changes: 6 additions & 1 deletion benchmarks/prepare/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Reproduce the Linux comparison preparation
# Reproduce the historical Zig 0.16 Linux comparison preparation

This reproducer preserves the September 2026 Zig 0.16.0 comparison pins.
Use an archived engine commit whose `.zig-version` matches `pins.json`.
The current engine targets Zig 0.17.0; these historical preparation inputs
do not qualify its performance and must be ported separately before a new comparison.

`prepare.py` downloads pinned primary sources and package artifacts, verifies their
hashes, builds the three contenders and wrk, and generates the input for
Expand Down
21 changes: 11 additions & 10 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void {
@panic("Use exactly the Zig release in .zig-version");
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
if (optimize == .ReleaseFast or optimize == .ReleaseSmall) {
if (optimize == .fast or optimize == .small) {
@panic("This MVP requires Debug or ReleaseSafe so its invariants remain enabled");
}
const module = b.addModule("bounded_http", .{
Expand All @@ -19,8 +19,8 @@ pub fn build(b: *std.Build) void {
// Zig 0.16's native ELF linker rejects. Use the bundled LLVM/LLD path
// for Linux Debug only; it matters only when an application links glibc.
const exe = b.addExecutable(.{
.use_llvm = if (target.result.os.tag == .linux and optimize == .Debug) true else null,
.use_lld = if (target.result.os.tag == .linux and optimize == .Debug) true else null,
.use_llvm = if (target.result.os.tag == .linux and optimize == .debug) true else null,
.use_lld = if (target.result.os.tag == .linux and optimize == .debug) true else null,
.name = "bounded-http",
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
Expand All @@ -31,27 +31,28 @@ pub fn build(b: *std.Build) void {
});
b.installArtifact(exe);
const run = b.addRunArtifact(exe);
if (b.args) |args| run.addArgs(args);
run.addPassthruArgs();
b.step("run", "Run the bounded HTTP experiment").dependOn(&run.step);
const compile_only = b.step("check", "Compile the selected target without executing its binaries");
compile_only.dependOn(&exe.step);
const verify = b.step("verify", "Compile and test the exact-version MVP");
verify.dependOn(&exe.step);
const format = b.addFmt(.{ .paths = &.{ "build.zig", "build.zig.zon", "src", "examples" }, .check = true });
const format = b.addFmt(.{ .paths = b.pathList(&.{ "build.zig", "build.zig.zon", "src", "examples" }), .check = true });
verify.dependOn(&format.step);
const version = b.addSystemCommand(&.{ "python3", "tools/check_version.py" });
verify.dependOn(&version.step);
const embedding_prefix = b.pathFromRoot(b.fmt(".zig-cache/embedding-{s}", .{@tagName(optimize)}));
const embedding_build = b.addSystemCommand(&.{ b.graph.zig_exe, "build", b.fmt("-Doptimize={s}", .{@tagName(optimize)}), "--prefix", embedding_prefix });
const embedding_build = b.addSystemCommand(&.{ b.graph.zig_exe, "build", b.fmt("-Doptimize={s}", .{@tagName(optimize)}) });
embedding_build.addArg("--prefix");
const embedding_prefix = embedding_build.addOutputDirectoryArg2("embedding", .{ .make_absolute = true });
embedding_build.setCwd(b.path("examples/embedding"));
const embedding_name = if (target.result.os.tag == .windows) "embedded-http.exe" else "embedded-http";
const embedding_check = b.addSystemCommand(&.{ "python3", "tools/check_embedding.py", "--binary", b.pathJoin(&.{ embedding_prefix, "bin", embedding_name }) });
embedding_check.step.dependOn(&embedding_build.step);
const embedding_check = b.addSystemCommand(&.{ "python3", "tools/check_embedding.py", "--binary" });
embedding_check.addFileArg2(embedding_prefix.path(b, b.pathJoin(&.{ "bin", embedding_name })), .{ .make_absolute = true });
b.step("example-check", "Compile and exercise the independent embedding project").dependOn(&embedding_check.step);
verify.dependOn(&embedding_check.step);
const test_step = b.step("test", "Run unit and transport tests");
for ([_][]const u8{ "src/http.zig", "src/api.zig", "src/budget.zig", "src/transport.zig", "src/server.zig", "src/sys.zig" }) |path| {
const tests = b.addTest(.{ .use_llvm = if (target.result.os.tag == .linux and optimize == .Debug) true else null, .use_lld = if (target.result.os.tag == .linux and optimize == .Debug) true else null, .root_module = b.createModule(.{
const tests = b.addTest(.{ .use_llvm = if (target.result.os.tag == .linux and optimize == .debug) true else null, .use_lld = if (target.result.os.tag == .linux and optimize == .debug) true else null, .root_module = b.createModule(.{
.root_source_file = b.path(path),
.target = target,
.optimize = optimize,
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
.name = .bounded_http,
.version = "0.1.0",
.fingerprint = 0xea644817b8357037,
.minimum_zig_version = "0.16.0",
.minimum_zig_version = "0.17.0",
.paths = .{ "build.zig", "build.zig.zon", ".zig-version", "src", "tests", "tools", "assets", "docs", "examples", "README.md", "AGENTS.md" },
}
2 changes: 1 addition & 1 deletion docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# bounded/http architecture

The server provides bounded HTTP/1.1 processing with explicit ownership of memory and network operations.
The current implementation targets exact Zig 0.16.0.
The current implementation targets exact Zig 0.17.0.
Linux uses `io_uring`.
macOS uses nonblocking sockets and `kqueue`.
Windows uses overlapped sockets and an I/O completion port (IOCP), which delivers operation results to the owner.
Expand Down
2 changes: 1 addition & 1 deletion docs/INTERFACES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Module contracts

Exact Zig 0.16.0. The maintained parser, server, writer and platform adapters
Exact Zig 0.17.0. The maintained parser, server, writer and platform adapters
share the ownership contract in [OWNERSHIP.md](OWNERSHIP.md).

## HTTP parser
Expand Down
2 changes: 1 addition & 1 deletion docs/OWNERSHIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This describes the current [server](../src/server.zig),
[application API](../src/api.zig), [parser](../src/http.zig) and
[transport selection](../src/transport.zig), using exact Zig 0.16.0. It is an
[transport selection](../src/transport.zig), using exact Zig 0.17.0. It is an
experimental execution contract, informed by the [evidence inputs](EVIDENCE.md).
The [module contracts](INTERFACES.md) describe the low-level interfaces.

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The reader vendors Marked, DOMPurify, and Highlight.js.
[The vendor manifest](vendor/manifest.json) pins package versions, archive integrity, and extracted file hashes.
Adjacent license files preserve each dependency's license terms.
The site uses no external script or stylesheet service.
The Zig highlighting rules follow the exact 0.16.0 tokenizer keywords.
The Zig highlighting rules follow the exact 0.17.0 tokenizer keywords.

## Project names

Expand Down
16 changes: 8 additions & 8 deletions docs/USING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Using bounded/http

Use the exported `bounded_http` module to embed the framework in a Zig application.
Use exact Zig 0.16.0, as specified by [.zig-version](../.zig-version).
Use exact Zig 0.17.0, as specified by [.zig-version](../.zig-version).
The framework has Linux, macOS, and Windows transport adapters.
The [Windows receipt](../reports/2026-09-06-windows-iocp.md) records native verification and its exclusions.

Expand All @@ -20,12 +20,12 @@ Run these commands from the repository root:

```sh
zig version
zig build verify -Doptimize=ReleaseSafe
zig build -Doptimize=ReleaseSafe
zig build verify -Doptimize=safe
zig build -Doptimize=safe
./zig-out/bin/bounded-http --port 8080 --connections 128 --shards 1
```

The version command must print `0.16.0`.
The version command must print `0.17.0`.
ReleaseSafe preserves assertions and runtime safety checks.
The project also supports Debug.
The build rejects ReleaseFast and ReleaseSmall.
Expand All @@ -40,7 +40,7 @@ Windows defaults to one shard.
Use `--shards 3` to select three independent IOCP owners with one bounded socket distributor.
Only inline execution supports multiple shards.
The [handoff guide](ARCHITECTURE.md#windows-socket-handoff) explains ownership, resource bounds, and shutdown.
Use native x64 Zig 0.16.0 for the maintained Windows gate.
Use native x64 Zig 0.17.0 for the maintained Windows gate.

The server prints `READY` to stderr after preparing its resources.
Request `/plaintext` for the fixed 13-byte `Hello, World!` response.
Expand Down Expand Up @@ -85,8 +85,8 @@ Run the independent example from its directory:

```sh
cd examples/embedding
zig build -Doptimize=ReleaseSafe
zig build run -Doptimize=ReleaseSafe -- --port 8081 --duration-ms 30000
zig build -Doptimize=safe
zig build run -Doptimize=safe -- --port 8081 --duration-ms 30000
```

The example replies to GET and HEAD requests on any path.
Expand Down Expand Up @@ -517,7 +517,7 @@ CPU accounting fields remain `null` where the Windows client cannot measure them
| Tool or suite | Purpose |
| --- | --- |
| `zig build verify` | Check the compiler version, formatting, executable, and registered Zig tests. |
| `zig build check -Dtarget=x86_64-windows -Doptimize=ReleaseSafe` | Cross-compile the Windows executable and Zig tests without running them. |
| `zig build check -Dtarget=x86_64-windows -Doptimize=safe` | Cross-compile the Windows executable and Zig tests without running them. |
| [integration suites](../tests) | Exercise framing, bounds, partial progress, batches, cancellation, and shutdown. |
| [smoke.py](../tools/smoke.py) | Run a finite verified request smoke experiment. |
| [benchmark.py](../tools/benchmark.py) | Check response bodies while measuring a supplied endpoint. |
Expand Down
2 changes: 1 addition & 1 deletion docs/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<a class="brand" href="whitepaper.html">bounded/http<small>ENGINEERING DOCUMENTATION</small></a>
<nav aria-label="Documents"><a href="whitepaper.html">Whitepaper ↗</a><a href="read.html?file=docs/ARCHITECTURE.md">Architecture</a><a href="read.html?file=docs/USING.md">Integration guide</a></nav>
<nav id="contents" aria-label="On this page"></nav>
<p class="rail-note">ZIG 0.16.0<br>LINUX + MACOS + WINDOWS</p>
<p class="rail-note">ZIG 0.17.0<br>LINUX + MACOS + WINDOWS</p>
</aside>
<main>
<header class="topline"><span id="file-name">DOCUMENTATION</span><div><a id="raw" hidden>Raw file</a><button id="print" type="button">Print</button></div></header>
Expand Down
6 changes: 3 additions & 3 deletions examples/embedding/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ pub fn build(b: *std.Build) void {
});
const executable = b.addExecutable(.{
// Linux Debug needs LLVM/LLD for the installed GCC CRT relocations.
.use_llvm = if (target.result.os.tag == .linux and optimize == .Debug) true else null,
.use_lld = if (target.result.os.tag == .linux and optimize == .Debug) true else null,
.use_llvm = if (target.result.os.tag == .linux and optimize == .debug) true else null,
.use_lld = if (target.result.os.tag == .linux and optimize == .debug) true else null,
.name = "embedded-http",
.root_module = module,
});
b.installArtifact(executable);
const run = b.addRunArtifact(executable);
if (b.args) |args| run.addArgs(args);
run.addPassthruArgs();
b.step("run", "Run the bounded embedding example").dependOn(&run.step);
}
2 changes: 1 addition & 1 deletion examples/embedding/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.name = .http_embedding,
.version = "0.1.0",
.fingerprint = 0x2b518a77c650986d,
.minimum_zig_version = "0.16.0",
.minimum_zig_version = "0.17.0",
.dependencies = .{
.bounded_http = .{ .path = "../.." },
},
Expand Down
Loading
Loading