Repository navigation
Conversation
Every change here is one the 0.17.1 compiler refuses to build without: - std.lang.Optimize renamed its tags: .Debug / .ReleaseSafe become .debug / .safe in build.zig. - Run steps forward `zig build -- args` with addPassthruArgs (the b.args loop is gone): the `run` and `lint` steps. - Array repetition `x ** n` is removed: a repeated fill is @Splat (36 sites, all single-element fills of locals buffers, StackFrame and monitor tables, regex bitsets; the ffi signature tests build their arrays with @as([N]Type, @Splat(..))). - std.heap.stackFallback is gone; std.heap.BufferFirstAllocator takes a caller-owned buffer (vm op_make_fn, BigDecimal printing, the component call scratch). - @typeinfo's Struct / Enum carry parallel field_names / field_types / field_values slices instead of .fields; std.meta.fields is a compile error. Reflection sites read the new slices. - std.meta.Int is @int; Allocator.dupeZ is dupeSentinel(.., 0). - std.http.Method gained QUERY; the Ring :request-method switch maps it to :query (0.16's std could not parse a QUERY request at all). Smell-audited: 1: mechanical stdlib migration, no behaviour change beyond the new QUERY tag the exhaustive switch now names
0.17.1's langref marks @intFromEnum and @enumFromInt deprecated in favour of @backingInt and @fromBackingInt; std.builtin is a deprecated alias of std.lang, and std.ArrayListUnmanaged of std.ArrayList. All three still compile, so this is the finished-form step, kept apart from the compile-error port: 348 @intFromEnum, 55 @enumFromInt and 2 std.builtin sites renamed token for token, one ArrayListUnmanaged. @fromBackingInt takes exactly the backing integer, where @enumFromInt narrowed implicitly, so the seven sites that passed a wider index (a usize loop counter or a u8 phase byte) now @intcast it. Smell-audited: 1: mechanical rename of deprecated builtins, no behaviour change
minimum_zig_version moves to 0.17.1. zlinter moves from its 0.16.x branch to the head of 0.17.x (e1f92a11), still lazy. zwasm returns to an upstream tag, zwasm/zwasm v2.12.1, peeled to db8a51b4 (user direction 2026-12-01), from the BuddhiLW fork at 787bf6c9. v2.12.1 needs Zig 0.17.1. The dated comment says which fork patches upstream carries and which two (fork PR #2, PR #3) it may not; this pin is the experiment that measures them. Both hashes come from `zig fetch` under 0.17.1. Smell-audited: 0: version pins only
versions.lock ZIG_VERSION, the download URLs, cache keys and directory names of ci, release, mutation and bench-vs-bb, flake.nix's zig-overlay package, and flake.lock's zig-overlay moved to a revision that carries 0.17.1 (6f4392dd).
The places that state the toolchain as a fact move to 0.17.1: the README badge and build line, ROADMAP's opening, CLAUDE.md, CONTRIBUTING and three script headers. Historic prose (ADR text, the 0.16 migration notes, measured-with lines) stays as written. CHANGELOG records the toolchain move, the zwasm pin and the new :query request method.
0.17.1's `zig fmt` rewrites the deprecated @intFromEnum to @backingInt; the two wasm32 cpu-feature sites in build.zig were the only ones the src rename did not cover. `zig fmt --check src build.zig build-lint.zig` is now clean. Smell-audited: 0: formatter output only
zwasm v2.12.1 resolves `map<k, v>` (#611) as WitType.map, where v2.7.0 refused it as an unsupported type; it is the only change in the v2.7.0 to v2.12.1 embedding API that the cljw build trips on. The three exhaustive switches over WitType now name it: - the introspection printer writes `map<k, v>`; - the resource scan looks inside the key and value; - `lower` refuses a map param with feature_not_supported, because ADR-0135 has no Clojure shape for it yet. A map RESULT lifts as zwasm despecialises it, a list of tuples, with no change here. Smell-audited: 1: exhaustive switches extended for a new upstream variant; the param side fails loudly rather than guessing a shape
…_files The 0.17.x branch replaced the single `include` list with directory and file lists; src is a directory, build.zig and build-lint.zig are files. Same lint scope as before.
zwasm v2.10.0 (#597) makes the interpreter refuse, at instantiation, a module holding an op it does not execute; before, a SIMD body trapped as `unreachable` only when called. Two zig tests and two clj tests loaded the SIMD fixture on :interp to call its GPR export and failed with InstantiateFailed. The gap they lock is unchanged (SIMD stays JIT-only), only where it surfaces moved, so each now asserts it where it now is: - engine.zig: a GPR-only module (`gpr_only_wasm`, the `add` export alone) carries the interp side of the jit==interp check and the exportSig cache test; the SIMD module is asserted to be REFUSED on :interp, and the test still fails if zwasm ever runs interp SIMD. - wasm_engine_select_test.clj: the interp GPR calls and `wasm/engine` load bench/wasm/ffi/add.wasm; `simd-interp` asserts the load throws. Smell-audited: 1: tests follow an upstream behaviour change (trap at call to refusal at load); no assertion weakened, the SIMD gap is still locked
…ches Operator decision 2026-12-01, after the upstream-tag experiment. On the bare upstream tag v2.12.1 (db8a51b4) wasm_thread_hop_test fell to 12 of 14 and a JIT call cost 1415 ns on a tiny module against 5172 ns on the 47 KB one: the two fork-only patches are not upstream. Fork `main` at 7f21a997 (fork PR #11) is upstream main 25c9eb963 plus fork PR #2 (per-thread native-stack limit, upstream zwasm/zwasm#791, fixes #695), fork PR #3 (by-name invoke from CompiledWasm.exports, upstream zwasm/zwasm#792) and FORK.md. The dated pin comment records the experiment and when the pin returns to an upstream tag. The hash comes from `zig fetch` under 0.17.1. Smell-audited: 0: version pin and its history comment
The two perf PRs were written for Zig 0.16. Ported here: their new @intFromEnum / @enumFromInt sites become @backingInt / @fromBackingInt (gc_heap_test, gc_types), and the AllocRecord alignment test's usize loop counter is @intcast to Alignment's Log2Int backing type, which @fromBackingInt requires exactly. gc_heap_test's conflict takes staging's side (the record now reads `allocation.size`). CHANGELOG keeps both sets of [Unreleased] entries. Smell-audited: 1: forward merge plus the mechanical 0.17 port of the merged code
`zig build lint` never ran under 0.17.1 before this: the delegated step passed `--build-file build-lint.zig`, and 0.17.1's build runner resolves a bare basename to the default build.zig, so `lint` invoked itself without end (thousands of build processes). `./build-lint.zig` fixes it. zlinter's 0.17.x branch then reported 199 findings, none a behaviour change; zwasm cleared the same classes in its own move (a06968705): - no_deprecated (175): std.fmt.allocPrint(A, ..) -> A.print(..) (Allocator.print, 74), std.fmt.bufPrint -> std.mem.print (82), std.mem.indexOf / indexOfScalar / indexOfPos / indexOfScalarPos -> find / findScalar / findPos / findScalarPos (14), std.fs.path -> std.Io.Dir.path and resolvePosix -> resolveAllocPosix (6), b.lazyDependency -> b.dependencyLazy with its LazyDependencyNeeded arm. - no_unused (17): private aliases and imports nothing reads, and JavaArray.Kind.default, a fn nothing calls. - no_empty_block (5): the empty `if` / `else` arms in mvn_fetch and big_decimal say why they are empty. `zig build lint -- --max-warnings 0` is clean. Smell-audited: 1: deprecated-alias renames, dead declarations removed, empty arms documented; no behaviour change
…zig-0.17.1 #133 was written for Zig 0.16. Ported here: transducer.zig's @intFromEnum / @enumFromInt become @backingInt / @fromBackingInt, and the two `Kind` decodes of an i64 capture take @intcast, since @fromBackingInt wants the exact backing integer. data/placement.yaml takes staging's (gen_placement.sh shows no drift under 0.17.1). native_transducer_test: 14 tests, 158 assertions, 0 failures on vm. Smell-audited: 1: forward merge plus the mechanical 0.17 port of the merged code
Zig 0.17.1's std.process.currentPathAlloc returns a NUL-terminated `[:0]u8`, one byte longer than its slice. cwdAlloc declared `[]u8`, so `rt.gpa.free(cwd)` released len bytes of a len+1 allocation and the debug allocator aborted the process (`free of len 74 mismatches allocation of len 75`): .getAbsolutePath / .getCanonicalPath on a relative path, caught by test_clj_suites (java-io-family-test). The return type now keeps the sentinel, so free sees the real length. Smell-audited: 1: return type follows the 0.17 std signature; fixes an allocator-length mismatch the port introduced
release_deps: `zig build` in 0.17.1 no longer takes --global-cache-dir (it failed with "unrecognized argument"); the cold global cache is now handed over through ZIG_GLOBAL_CACHE_DIR, with the same --system and --cache-dir isolation as before. fractal_kernel: the gate rebuilds kernel.wasm and kernel_simd.wasm from the recipe in kernel.zig's header and requires the committed files to match byte for byte. The committed files were built by Zig 0.16.0, and 0.17.1's codegen differs (scalar 3187 to 3206 bytes, simd128 3319 to 3300), so the recipe, not the kernel, changed. Both are regenerated from that exact recipe under 0.17.1, and the header names 0.17.1. The golden frames are untouched and still reproduce on all 8 engines with the new artifacts; kernel_c.wasm (zig cc) is byte-identical under 0.17.1 and stays as committed. The expectation "committed artifact == the header recipe's output on the pinned Zig" is the gate's own rule, so moving the pin moves the artifacts with it.
No textual conflicts. build.zig.zon takes staging's version 1.15.9 and keeps this branch's minimum_zig_version, zlinter and zwasm pins. CHANGELOG keeps staging's [1.15.9] section unchanged and its Unreleased entries; the auto-merge had folded this branch's four Zig 0.17.1 / zwasm v2.12.1 entries into [1.15.9], so they are moved back under Unreleased, since they did not ship in 1.15.9. The incoming regex (#139, #142) and require (#141) code uses no API 0.17.1 removed or deprecated, so it builds unchanged: the 0.17 rename pass over src touches nothing, `zig fmt --check` is clean, and the -Dwasm ReleaseSafe build is green. All 171 clj suites pass (1006 tests, 5420 assertions). Smell-audited: 0: merge only; build.zig.zon takes staging's version, no Zig source changed by the resolution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What moved
minimum_zig_version, the ci / release / mutation / bench-vs-bb workflows,.github/versions.lock,flake.nixandflake.lock(zig-overlay with 0.17.1), README, ROADMAP, CLAUDE.md, CONTRIBUTING and three script headers all name 0.17.1.0.16.xbranch to the head of0.17.x(e1f92a11), still lazy.mainat 7f21a997 (fork PR v1.13.2 — clj-parity: munge/demunge $, slurp on *in*, stack-element-str #11). That is upstream zwasm v2.12.1 (main 25c9eb963) plus the two fork patches upstream does not carry yet, tracked upstream as interp: the native-stack limit is the calling thread's, cached per thread, not on the Runtime zwasm/zwasm#791 (the interpreter's native-stack limit is the calling thread's, fixes #695) and jit: a by-name invoke resolves the export from CompiledWasm.exports, not by re-parsing the module zwasm/zwasm#792 (a by-name JIT invoke is served fromCompiledWasm.exports). The pin returns to an upstream tag once both merge and a tag carries them.The migration is mechanical. No behaviour changes except the three listed under "Visible changes".
Do not merge before #138
This PR must not be merged before the release PR #138 (staging to main, v1.15.9) lands. I will not merge it; the coordinator lands it.
Zig 0.16 to 0.17 API classes hit
.Debug,.ReleaseSafe.debug,.safe(std.lang.Optimize)if (b.args) |a| addArgs(a)addPassthruArgs()[_]T{x} ** n@splat(x)(**removed)std.heap.stackFallback(n, a)std.heap.BufferFirstAllocatorwith a caller-owned buffer@typeInfo(T).@"enum".fields,std.meta.fieldsfield_names/field_types/field_valuesstd.meta.Int@IntAllocator.dupeZdupeSentinel(.., 0)currentPathAllocreturned[]u8[:0]u8; freeing it as[]u8aborts@intFromEnum,@enumFromInt@backingInt,@fromBackingInt(exact backing width, so 10@intCast)std.builtinstd.langstd.fmt.allocPrint(A, ..),std.fmt.bufPrintA.print(..),std.mem.printstd.mem.indexOf*std.mem.find*std.fs.path,resolvePosixstd.Io.Dir.path,resolveAllocPosixb.lazyDependencyb.dependencyLazyplus itsLazyDependencyNeededarmstd.http.MethodQUERY--build-file./build-lint.zig, orzig build lintinvokes itself without endNo API was removed without an equivalent. zlinter 0.17.x takes
include_dirs/include_filesinaddPaths, and its stricter rules found 17 dead declarations and 5 empty arms, all cleared.The zwasm v2.7.0 to v2.12.1 embedding-API delta touched cljw in two places.
WitTypegainedmap(#611):component.zigprints it and scans it for resources, and a map param is refused withfeature_not_supporteduntil ADR-0135 gives it a Clojure shape. zwasm #597 moved the interpreter's refusal of a SIMD module from call time to load time, so four tests now assert it atwasm/load. The SIMD gap stays locked.Visible changes
:request-method :queryfor an HTTP QUERY request, which 0.17'sstd.httpparses and 0.16's did not.wasm/loadof a SIMD module with{:engine :interp}throws at load (zwasm #597), where the call used to trap.map<k, v>component param throwsfeature_not_supported.Evidence
The zwasm pin was first tried on the bare upstream tag v2.12.1 (db8a51b4). Both fork patches were missing there, and both regressions came back. The fork pin fixes both.
-Dwasm -Doptimize=ReleaseSafe, Linux amd64test/clj/suites/wasm_thread_hop_test.clj:interphops from afuturetrap)bench/wasm_percall.clj, JIT, tiny modulezigcool.wasmThe bench ran n=20000 calls x 7 trials and reports medians; the host load average was 15 to 17.
zig buildandzig build -Dwasm -Doptimize=ReleaseSafeare green.zig build test -Dwasm -Doptimize=ReleaseSafeis green on vm and tree_walk (the full dual-backend diff oracle).test/clj/suitespass: 1000 tests, 5393 assertions, 0 failures. That includes the 11 wasm suites (233 assertions) andnative_transducer_testfrom perf(transduce): native map, filter, remove and take transducer stages (O-111) #133 (158 assertions), which also passes on a tree_walk binary.zig fmt --check src build.zig build-lint.zigis clean, andzig build lint -- --max-warnings 0is clean.bash scripts/gen_placement.shshows no placement drift.bash test/run_all.sh --smoke e2e_phase16_wasm_ffion c3302d4: 18 passed, 0 failed (vm and tree_walk unit tests, zig fmt, zlinter, corpus_regression 5515/5515, accepted_divergences, test_clj_suites, e2e_phase16_wasm_ffi).I did not run the full gate (
scripts/run_gate.sh), per the coordinator brief; CI runs it.