The library documents itself · GPU
stzGpu
32 own methods · 1 forms written with extensions, listed under their method
the source: base/gpu/stzGpu.ring(opens in a new tab) · All classes · The area reference: GPU
Under each method, its extensions (Q CS XT Z ZZ IB W U): bold and ticked, it exists; struck, it does not. The extensions and what they mean
No method of this class is run on this page: the class reaches files, the network, processes, the clock, chance or sound, and an example run here would only be an example of its effects. Each method carries the explanation the library gives of itself.
Method
Explanation, as the source carries it
init
(no comment in the source: the name reads as a sentence) initno extension
IsAvailable
(no comment in the source: the name reads as a sentence) is availableno extension
DeviceName
(no comment in the source: the name reads as a sentence) device nameno extension
AdapterCount
(no comment in the source: the name reads as a sentence) adapter countno extension
UploadQ
Upload a vector; it lives on the device until Free() (or eviction under VRAM pressure -- bounded, counted, never silent).no extension
Run
One-shot convenience: upload the bound vectors, run the kernel, read the result back, free everything temporary. Data in, DATA out.QCSXTZZZIBWU
ApplyOnQ
Multi-input kernels over ALREADY-RESIDENT buffers: no transfer at all. paBindings binds vector names to stzGpuBuffer objects (plus scalars): oG.ApplyOnQ(k, [ :A = oBuf1, :B = oBuf2, :alpha = 2 ])no extension
Calibrate
Measure where the GPU actually starts winning ON THIS MACHINE, store the crossover in the calibration store, and persist it (the faces auto-load it in later sessions). Warm-min discipline throughout -- G0's clock inversion means sustained numbers flatter the GPU. Returns [ nThreshold, [ [nProblemSize, nCpuMs, nGpuMs], ... ] ].no extension
CalibrateWith
The same, on a caller-chosen ladder of corpus sizes (d fixed at 64: a representative embedding width; problem size = n*d).no extension
Verify
pCand may be an stzKernelMaker on the SAME declarations, or raw WGSL on the same binding contract (how a hand-written variant -- or a cheat -- gets checked). Options: [ :reps = 7, :band = 0.000001 ].no extension
VerifyWith
(no comment in the source: the name reads as a sentence) verify withno extension
VerifyJudge
The roofline alone: could a dispatch touching nBytes finish in nMs on this device? Pure judgement over the MEASURED floors -- exposed so a guard can hand it an impossible number and watch it refuse.no extension
VerifyFloors
The measured floors themselves: [ :floorgbs, :submitfloorms ]no extension
LoadCalibration
(no comment in the source: the name reads as a sentence) load calibrationno extension
FirstError
one rung: warm-min per-query ms through the REAL seam, both routes Measured 2026-09-09 on this laptop's RTX 3050: after ~10 s idle, every submit pays a fixed ~2 ms and the copy floor reads 13 GB/s instead of 85 -- and hundreds of tiny queries never lift it, while ~150 ms of heavy work does. Wake() is that work, ADAPTIVE: it copies until a copy runs at full speed, settles, and stops -- the budget is a cap. Every timing this face takes calls it first; a caller measuring on its own should too. Returns the copies it took (an awake device answers in ~20). THE CAUSE AND THE SYMPTOM. A shader that fails validation raises two errors: the parser's, with the offending name and line, and then the pipeline's, which only says the module is invalid. FirstError() is the parser's; LastError() is whatever came last. A compile clears both first.no extension
LastError
(no comment in the source: the name reads as a sentence) last errorno extension
ClearErrors
(no comment in the source: the name reads as a sentence) clear errorsno extension
Wake
(no comment in the source: the name reads as a sentence) wakeno extension
CalibrateKnnResident
Measured 2026-09-09 on the RTX 3050 laptop at 384 dims: the GPU loses at 1,000 (0.39x) and 4,000 (0.98x) and wins at 16,000 (1.42x); the multicore top-k switches on at n*d >= 8M and the window may close again above it -- which is why the rung above that gate is measured too, and why the store is SHAPED: a class that wins carries its win, and the flat line stays beyond the ladder where a class lost.no extension
CalibrateKnnResidentWith
(no comment in the source: the name reads as a sentence) calibrate knn resident withno extension
ConvolveReal
This is the ONE-SHOT doorway: upload, run, download. A plane holding its signal on the device uses the buffer form (StzEngineGpuOpConvolveReal over buffer ids) and pays no marshalling -- the sound desk's route.no extension
FoundryPairdist
Report: [ :m, :n, :d, :hiddenn, :clocks, :refgpums, :refwallms, :variants = [ [name, verified, gpums, wallms, ratio, ratiowall], ... ], :winner = name, :ratio = generic/winner on the GPU clock, :stored = bool ]no extension
FoundryPairdistWith
(no comment in the source: the name reads as a sentence) foundry pairdist withno extension
FoundryAttention
THE ATTENTION FOUNDRY (GK2c). The backbone's fused attention -- one workgroup per (head, query row) -- against three reduction-form variants at workgroup widths 64, 128 and 256, under the checker on the neural DLL's device; the winner recorded for the (tokens, width, head_dim) class under the op name "attention", persisted, and pushed into the neural DLL's table so the next forward dispatches it.no extension
FoundryAttentionWith
(no comment in the source: the name reads as a sentence) foundry attention withno extension
FoundryMatmul
THE MATMUL FOUNDRY (GK2b's matmul leg). C(m x n) = A(m x k) B(k x n): tile16 (the generic), tile8, reg2, reg4 under the checker at the asked shape and a hidden one; the winner recorded for the (m, n, k) class under the op name "matmul" and persisted. The backbone compiles the table's winner for its own shapes with the bias fused.no extension
FoundryMatmulWith
(no comment in the source: the name reads as a sentence) foundry matmul withno extension
FoundryUmapKnn
THE k-NN FOUNDRY (GS6e). The UMAP k-NN kernel lives in the stats DLL on its own device, so its enumeration runs there; the verdict is recorded in that DLL's variant table AND persisted here under the op name "umap_knn", beside pairdist's rows, so the next session finds it. The stats DLL reads the persisted rows back through StzUmapKnnVariantsSync() at its first fit.no extension
FoundryUmapKnnWith
(no comment in the source: the name reads as a sentence) foundry umap knn withno extension
FoundryPairdistGrid
The kill line, per adapter: a grid of single-query shapes; TRUE if any class found a variant worth the margin.no extension
CalibrateShaped
Report: [ :cells = [[d, n, cpuMs, gpuMs, ratio], ...], :flat = the flat line stored, :flatwhy = "crossover" | "beyond-ladder", :hidden = [ [d, n, cpuMs, gpuMs, predicted, measured, agree], ... ], :adapter = name ]no extension
CalibrateShapedWith
(no comment in the source: the name reads as a sentence) calibrate shaped withno extension

