Skip to content

Translating thread and wait to js and test harness for multi-threaded programs #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: upstream-rebuild
Choose a base branch
from

Conversation

zilinc
Copy link

@zilinc zilinc commented Mar 7, 2025

This PR fixes #218 and supersedes #219.

It includes changes in the following aspects:

  1. It changes the JS test harness (test/harness/testharness*) to newer versions from the upstream WPT repo. This is required because it fixes several problems around fetch_tests_from_workers and tests getting stuck (which also affects the upstream WebAssembly/spec repo).
  2. It fixes the JS test harness to support Either expected results.
  3. It implements the generation of the thread and wait constructs in wast scripts.
  4. It allows the test harness (test/harness/async_*) to work with multi-threaded test cases. It includes the JS file names under test in the test reporting, because otherwise the test harness will complain about duplicate test names coming from different threads.
  5. It also fixes several race conditions in the JS test harness that are not only present here, but also in the upstream WebAssembly/spec repo (main branch). For instance, in the assert_unlinkable function, it does not wait for the preceding updates to the registry to happen. It will non-deterministically produce wrong test results (false negatives and false positives) depending on the timing and order of the tests.
  6. Updates to the build scripts (test/build.py) with additional flags. (In the upstream WebAssembly/spec repo, it generates some JS file in the wrong paths, resulting in non-existent files when running the testsuite; but this behaviours is not present in this branch of this repo.)
  7. With all the fixes, there're still several failed tests in the testsuite due to the differences between production web browsers and our interpreter. Chrome and Firefox give the same results. The failed tests are:
test file # failed tests
import.wast 6
global.wast 4
elem.wast 4
binary.wast 16
data.wast 4
memory.wast 4
threads/atomic.wast 2

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.

2 participants