wasm: add Node/Emscripten numerical CBLAS test suite - #6024
Open
jjerphan wants to merge 9 commits into
Open
Conversation
Shared headers for tolerances, size grids, and compare helpers, plus README and gitignore for the Node/Emscripten deep CBLAS checks. Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Hand-written IEEE mul/add implementations used as the correctness baseline (not Netlib BLAS or a second OpenBLAS build). Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Cover AXPY, GEMV, GEMM/CGEMM/ZGEMM, SYRK, TRMM, and TRSM with tile remainder sizes, rectangular cases, and stride variants. Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Build TARGET=WASM128_GENERIC twice (WASM_RELAXED_SIMD=0/1), link test/wasm, and run under node with matching tolerances. Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Keep ctest/getarch/utest sidecars from Node builds out of version control, alongside the existing *.exe rule. Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Add a workflow that installs Emscripten and Node, then runs test/wasm/run.sh (IEEE and relaxed SIMD builds) on PRs and pushes that touch the WASM kernels or the suite. Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Expose WASM_RELAXED_SIMD=0 and =1 as separate GitHub Actions jobs so both builds are visible checks. run.sh still runs both locally when the variable is unset. Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Contributor
Author
|
A priori the few failures (due to timeouts) are unrelated to those changes. |
3 tasks
jjerphan
force-pushed
the
wasm-numerical-suite
branch
4 times, most recently
from
September 10, 2026 09:06
768b690 to
2e2134a
Compare
Add scalar-oracle checks for the full Level 1/2/3 surface (dense, banded, and packed), including S/D/C/Z where applicable. Keep the deep AXPY/GEMV/ GEMM grids and exercise the remaining families on a compact size set. Merge the former check_*_full sources into per-level check_l*.c files with one test function per CBLAS interface and shared expect_close_* helpers. House oracles in ref_l1.c / ref_l2.c / ref_l3.c (typed deep-grid AXPY/GEMV, polymorphic L1/L2 helpers, and UPLO-aware L3 including SYMM/HEMM/HERK/ SYR2K/HER2K); triangular fixtures live in common.h. Document L1/L2/L3 and IEEE vs relaxed tolerance choices in tol.h. Discover emcc via PATH, OPENBLAS_EM_PREFIX, or \$ROOT/.em-prefix only. Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
The previous fillers mapped (i, seed) into about [-0.5, 0.45], so the
suite never stressed values close to 0, large magnitudes, or a single
sign. Replace them with fill_vec_* / fill_mat_* (real and complex)
driven by a FillSpec: strictly positive (R+), strictly negative (R-),
or mixed (R \ {0}), each at a near-0 or far-from-0 log-uniform spread.
Drivers cycle the six cases across the size grid via use_fill_case so
tile remainders see different regimes without a 6x runtime. Near-0
floors stay large enough that tol*(1+maxv) still flags a wrong kernel;
far-from-0 caps stay small enough that L3 GEMM at n~129 does not
overflow f32. Existing fill_f32/f64/c32/c64 wrap the vector fillers.
Triangular and band fixtures stay O(1) and diagonally dominant.
Failure lines include the active spec.
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
jjerphan
marked this pull request as ready for review
September 10, 2026 16:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
test/wasm/, a deeper CBLAS correctness suite forTARGET=WASM128_GENERICunder Node / Emscripten. It complements the lightctest/utestgate and is meant to catch tile-remainder and stride bugs in the WASM SIMD kernels.ref_l1.c/ref_l2.c/ref_l3.c: IEEE*/+only — not Netlib BLAS and not a second OpenBLAS build).cases.h).fill_vec_*/fill_mat_*(common.h). Drivers cycle sixFillSpeccases across the size grid so remainders see different sign domains and magnitude spreads, without a 6× runtime:[1e-4, 1], f64[1e-8, 1]) and far from 0 (f32[1e2, 1e4], f64[1e4, 1e8])tol * (1 + maxv)still flags a wrong kernel; far-from-0 caps stay small enough that L3 GEMM at n≈129 does not overflow f32.make_tri_*) and band fixtures stay O(1) and diagonally dominant. Failure lines include the active spec (e.g.R+ far from 0).test/wasm/run.shbuilds withWASM_RELAXED_SIMD=0and/or1and runs with matching tolerances (tol.h/TEST_WASM_RELAXED)..wasmsidecars from Node builds in.gitignore..github/workflows/wasm.ymlruns IEEE and relaxed matrix jobs onubuntu-latest(Emscripten 4.0.10 + Node 22) whentest/wasm/orkernel/wasm/changes.Test plan
With
emcconPATH(or an emscripten-forge prefix viaOPENBLAS_EM_PREFIX):WASM_RELAXED_SIMD=0(IEEE tolerances)WASM_RELAXED_SIMD=1(relaxed tolerances)WASM_RELAXED_SIMD=0and=1)