Tests
internal/wlgentests the generated signatures and checks, then builds a registry client from the vendored protocols and, when a Wayland compositor is running, runs it.internal/vkgentests declaration parsing, extension enum values and the selection format, checks the shape of the generated bindings, and renders a rounded, bordered quad offscreen with the quad shaders through the bindings and dynamic rendering, comparing pixels. It skips without libvulkan or a Vulkan 1.3 device.internal/shaderschecks that the SPIR-V matches the recorded source sums and validates it withspirv-valwhen installed.internal/hottests reload against running programs:- state kept across a code swap;
- functions added;
- compile errors leaving the program running;
- heap data surviving a reload while the collector runs;
- stored function values, closures and callbacks running patched code;
- instances of an edited generic function patched;
- restarts on layout, signature and capture changes.
cmd/lowcompiles each of these twice in one process and requires identical SSA form and assembly:- each benchmark, for release, dev and Windows;
- every
testdata/runprogram except thestd_ones, for release; std_otel_export, for release, dev and Windows;- every
testdata/windowsprogram, for Windows.
cmd/lowfuzzgenerates well-typed, terminating programs from a choice stream (internal/fuzz/gen), predicts their output with a reference interpreter (internal/fuzz/model), compiles each for release and dev, runs both, and reports any of these (internal/fuzz/oracle):- compiler panic;
- rejected program;
- link failure;
- timeout;
- release/dev difference;
- difference from the prediction.
The generator covers every integer width,
f32andf64, shifts, conversions,ifexpressions, functions, andforloops with labelledbreakandcontinue. Float values are observed through clamped integer conversions and NaN comparisons.internal/fuzz/reduceminimises each new signature. It removes functions, parameters and statements, unwrapsifand loop bodies, replaces expressions with literals or their operands, and shrinks literals, keeping only candidates that still produce the signature.-reduce-testsbounds the compiler runs.- The minimised program is saved under
-out, one per distinct signature. - With
-fixturesit is also written there as atestdata/runfixture (.lowwith the predicted.outand.err, named by content hash) that fails until the bug is fixed.
- The minimised program is saved under
go test ./...also compiles everytestdata/run/*.lowand every program directory intestdata/run, runs it with a one-minute limit, compares stdout with.outand stderr with.err, and checks peak memory against.maxrssin KB when present.- A program with a
.neededfile must link exactly those shared libraries. Every other program must be static with no interpreter. - Each
testdata/fail/*.lowfile or directory must fail to compile with the message in its.err, with file paths shown relative to the fixture.
- A program with a