Skip to content

[EH] Add more manual tests for new Wasm EH #21913

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

Merged
merged 4 commits into from
May 10, 2024

Conversation

aheejin
Copy link
Member

@aheejin aheejin commented May 8, 2024

The testing mode for the new Wasm EH (exnref) was added in with_all_eh_sjlj and with_all_sjlj in #21906. But this adds the new Wasm EH test mode for more tests that are not covered by those decorators.

The testing mode for the new Wasm EH (exnref) was added in
`with_all_eh_sjlj` and `with_all_sjlj` in emscripten-core#21906. But this adds the new
Wasm EH test mode for more tests that are not covered by those
decorators.
@aheejin aheejin requested review from kripken and sbc100 May 8, 2024 23:17
@@ -915,6 +915,10 @@ def test_longjmp_with_and_without_exceptions(self):
self.emcc_args.append('-fwasm-exceptions')
for arg in ['-fwasm-exceptions', '-fno-exceptions']:
self.do_core_test('test_longjmp.c', emcc_args=[arg])
# Wasm SjLj with and with new experimental EH support
self.require_new_wasm_eh()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't adding this mean that this test now can't be run with out new eh?

If so, why not use the decorator?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm you're right; I was confused and somehow assumed we were able to run the two tests and kind of skip this part with node < 22.. Not sure why I've assumed that.

Using the decorator means thie tests only runs on node 22. Do we run non-wasm64 core tests on node 22?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used the decorator: 6691a92

# still works until removed.
'--embind-emit-tsd', 'embind_tsgen.d.ts', '-Wno-deprecated'])
self.assertFileContents(test_file('other/embind_tsgen.d.ts'), read_file('embind_tsgen.d.ts'))
for wasm_exnref in [0, 1]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use @parameterize here instead of the loop?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like:

@parameterize({
   '', [0],
   'wasm_exnref', [1],
})

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: db345b2

self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
# New Wasm EH with exnref
self.require_wasm_exnref()
self.set_setting('WASM_EXNREF')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again I wonder if that can parameterized instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can, but does this run on node 22?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can select specific tests to to run on node canary. They are listed in the .circleci config.

Copy link
Member Author

@aheejin aheejin May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks test-wasm64 and test-wasm64-4gb

test-wasm64:
# We don't use `bionic` here since its tool old to run recent node versions:
# `/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found`
executor: linux-python
steps:
- prepare-for-tests
# The linux-python image uses /home/circleci rather than /root and jsvu
# hardcodes /root into its launcher scripts so we need to reinstall v8.
- run: rm -rf $HOME/.jsvu
- install-v8
- install-node-canary
- run-tests:
title: "wasm64"
test_targets: "
wasm64
core_2gb.test_*em_asm*
core_2gb.test_*embind*
wasm64l.test_bigswitch
other.test_memory64_proxies
other.test_failing_growth_wasm64"
- upload-test-results
test-wasm64-4gb:
environment:
LANG: "C.UTF-8"
# Only run 2 tests at a time to avoid OOM (since each tests used >4gb)
EMCC_CORES: "2"
# We don't use `bionic` here since its too old to run recent node versions:
# `/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found`
executor: linux-python
steps:
- prepare-for-tests
# The linux-python image uses /home/circleci rather than /root and jsvu
# hardcodes /root into its launcher scripts so we need to reinstall v8.
- run: rm -rf $HOME/.jsvu
- install-v8
- install-node-canary
- run-tests:
title: "wasm64_4gb"
test_targets: "wasm64_4gb"
- upload-test-results

and some tests in test-compat
test-node-compat:
# We don't use `bionic` here since its too old to run recent node versions:
# `/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found`
executor: linux-python
environment:
LANG: "C.UTF-8"
EMTEST_SKIP_V8: "1"
steps:
- checkout
- run:
name: submodule update
command: git submodule update --init
- pip-install
- install-emsdk
- install-node-canary
- run-tests:
title: "node (canary)"
test_targets: "
other.test_deterministic
other.test_gen_struct_info
other.test_native_call_before_init
other.test_node_unhandled_rejection
core2.test_hello_world
core0.test_pthread_join_and_asyncify
core0.test_async_ccall_promise_jspi
core0.test_async_ccall_promise_exit_runtime_jspi
core0.test_cubescript_jspi"

are running on node canary, right?

Then I wonder, why are these tests, which has self.require_wasm_exnref(), passing in test-core0 and test-other? test-core0 and test-other don't seem to run on node canary, right? They say ok instead of skipped...

test_exceptions_with_and_without_longjmp (test_core.core0) ... ok (9.40s)
test_longjmp_with_and_without_exceptions (test_core.core0) ... ok (6.01s)
test_lto_wasm_exceptions (test_other.other) ... ok (8.19s)
test_standalone_wasm_exceptions (test_other.other) ... ok (2.03s)

test-core0 log:
https://app.circleci.com/pipelines/github/emscripten-core/emscripten/35053/workflows/a5482f96-8732-4e8f-b7ba-bce7fb9a77ab/jobs/783071
test-other log:
https://app.circleci.com/pipelines/github/emscripten-core/emscripten/35053/workflows/a5482f96-8732-4e8f-b7ba-bce7fb9a77ab/jobs/783072

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is because v8 is installed, which also satisfies the require_wasm_exnref requirement.
See https://app.circleci.com/pipelines/github/emscripten-core/emscripten/35053/workflows/a5482f96-8732-4e8f-b7ba-bce7fb9a77ab/jobs/783041

Copy link
Member Author

@aheejin aheejin May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added @requires_wasm_exnref to all relevant tests I modified here, and removed self.require_wasm_eh() and self.require_wasm_exnref(). Didn't add them to the list of node-canary tests, given that they can run on v8 anyway: 6691a92

'wasm_exnref': [1]
})
def test_embind_tsgen_exceptions(self, wasm_exnref):
self.set_setting('WASM_EXNREF', wasm_exnref)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably this should have:

if wasm_exnref: 
  self.requires_wasm_enxref()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only runs compilation and does not run it. Note that there was no self.require_wasm_eh() before.

@@ -8830,7 +8837,8 @@ def test_lto(self, args):
@parameterized({
'noexcept': [],
'except': ['-sDISABLE_EXCEPTION_CATCHING=0'],
'except_wasm': ['-fwasm-exceptions']
'except_wasm': ['-fwasm-exceptions'],
'except_wasm_exnref': ['-fwasm-exceptions', '-sWASM_EXNREF']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same

@aheejin aheejin merged commit 7e7c057 into emscripten-core:main May 10, 2024
29 checks passed
@aheejin aheejin deleted the more_eh_tests branch May 10, 2024 17:24
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