Repository navigation
CI: test wasm32 and wasm64 on every pull request and before a release - #821
Merged
Merged
Conversation
- 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>
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.
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:
build_wasm.bat/build_wasm.sh, wasm32 and wasm64, none/rc/own) with the compiler the job just built, in that leg's mode;tslang/test/wasm/run_tests.mjswith--require-run(and--debugon the debug leg): the tester's tests and the default library's tests, on both triples, under none, rc and own. On failure it printsout/results.txt.The jit legs are unchanged. Locally one wasm run takes about 5 minutes at -j4.
Release (
create-release.yml)test_wasm_windows(release and debug) andtest_wasm_linux(Ubuntu 22.04, 24.04 and 26.04 × release and debug). Each unpacks the package and runs the same tests with the package'stslang, itswasm-ldand its wasm default library.create_releasewaits for them.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 fromdocs/how/wasm/testtotslang/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_parse2failed 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 JSmemory.bufferkeeps the old length; wasm code is not affected. A newbuffer()accessor checks the heap top against the view and refreshes it withmemory.grow(0). The heap, string, atomics and thread-join views now go through it. Before the fix,worker_objectssometimes timed out under parallel load withRangeError: Offset is outside the bounds of the DataViewin malloc: 2 of 320 runs. After it, 320 of 320 passed.Testing
Run locally with
--require-run -j8:These were checked locally:
build_wasm.batcalls;wasm-ldbeside it, with LLVM off PATH;The release jobs run only on a release tag.
🤖 Generated with Claude Code