The tools are renamed after their input and output: zi2zx lowers source
or ZIR to executable ZX, zx2native turns ZX into a native ELF, zx2wasm
into a wasm32 module, and zi2c, zi2go and zi2zir keep their roles under
cmd/ folders of the same names. zi2asm and the cmd/zir-* folders are
gone, and tests/tool_names.sh keeps the old names out. zx2native keeps
the direct encoder as its default; the machine pipeline replaces it once
it reaches parity.
The embedding API can run a verified bundle as x86-64 machine code in
memory. Code is written to RW pages, relocated, then switched to RX,
never RWX, and each instance gets its own data
(cmd/zir/zir_native_memory.c, zir_host_native.c). Backend selection is
BundleBackendPolicy: Engine and Native are strict, and Auto chooses by
platform only, never by whether one program fits. A native gap is a
named error, never a switch to the engine. Desktop x86-64 Auto stays on
the engine until the native backend is complete.
cmd/compiler_machine_image.zi adds the target-neutral machine image
contract. The machine verifiers reject unknown relocation kinds,
out-of-range symbols and addends, non-host external calls, native-width
mismatches and missing stack or fuel facts. The machine pipeline lowers
and encodes more of LIR. Docs, site pages, Kryon's build references and
the benchmarks use the new names.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
zi2zx bundle and ziran run always write and run revision-28 executable
ZX. The semantic bundle reader and writer, the portable VM, the
TinyCC-compiled and linked native bundles with the vendored TinyCC,
bundle libraries, the VM profile, --vm, BundleInstantiatePortable,
libziran-vm.a and the ZIR-based Wasm lowering with zi2wasm are removed;
the Wasm tier, the embedding API and every tool run revision 28. Tests
of the removed VM internals and libraries are removed, and the rest run
on revision 28. Engine problems read as the diagnostics users rely on.
Portable standard facades for byte text, environment, timers, randomness,
mapped files, streams, worker pools, directory trees and threads; full ASCII
lowercase in std/unicode; examples move to examples/ with generated site
pages; Go output handles mixed-width slice bounds.
Prepare short portable helpers and scalar record reads, improve JSON SIMD scanning, expose one-line execution, and publish qualified Alpha benchmark artifacts. Add the experimental verified lowered execution, serialization and Linux x86-64 backend with source maps.
Physically remove 263 redundant test entry points and unused helpers, migrate retained helpers to Ziran, and execute the full retained suite without sharding. Allow ignored backup state for the managed physical Alpha workflow.
Local validation: all 268 retained tests passed across the full run and corrected targeted reruns; bootstrap matches. Current assembly verifier, x86-64, executor and serializer tests passed. Website examples and all 4661 local links passed. Six Alpha JSON/text workloads retain verified artifacts, raw samples and explicit unsupported Wasm diagnostics. The mobile sub-500 ns target remains pending.
u8xN .. f64xN hold two 128-bit blocks in a #target procedure's AVX2 clone
and in AVX2 builds, and one in base C, other clones, Go, TinyCC and the
VM. Simd.Lanes(T) and Simd.Blocks(T) give the count: a constant for fixed
vectors, the tier's width for native ones. Per-block operations work on
each block; WidenLow/High, MulWideLow/High and Narrow number lanes across
the vector; Make and Splat repeat one block.
Native vectors stay plain values: the checker rejects them in globals,
fields, arrays, pointers, slices, size_of, #foreign signatures and across
#target boundaries. tests/simd_native.sh checks that every compiler,
width, forced tier, Go, bundle and VM run gives the same hash, and that
Blocks reports the width each build picks.
The ARMv7, AArch64 and WebAssembly row kernels move from #asm to std/simd,
making the same bytes. Each tap's bytes widen to 32 bits and take its whole
weight; the horizontal kernel takes four taps a step and walks pointers with
32-bit counts, which ARMv7 and wasm32 keep in one register.
On a Cortex-A53 (ARMv7) resizes run 3 to 10% faster than the assembly, and
under wasmtime about twice as fast.
ziran_simd.h: Clang's ARMv7 backend copied an unaligned 8-byte load that it
merged into a widening through the stack; Simd.LoadLow now keeps it one
vld1.
tests/lanczos_isa_bitexact.sh runs the WebAssembly modules standalone with
WASI_RUN (such as wasmtime run), without JavaScript.
An odd tap after earlier ones is the high half of the 8 bytes ending there,
so one load replaces four byte reads, and the AVX2 kernel carries the
rounding in its 256-bit accumulator. The 1.5x AVX2 upscale that ran 9%
slower than the old assembly now runs 2% faster, with the same bytes.
getcwd, readlink, read, write, bcopy, mempcpy, poll and curl_ws_recv took u64
or s64 for size_t, ssize_t and nfds_t values. On wasm32 that linked with a
function signature mismatch and trapped when called. A check now reads std's
bindings for these functions, and another builds file_tree_linux for wasm32.
std/simd helpers below AVX2 take 256-bit vectors by pointer and run them
as two 128-bit halves, so no helper passes a 32-byte vector by value
(no -Wpsabi note) and GCC no longer scalarizes generic 256-bit operations.
Halves come from a 16-byte aligned union: memcpy went through the stack,
and an under-aligned union made GCC 14 fold misaligned memory operands
into SSE instructions (an internal compiler error).
Faster lowerings: NEON single-instruction reductions, x86 lane-swap
reduction trees and SSE4.1 phminposuw, pmuludq/pmuldq MulWide,
saturating Narrow from unsigned and 32-bit sources, AddPairs, MulAddPairsSat,
SSE2 Abs, u16 Min and Max, AVX2 16-bit ShiftLanes, and WebAssembly
MulHighRound.
Sign(a, b) and AbsDiff(a, b) have C (SSSE3 psign, NEON vabd, SIMD128),
Go, VM and scalar versions.
zi_ref fixes found on ARMv7: f32 arithmetic uses the exact scalar path
because NEON flushes subnormals, and the byte-shift loop is flat because
NDK Clang 19 miscompiled the nested one. zi_ref is marked unused for
programs that never take a scalar path.
StringRaw, BytesNil, the ed25519 seed, sign and verify calls, json
ValidRaw, net ParseRaw and hmac Sum256 only read their string and byte
arguments during the call, so Text passed to them is freed.
The SSE2 and AVX2 #asm row kernels are now #target std/simd procedures
that make the same bytes as the scalar reference. The 128-bit kernels run
in each SSE2 to SSE4.1 copy; the AVX2 kernels take eight weight pairs a
step. On a Ryzen 9 9950X, summed over four sizes, the AVX2 horizontal
pass is about 11% faster than the assembly with GCC and 12% with Clang,
up to 23% on large downscales, and the vertical pass is unchanged. The
128-bit kernels are about 6% faster with GCC and 15% with Clang. NEON and
WebAssembly SIMD128 keep their #asm kernels. tests/lanczos_isa_bitexact.sh
also runs the SSE2, SSSE3 and SSE4.1 copies. ziran_simd.h now silences
Clang's -Wpsabi warnings too.
TextReplace, TextJoin, TextLower, TextHex, Float64Repr, the JsonWrite
family, JoinPath, ResolvePath, WorkingDirectory, CreateTemporaryDirectory,
CopyText, ReadStandardInput, DecodeReplace and the unicode case transforms
now return Text. Callers written for a string still get one; a caller that
keeps the result as Text frees it with its owner. 1000 rounds of four
producers leave 4000 allocations when used as strings and none as Text.
u8x16, s8x16, u16x8, s16x8, u32x4, s32x4, u64x2, s64x2, f32x4 and f64x2,
and their 256-bit forms, are builtin value types laid out as lane arrays.
Simd.Op calls through an import of std/simd check their operands and
constants, and become reserved zi_simd_* calls in saved IR; operators on
vectors are rejected. include/ziran_simd.h holds the exact lane semantics
every backend follows.
A Text call result stays owned in a declared, assigned or returned Text,
a Text parameter, element or field, and a discarded statement, which
frees it. Elsewhere the checker rewrites it into vec.TextDetach(result),
a string that keeps its bytes as BuilderFinish strings do, so callers
written for string results keep working. BuilderFinish in an owning
position becomes vec.TextFromBuilder. Dotted module_name.Procedure names
resolve, as types already did, through modules reached only by other
imports, in the checker and in generated C.
Text is a record whose one field is bytes: Vec(u8), so it moves and drops
like any Vec-owning record. TextView borrows a Text place, a Text place
used where a string is expected lends the same view, and TextCopy copies a
string into one. The lifetime checker also rejects moving owned storage
while its view is live. Existing string APIs are unchanged.
ThreadRun marks the record once the notification has returned, and on
macOS ThreadFinished joins only after that, so a join waits for nothing
but the thread's exit and thread-local destructors. Linux and Android
keep their nonblocking joins. Native C builds define POSIX_THREADS on
macOS too, so any program importing std/thread_linux failed to link
there. modules.html also picks up std/resample's ARMv7 summary.
The horizontal and vertical Lanczos/bicubic/box rows get arm+neon
variants, chosen once from the kernel's hardware capabilities, that make
the scalar loops' bytes. A32 has too few registers for every argument,
so the kernels read theirs from a small record.
tests/lanczos_isa_bitexact.sh runs the ARMv7 build on the device that
ARMV7_ADB_SERIAL names, as well as under QEMU_ARM, and requires NEON there.
Allocation-free axis weights, row kernels and a two-pass plan over
premultiplied RGBA with fractional source boxes and row ranges for worker
threads. tests/lanczos_isa_bitexact.sh checks every kernel against the
scalar loops and those against std/image on x86-64, AArch64 and ARMv7.
ziran edit previews and applies checked source edits, and ziran compact and
expand give .zi files a lossless compact transport. Diagnostics bound each
message and report truncation. The standard library adds Unicode 17 NFC,
lowercase and properties, owned JSON documents with Into accessors and
erasers, file identity snapshots, 32-argument process channels with optional
stderr discard, socket write shutdown, longer Curl header values and fallible
image resampling. Checks cover the new APIs, and stale tests now match the
bounded diagnostics, the 4 ms kernel timestamp tick and the check runner.
std/vorbis reads a stream's channels, rate and length from its pages and
identification header, without decoding or a library, so a program can
bound a stream before any decoder allocates for it. VorbisDecode probes
first and decodes only streams whose library totals match the probe.
std/vorbis_linux decodes one whole Ogg Vorbis stream to 16-bit PCM with a
frame limit, refusing truncated, chained or damaged streams and trailing
bytes. Its records mirror the Xiph headers, and a guard after the decoder
state is checked on every call. Only programs that import it link the
library. tests/vorbis_linux.sh compares with ffmpeg's decode and the
headers' record sizes; CI installs ffmpeg and libvorbis-dev for it.
StartProcess changed into `directory` first, so a relative output_path
resolved under the child's folder: Wurm's private UI test asked for
build/research/ui/app.log from build/ and failed to start on a fresh
checkout (it only passed where a stale build/build/ existed). Input,
output and error now open relative to the caller, as the options
document, and std_tools_linux.sh checks it.
CropImage, FlipLeftRight, RotateHalf and RotateRight match Pillow's crop and
transposes, and AlphaBounds gives getchannel("A").getbbox(), so art tools
that crop atlas cells and turn sprites need no Pillow.
AlphaCompositeAt draws at a fractional position, blending the pixels it
falls between as a canvas's drawImage does; Silhouette fills a picture's
shape with one colour. Shovey's art outlines are drawn with both.
std/image holds RGBA pictures and resizes (nearest, box, Lanczos),
composites, pastes, rotates and quantizes them with Pillow's arithmetic,
so tools give the same pixels Pillow gave. std/png_linux reads every
standard PNG and writes RGBA, RGB and palette files, std/jpeg writes
baseline JPEGs, and std/zlib_linux handles whole zlib, gzip and raw
deflate streams.
std/json_document reads a document into a tree that programs query,
change and write back. JsonWrite lays the text out as Python's json.dumps
does for the same indent, separators, ensure_ascii and sort_keys, so
native tools can rewrite JSON files Python wrote without changing their
bytes.