wgblas
    Preparing search index...

    Module tests/helpers/fixtures

    Property-based fixture runner using fast-check.

    Each routine's fixtures test calls runFixtures with 100 random inputs, comparing the GPU result against the CPU stdlib reference using a routine-specific error metric and threshold.

    buildArb constructs a fast-check arbitrary that produces a complete args object for one test run. Scalar and string params (n, m, k, incx, alpha, uplo, trans, …) are generated first, then each leading dimension (lda/ldb/ldc) at or above its minimum; arrays are then sized from their spec's dependsOn — exactly (n-1)*inc+1 elements for a vector, enough rows × leading dimension for a matrix — so their length is always consistent with the generated shape and stride. Double-precision specs (x64, alpha64, …) generate genuine doubles via float64Arb, and complex ones Complex32/Complex32Array values.

    WGSL may flush subnormals to zero: "To flush to zero is to replace a subnormal value for a floating point type with a zero value of that type." (WGSL §15.7.2)

    Filtering generated values for subnormals is not enough — the product of two small-but-normal values can itself land in the subnormal range (e.g. F32_MIN_NORMAL * 5.96e-8 ≈ 7e-46). floatArb uses 1e-3 as the minimum non-zero magnitude, ensuring any pairwise product stays well above F32_MIN_NORMAL (1e-3 × 1e-3 = 1e-6 >> 1.175e-38).

    runFixtures accepts an errorMetric function and a threshold. Each run passes if errorMetric(gpuResult, refResult, args) <= threshold. Despite the name, it isn't always a ULP count — it's maxUlp/ulpDiff for exact and reduction routines, but forwardFactor/backwardResidualFactor for everything else (see tests/index.mjs for the full per-routine table).

    buildArb
    float64Arb
    floatArb
    makeVec
    ndArrayArb
    rotmParamArb
    runFixtures
    scalarArb
    triangularDiagonalArb
    maxUlp → maxUlp
    ulpDiff → ulpDiff