Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/jsifier.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function handleI64Signatures(symbol, snippet, sig, i53abi) {
const newArgs = [];
let argConversions = '';
if (sig.length > argNames.length + 1) {
error(`handleI64Signatures: signature too long for ${symbol}`);
error(`handleI64Signatures: signature '${sig}' too long for ${symbol}(${argNames.join(', ')})`);
return snippet;
}
for (let i = 0; i < argNames.length; i++) {
Expand Down
16 changes: 4 additions & 12 deletions test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4450,24 +4450,16 @@ def test_webgl_simple_extensions(self, webgl_version, simple_enable_extensions):
'closure': (['-sASSERTIONS', '--closure=1'],),
'closure_advanced': (['-sASSERTIONS', '--closure=1', '-O3'],),
'main_module': (['-sMAIN_MODULE=1'],),
'pthreads': (['-pthread', '-sOFFSCREENCANVAS_SUPPORT'],),
})
@requires_webgpu
def test_webgpu_basic_rendering(self, args):
self.btest_exit('webgpu_basic_rendering.cpp', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU'] + args)
self.btest_exit('webgpu_basic_rendering.cpp', cflags=['--use-port=emdawnwebgpu', '-sEXIT_RUNTIME'] + args)

@requires_webgpu
def test_webgpu_required_limits(self):
self.btest_exit('webgpu_required_limits.c', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU', '-sASYNCIFY'])

@requires_webgpu
def test_webgpu_basic_rendering_pthreads(self):
self.btest_exit('webgpu_basic_rendering.cpp', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU', '-pthread', '-sOFFSCREENCANVAS_SUPPORT'])

def test_webgpu_get_device(self):
self.btest_exit('webgpu_get_device.cpp', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU', '-sASSERTIONS', '--closure=1'])

def test_webgpu_get_device_pthreads(self):
self.btest_exit('webgpu_get_device.cpp', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU', '-pthread'])
self.set_setting('NO_DEFAULT_TO_CXX', 0) # emdawnwebgpu uses C++ internally
self.btest_exit('webgpu_required_limits.c', cflags=['--use-port=emdawnwebgpu', '-sEXIT_RUNTIME'])

# Tests the feature that shell html page can preallocate the typed array and place it
# to Module.buffer before loading the script page.
Expand Down
23 changes: 10 additions & 13 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -2586,6 +2586,7 @@ def test_contrib_ports(self):

@requires_network
def test_remote_ports(self):
self.set_setting('NO_DEFAULT_TO_CXX', 0) # emdawnwebgpu uses C++ internally
self.emcc(test_file('hello_world.c'), ['--use-port=emdawnwebgpu'])

@crossplatform
Expand Down Expand Up @@ -9585,13 +9586,15 @@ def test_closure_full_js_library(self, args):

@also_with_wasm64
def test_closure_webgpu(self):
# This test can be removed if USE_WEBGPU is later included in INCLUDE_FULL_LIBRARY.
if config.FROZEN_CACHE:
# TODO(crbug.com/446944885): Make Emdawnwebgpu work with FROZEN_CACHE if possible.
self.skipTest("test doesn't work with frozen cache")
self.set_setting('NO_DEFAULT_TO_CXX', 0) # emdawnwebgpu uses C++ internally
self.build('hello_world.c', cflags=[
'--closure=1',
'-Werror=closure',
'-Wno-error=deprecated',
'-sINCLUDE_FULL_LIBRARY',
'-sUSE_WEBGPU',
'--use-port=emdawnwebgpu',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have any remaining tests for -sUSE_WEBGPU?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, but I'm planning to remove it immediately after this (#25398).

])

# Tests --closure-args command line flag
Expand Down Expand Up @@ -12230,15 +12233,6 @@ def test_standalone_syscalls(self):
for engine in config.WASM_ENGINES:
self.assertContained(expected, self.run_js('test.wasm', engine))

@parameterized({
'': ([],),
'assertions': (['-sASSERTIONS'],),
'closure': (['-sASSERTIONS', '--closure=1'],),
'dylink': (['-sMAIN_MODULE'],),
})
def test_webgpu_compiletest(self, args):
self.run_process([EMXX, test_file('webgpu_jsvalstore.cpp'), '-Wno-error=deprecated', '-sUSE_WEBGPU', '-sASYNCIFY'] + args)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this test no longer useful?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The whole jsvalstore thing has been removed in Emdawnwebgpu. We have another mechanism but it would need entirely new tests.


@flaky('https://github.com/emscripten-core/emscripten/issues/25343')
@also_with_wasm64
@parameterized({
Expand All @@ -12247,7 +12241,10 @@ def test_webgpu_compiletest(self, args):
'closure_assertions': (['--closure=1', '-Werror=closure', '-sASSERTIONS'],),
})
def test_emdawnwebgpu_link_test(self, args):
self.run_process([EMXX, test_file('test_emdawnwebgpu_link_test.cpp'), '--use-port=emdawnwebgpu', '-sASYNCIFY'] + args)
if config.FROZEN_CACHE:
# TODO(crbug.com/446944885): Make Emdawnwebgpu work with FROZEN_CACHE if possible.
self.skipTest("test doesn't work with frozen cache")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this skipTest needed now but not before this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's because previously the cache was pre-populated with -sUSE_WEBGPU but we don't prepopulate it with --use-port=emdawnwebgpu (which would have to be done with several different flags too).

I can try to pre-populate the cache with the appropriate Emdawnwebgpu objects if you think that's appropriate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

emscripten/embuilder.py

Lines 103 to 104 in 3b22cd6

'libwebgpu',
'libwebgpu_cpp',

I think it comes from this? I don't think it'll be that easy to add Emdawnwebgpu here though.

Copy link
Collaborator Author

@kainino0x kainino0x Oct 3, 2025

Choose a reason for hiding this comment

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

Oh, it would be added via this

PORTS = sorted(list(ports.ports_by_name.keys()) + list(ports.port_variants.keys()))

Copy link
Collaborator

Choose a reason for hiding this comment

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

But the old code and the new code here both use --use-port=emdawnwebgpu.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, sorry, I missed which test this was. I actually have no idea. If I remove emdawnwebgpu from my local cache and run the old test (on main), it still fails with FROZEN_CACHE is set, but cache file is missing.

Could the @flaky be suppressing it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, CI has an explicit separate Embuilder step. Let me figure out how to test that locally and then see where I need to skip tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, I figured out which configurations don't get precached and skipped only those.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

... Although I did not figure out exactly why it was passing before and isn't now. @also_with_wasm64 isn't newly-added.

self.emcc(test_file('test_emdawnwebgpu_link_test.cpp'), ['--use-port=emdawnwebgpu', '-sASYNCIFY'] + args)

def test_signature_mismatch(self):
create_file('a.c', 'void foo(); int main() { foo(); return 0; }')
Expand Down
Loading