node:test context
used in the diagnostic label
WebGPU device instance
number of random inputs to generate (typically 100)
maximum allowed value from errorMetric
param specs from loadParam, or a pre-built fc arbitrary
async function that calls the GPU routine
function that calls the CPU reference
(gpuResult, refResult, args) => number; e.g. maxUlp/
ulpDiff for exact/reduction routines, forwardFactor/backwardResidualFactor
for the rest — not always a ULP count despite routines commonly naming their
own version ...Ulp/...Diff
optional extra arbitraries for routine-specific params (e.g. srotm's param)
promise that resolves when all runs pass, or rejects on the first failing run
Runs
numRunsproperty-based random tests comparing the GPU routine against a CPU reference. Passes iferrorMetric(gpuResult, refResult, args) <= thresholdfor every run. Emits a diagnostic with the maximum observed value.