-
Notifications
You must be signed in to change notification settings - Fork 51
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
Translating thread and wait to js and test harness for multi-threaded programs #229
Conversation
Several of these new tests are very dubious, and most of them seem to be testing implementation details of the interpreter:
I particularly want to stress that we should not be testing implementation details of the interpreter and test system. For example, our scripts convert One final comment: many of these issues would probably have been caught by CI, but this repo seemingly does not have GitHub Actions configured like the rest of the proposal repos. It's not worth our time to try and stay up to date with spec tests from this repo if we can't be confident that they pass in the reference interpreter. |
@bvisness I appreciate your engagement on this. I view these tests as documenting corner-cases of the .wast format rather than details of the interpreter. My understanding is that the
I'm happy to work with you to come up with better conventions for organising these tests that facilitate your use case, with the caveat that at a high level there should be an expectation that the test suite may contain some tests that aren't directly applicable to all implementers/consumers. It's late right now in Singapore, but tomorrow I can move these |
I think the approach that makes the most sense to me is to extract any meta-tests about WAST and the reference interpreter to a separate folder outside the I also think it would make the most sense to do that in a PR to the main spec repo instead of in a PR in the threads repo, although that wouldn't affect us either way. As for what harness I was using, I was just running the main run.py script in the |
I agree that separating out tests that implementers are not expected to care about makes sense, but I would prefer to move them to a separate subdirectory rather than out of the |
In principle, all consumers of .wast could implement the meta-level correctness checks (which are part of the format's semantics more than an implementation detail). But it's probably not worth enforcing that, especially if apparently not even the reference interpreter itself does it. :) I'd just drop those couple of tests instead of building more infrastructure around them. I believe that the linking test in thread.wast specifically verifies that a .wast-level thread has a fresh modules registry, as part of the basic semantics of the
Well, no, the test runner requires, not allows, such tests to fail. IIRC, .fail. was originally introduced to express negative tests, but has become mostly obsolete with wast features like |
Ok, this is my misunderstanding of the testing infrastructure then, apologies. I've just removed the offending tests for now (#232), and we can have a longer-term conversation in a separate issue about whether/how to do edge-case testing of the |
This PR fixes #218 and supersedes #219.
It includes changes in the following aspects:
test/harness/testharness*
) to newer versions from the upstream WPT repo. This is required because it fixes several problems aroundfetch_tests_from_workers
and tests getting stuck (which also affects the upstreamWebAssembly/spec
repo).Either
expected results.thread
andwait
constructs in wast scripts.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.WebAssembly/spec
repo (main
branch). For instance, in theassert_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.test/build.py
) with additional flags. (In the upstreamWebAssembly/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.)