Skip to content

Conversation

kainino0x
Copy link
Collaborator

@kainino0x kainino0x commented Sep 26, 2025

In preparation to remove USE_WEBGPU entirely (#24265). Ideally these tests would live in Dawn, but we don't have a way to automate tests in the browser yet, so for the moment we'll keep them in Emscripten.

Emdawnwebgpu roll includes:

  • bb3dc45 [emscripten] Use Emscripten `diagnostics.error` instead of `raise`
  • a3650c0 [emscripten] Error on LINK_AS_CXX=0 in emdawnwebgpu.port.py

In preparation to remove USE_WEBGPU entirely (emscripten-core#24265). Ideally these
tests would live in Dawn, but we don't have a way to automate tests in
the browser yet, so for the moment we'll keep them in Emscripten.

DO NOT SUBMIT: Needs Emdawnwebgpu roll in order to pass
@kainino0x
Copy link
Collaborator Author

@lokokung PTAL

@kainino0x kainino0x force-pushed the roll-and-repoint-tests branch 2 times, most recently from a88588a to ffb124d Compare September 26, 2025 18:51
@kainino0x kainino0x force-pushed the roll-and-repoint-tests branch from ffb124d to d12517b Compare September 26, 2025 18:55
@kainino0x kainino0x force-pushed the roll-and-repoint-tests branch from 3b2d73d to 4c7bf8a Compare September 27, 2025 06:01
@kainino0x kainino0x force-pushed the roll-and-repoint-tests branch from 4c7bf8a to 4f93d5f Compare September 27, 2025 06:53
@kainino0x kainino0x requested a review from sbc100 September 27, 2025 08:58
@kainino0x kainino0x marked this pull request as ready for review September 27, 2025 08:58
copybara-service bot pushed a commit to google/dawn that referenced this pull request Oct 2, 2025
webgpu.cpp uses C++ library functions, so it needs to be linked with C++
support, otherwise it gets a long list of missing C++ STL symbol errors.
Make this an explicit error so people know what to do if they get this
error (because they're using -sSTRICT or -sNO_DEFAULT_TO_CXX).

Initial discussion:
emscripten-core/emscripten#25397 (comment)

Bug: none
Change-Id: I99b766298f47b946e0ba49eacad04fe8b427f6de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/264434
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
@kainino0x kainino0x requested a review from sbc100 October 3, 2025 19:50
Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

I'm not really qualified to read the .c/.cpp changes to the test files, so I'll have to take your word for it mostly that they good.

@juj might have some opinions?

'-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).

'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.

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.

@juj
Copy link
Collaborator

juj commented Oct 3, 2025

@juj might have some opinions?

LGTM with the test changes - looks like they're effectively refactoring callbacks to lambdas.

@kainino0x
Copy link
Collaborator Author

LGTM with the test changes - looks like they're effectively refactoring callbacks to lambdas.

Mainly yes. But also taking advantage of keepalives to let a bunch of async stuff finish before the test completes (without using asyncify).

@kainino0x kainino0x force-pushed the roll-and-repoint-tests branch from 2b69827 to 8ebf5ef Compare October 4, 2025 00:58
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.

4 participants