Skip to content

Releases

stdx 0.2.0

Choose a tag to compare

@c4milo c4milo released this 20 Nov 02:35

A MINOR release (decision 65): platform.Cpu gains two fields, and every encoder writes the octets 0.1.2 wrote.

Changes since 0.1.2

MINOR: two new fields of platform.Cpu (352fec3, decision 40)

pub const Midr = struct { implementer: u8, variant: u4, architecture: u4, part: u12, revision: u4 };
pub const Cpu = struct { ..., sha3: Answer, sve2: Answer, ..., vaes: Answer, midr: ?Midr };
  • sve2: whether the CPU has Arm's FEAT_SVE2. On aarch64 Linux it comes from AT_HWCAP2 bit 1 (HWCAP2_SVE2), and on macOS from hw.optional.arm.FEAT_SVE2, which macOS 26 does not define, so a Mac answers not_known. x86-64 answers no.
  • midr: the fields of MIDR_EL1 of the core where the probe ran. A caller tells a core by its implementer and part: Arm's Neoverse N2 is implementer 0x41, part 0xd49. On aarch64 Linux the probe runs mrs where AT_HWCAP has HWCAP_CPUID, and the kernel emulates the read, so the probe opens no file and makes no syscall. It is null on x86-64, on macOS, and on Linux without HWCAP_CPUID.
  • A caller that builds a Cpu literal itself must now name both fields.
  • On the hosted aarch64 runner, the probe and /proc/cpuinfo both read implementer 0x41, part 0xd49 and SVE2 (CI run 44650971945).

PATCH: the DEFLATE decoder

  • The decoder's x86-64 fast path copies three chunks before it branches on a plain match's length (7acc3c8). Design §8 holds its measurements.

stdx 0.1.2

Choose a tag to compare

@c4milo c4milo released this 16 Nov 23:27

A PATCH release (decision 65): no public name, parameter or size changed, and every encoder writes the octets 0.1.1 wrote.

Changes since 0.1.1

  • The base64 decoder keeps its options as whole octets (847345c). Zig 0.16 stores a field narrower than an octet at its own width but loads it as an octet, and LLVM forwards no such store to a load. A decode with a nonzero option, such as pad_bits at .drop, then read its options from memory. Where a caller inlines the decode, the options now fold to constants (decision 68). Instructions a decode of 128 octets, .refuse then .drop, callgrind, ReleaseFast:

    CPU 0.1.1 0.1.2
    aarch64 934, 950 934, 933
    x86-64-v2 1,406, 1,407 1,403, 1,395
    x86-64-v3 880, 883 880, 873
  • The pin of pepegrillo, the build tooling, moves to 10841b3 (f498f46). The library does not import it.

One fine point: base64.Accept, base64.Padding and base64.PadBits now have a u8 tag, so @intFromEnum of one gives a u8.

stdx 0.1.1

Choose a tag to compare

@c4milo c4milo released this 15 Nov 17:25

A PATCH release (decision 65): nothing a dependent can see changed, and every encoder writes the octets 0.1.0 wrote.

Changes since 0.1.0

  • base64.Decoder.init is an inline fn (6d07da3), so options known at compile time are constants. A decode of 128 octets with pad_bits at .drop took 1,165 instructions on aarch64 and now takes 1,151; the default keeps 1,154 (decision 68).

One fine point: Zig takes no address of an inline fn, so code that stored &base64.Decoder.init as a function pointer no longer compiles.

stdx 0.1.0

Choose a tag to compare

@c4milo c4milo released this 15 Nov 13:48

The first release of stdx: compression codecs and JSON for Zig 0.16.0, written from the RFCs. No module allocates or performs I/O; the caller owns every state and buffer, and every call streams and resumes.

What 0.1.0 holds

Module What it holds
deflate, zlib, gzip RFC 1951, 1950 and 1952: decoders, and encoders at levels 1, 6 and 9
zstd RFC 8878 and RFC 9659: a decoder, and an encoder at levels 1 and 3
brotli RFC 7932: a decoder, and an encoder at levels 1 and 5
checksum CRC-32, Adler-32 and XXH64
json RFC 8259 and RFC 7464: an encoder, a pull decoder, and text sequences
base64 RFC 4648's base 64: an encoder and a decoder
platform What the CPU offers, probed once when a program starts
codec The streaming contract every codec shares

Each codec's decoder also sits behind std.Io.Reader, and each encoder behind std.Io.Writer (decision 56).

What the number promises

Decision 65: SemVer 2.0.0. Before 1.0.0, MINOR goes up for any change a dependent can see: a public name, a call's parameters or error set, a state size that grows, the minimum Zig version, or one octet of any encoder's output. PATCH goes up for everything else.

Known limits

  • brotli's level 5 writes more octets than Google's quality 5 on 24 of the 39 corpus rows; its median row is 1.005 of quality 5's size. The work goes on in #8.
  • The published benchmark of design §8 step 15 is not written yet.

Corpora mirror

Choose a tag to compare

@c4milo c4milo released this 29 Sep 08:23

A mirror of two corpora decision 15 names as test data, fetched by zig build -Doracles and never linked into the library:

Both copies came through the Internet Archive on 2026-09-29, after canterbury.ac.nz put its site behind a bot-management rule that turns Zig's fetch away. build.zig.zon pins each by the hash above, so a copy that differs from the original in any file is refused.