GPU
Compute and render on one device with a self-tuning, self-checking foundry; f64 and multi-GPU refused by choice.
5 Strong · 4 Solid · 3 Partial · 0 Emerging
Measured against: wgpu · taichi · three.js · Folders: base/gpu(opens in a new tab) · For programmers: this area's reference

Rethought from first principles
What Softanza kept from what works, and what it rethought, as the library wrote it down in its design documents and narrations.
The Softanza wayThe GPU is used only where a measurement shows it wins, and the CPU path always remains the reference answer.
Kept from the best practice
- One lightweight, proven library is built in: wgpu-native (WebGPU). Kernels compile from text at run time, and the same kernels also run in a browser. source(opens in a new tab)
- Data stays on the device: upload once, chain several kernels, read back once, because moving data costs more than computing on it. source(opens in a new tab)
- Every GPU operation ships with a parity check against the CPU result, within a tolerance set from measurement. source(opens in a new tab)
Rethought
- Exact double-precision work stays on the CPU by decision. The GPU serves only domains that tolerate single precision, because consumer cards run doubles 32 to 64 times slower. source(opens in a new tab)
- Each route to the GPU must win a measurement first, with kill criteria written in advance. Standalone element-by-element operations were dropped because data transfer was 92% of their cost. source(opens in a new tab)
- GPU compute is described, not hand-written. stzKernelMaker turns a short formula into a kernel, making it approachable the way the regex maker did for patterns. source(opens in a new tab)
- Kernel variants are proposed by a plain loop, not a language model, since the search space is small. An engine checker verifies each one and refuses impossible speeds. source(opens in a new tab)
An in-house wgpu plane that does what neither three.js (render-only) nor taichi (compute-only) does: compute and render on one device, zero-copy. Its distinctive core is a self-tuning foundry; real consumers are accelerated and verified (t-SNE 5-8x, UMAP up to 16x, k-means 6x, neural forward 5x, exact vector search 18x), always with a bit-identical CPU fallback. What it refuses by measured decision — f64 on GPU, multi-GPU, deep 3D — are scope boundaries, not oversights.
What a crafter does with it, and what stands out
- a self-tuning, self-checking calibration foundry: category-of-one
- compute and render zero-copy on one device
- every GPU route measured, verified, and reversible to CPU
- byte-identical WGSL native vs browser
What is owed
- broaden the kernel transpiler beyond elementwise
- whole-pipeline GPU residency
- idle-aware routing (GK1b)
- deeper 3D rendering
The Softanza way, run
What Softanza does differently in this area, shown by code taken from its narrations and guards, and run for this page.
A one-line formula becomes a GPU kernel; writing it needs no device, and the generated code can be read before anything runs.
k1 = StzKernelMakerQ()
k1.TakesVector(:A)
k1.TakesVector(:B)
k1.TakesScalar(:alpha)
k1.ReturnsVector(:C)
k1.ForEachElement('{ @C = alpha * @A + @B }')
cW = k1.ToWGSL()
? cWstruct StzTile { xoff : u32, p0 : u32, p1 : u32, p2 : u32 }
@group(0) @binding(0) var<uniform> tile : StzTile;
struct P { n : u32, pad : u32, s_alpha : f32 }
@group(0) @binding(1) var<uniform> p : P;
@group(0) @binding(2) var<storage, read> v_a : array<f32>;
@group(0) @binding(3) var<storage, read> v_b : array<f32>;
@group(0) @binding(4) var<storage, read_write> v_c : array<f32>;
@compute @workgroup_size(256)
fn main(@builtin(global_invocation_id) gid : vec3<u32>) {
let i = gid.x + tile.xoff * 256u;
if (i < p.n) { v_c[i] = p.s_alpha * v_a[i] + v_b[i]; }
}run on 2026-10-01 21:17 inside the library at commit 0e72e2e2c; taken from base/test/gpu/gpu_declarative_narrated.ring(opens in a new tab)
The lanes, one by one
Lanes and their notes are quoted as they were read at the source, on Read from the source on 2026-09-16, from a read-only main worktree.

