Skip to content

CI: test wasm32 and wasm64 on every pull request and before a release - #821

Merged
ASDAlexander77 merged 5 commits into
mainfrom
wasm-ci
Nov 12, 2026
Merged

ASDAlexander77 merged 5 commits into
mainfrom
wasm-ci

Conversation

@ASDAlexander77

@ASDAlexander77 ASDAlexander77 commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

wasm32 and wasm64 tests in CI, on every pull request and before a release.

Pull requests (cmake-test-release-win.yml, cmake-test-release-linux.yml)

The exe leg of each build job (release programs and debug programs, on Windows and Linux) now also:

  1. sets up Node 24 (wasm64 needs it: LLVM gives a wasm64 module 64-bit tables, which older V8 cannot instantiate);
  2. clones TypeScriptCompilerDefaultLib's main and builds its wasm default library (build_wasm.bat / build_wasm.sh, wasm32 and wasm64, none/rc/own) with the compiler the job just built, in that leg's mode;
  3. runs tslang/test/wasm/run_tests.mjs with --require-run (and --debug on the debug leg): the tester's tests and the default library's tests, on both triples, under none, rc and own. On failure it prints out/results.txt.

The jit legs are unchanged. Locally one wasm run takes about 5 minutes at -j4.

Release (create-release.yml)

Test runner and host

  • Everything the wasm tests need (run_tests.mjs, run.mjs, thread.mjs, host.mjs, wasm_skips.txt, the browser page, the README) moved from docs/how/wasm/test to tslang/test/wasm, with the other tests.

  • writeAllSync (host.mjs): on Linux a program's stdout is a non-blocking pipe under the runner; a write while it is full threw EAGAIN (00stack_test, date_parse2 failed in CI). It now writes the rest once the pipe drains.

  • run_tests.mjs --require-run: a test that is only compiled and not run counts as a failure. Without the flag, a wasm64 test on Node before 24 is BUILT, not run.

  • host.mjs: when another thread grows a shared memory, this thread's JS memory.buffer keeps the old length; wasm code is not affected. A new buffer() accessor checks the heap top against the view and refreshes it with memory.grow(0). The heap, string, atomics and thread-join views now go through it. Before the fix, worker_objects sometimes timed out under parallel load with RangeError: Offset is outside the bounds of the DataView in malloc: 2 of 320 runs. After it, 320 of 320 passed.

Testing

Run locally with --require-run -j8:

  • every leg passes in release and in debug: 0 failures;
  • tester: 652 pass under none and rc, 486 under own;
  • default library: 206 or 207 pass;
  • both triples.

These were checked locally:

  • the pwsh build_wasm.bat calls;
  • the packaged layout: tslang finds wasm-ld beside it, with LLVM off PATH;
  • the YAML parses.

The release jobs run only on a release tag.

🤖 Generated with Claude Code

ASDAlexander77 and others added 5 commits November 12, 2026 10:12
- The exe leg of each Windows and Linux build job builds the wasm default library with the
  compiler it just built and runs docs/how/wasm/test/run_tests.mjs (tester and default-library
  suites, -mm=none/rc/own, release or --debug programs) under Node 24.
- create-release builds the wasm default library into each package (it did not before), and
  new test_wasm_windows / test_wasm_linux jobs test the packaged tslang, wasm-ld and library;
  create_release waits for them.
- run_tests.mjs --require-run: a test that is only compiled (wasm64 before Node 24) fails.
- host.mjs: a thread's JS view of a shared memory lags when another thread grows it; buffer()
  refreshes it with memory.grow(0) (worker_objects timed out with a DataView RangeError).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…AGAIN on Linux CI)

Under run_tests.mjs the program's stdout is a pipe Node made non-blocking; on Linux a write to
it while it is full throws EAGAIN, or takes only part of the text. 00stack_test and date_parse2
failed so in CI. writeAllSync (host.mjs) writes the rest once the pipe drains; run.mjs and
thread.mjs use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Everything the wasm tests need (run_tests.mjs, run.mjs, thread.mjs, host.mjs, wasm_skips.txt,
the browser page and the README) is now with the other tests, in tslang/test/wasm; the CI and
release workflows run it from there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
00stack_test prints two million lines; a write call per line kept it past the 60 s timeout on
the Linux CI runner (-mm=none, both triples). bufferedOutput (host.mjs) writes stdout out at
64 KB, before anything goes to stderr, and through the host's new flush hook before a thread
sleeps, waits, joins, reads stdin or ends, and at the end of run.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit b9cdbf4 into main Nov 12, 2026
8 checks passed
@ASDAlexander77
ASDAlexander77 deleted the wasm-ci branch November 12, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant