Skip to content

raw-native 0.4.0

Choose a tag to compare

@HarperZ9 HarperZ9 released this 03 Oct 22:21
· 991 commits to main since this release
aaebfc7

raw-native renders a test scene, computes ambient occlusion two ways, and writes a certificate saying whether the fast screen-space estimate held against a ray-traced reference. Version 0.4.0 adds a GPU backend: the whole frame runs on WebGPU, and every GPU frame comes with a second certificate comparing it against the CPU path.

Download and run

File Platform
raw-native-0.4.0-windows-x64.zip Windows 10 or 11, x64. Static runtime, no installer.
raw-native-0.4.0-linux-x64.tar.gz Linux x64 with glibc 2.38 or newer.
raw-native-0.4.0-wasm.zip Browser or Node: the CPU build and the WebGPU build. Also published loose.
sha256sum -c SHA256SUMS
raw_native_cli --out ./out
raw_native_cli verify ./out

In a browser with WebGPU and JSPI (tested in Chrome 154):

const raw = await loadRawNative({ moduleUrl: "raw-native-gpu.mjs", moduleSha256: "<from SHA256SUMS>",
  wasmUrl: "raw-native-gpu.wasm", wasmSha256: "<from SHA256SUMS>" });
const run = await raw.renderAsync({ width: 512, height: 512, gpu: true });
run.gpuCertificate.verdict;   // "verified" when the GPU frame matches the CPU reference

What is new

  • A WebGPU backend in WGSL: triangle setup, rasterization with depth, position, normal and coverage, motion vectors, screen-space AO, ray-traced AO and shading, all as compute passes.
  • --gpu renders on the GPU, renders the CPU reference into cpu/, and writes gpu_certificate.json (raw-gpu-cert/1): coverage agreement, RMSE and maximum error per channel, the frame's own AO verdict against the CPU's, the adapter, both timings, and what the result does not prove.
  • The bounds live in raw/gpu_tolerance.hpp, committed before any GPU code and before any GPU output was seen.
  • The default native build and the CPU wasm build contain no GPU code. There, --gpu exits 4 with an unverifiable certificate.

Checked before release

  • 16 of 16 GPU certificates verified on an NVIDIA RTX 4090 in headed Chrome 154: three frame sizes and five camera views, with and without the ray-traced pass, plus a moving camera. Coverage agrees on every pixel; the largest channel RMSE is 4.2e-5 against a bound of 0.01. The released raw-native-gpu.wasm is byte-identical to the build that produced this evidence.
  • 32 of 32 tests pass with MSVC 19.50 and GCC 13.3, and in CI on Windows and Ubuntu runners. CI also builds the WebGPU module.
  • The default render's certificate.json is byte-identical from the Windows binary, the Linux binary and the CPU wasm build (SHA-256 302c4ec9...). It differs from 0.3.0 only in the renderer version string; every output file hashes the same as in 0.3.0.

Speed on the RTX 4090

Median of 5 renders after one warm-up, milliseconds.

Frame Mode WebGPU, every channel read back WebGPU, frame only CPU, one thread
256 x 256 Full 6.8 4.0 258
512 x 512 Full 14.3 4.4 1,028
1440 x 900 Full 72.7 17.8 4,527
256 x 256 No RT 6.4 0.8 29
512 x 512 No RT 12.0 4.1 118
1440 x 900 No RT 64.4 17.4 527

Wall times inside the module, one machine, one browser. Raw runs: evidence/webgpu-rtx4090-chromium.json.

Limits

One built-in scene. One GPU, driver and browser measured. Agreement with the CPU is not agreement with ground truth: the CPU reference is itself a 64-sample estimate. Native D3D12 is not part of this release.

Licensed FSL-1.1-MIT. Version 0.2.0 and earlier stay MIT.