Skip to content

Roll Emdawnwebgpu and repoint USE_WEBGPU tests at Emdawnwebgpu - #25397

Merged
kainino0x merged 20 commits into
emscripten-core:mainfrom
kainino0x:roll-and-repoint-tests
Oct 16, 2025
Merged

kainino0x merged 20 commits into
emscripten-core:mainfrom
kainino0x:roll-and-repoint-tests

Conversation

@kainino0x

@kainino0x kainino0x commented Sep 26, 2025 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator Author

@lokokung PTAL

Comment thread test/webgpu_required_limits.c Resolved
@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
Comment thread test/test_browser.py Resolved
Comment thread tools/ports/emdawnwebgpu.py Resolved
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 <[email protected]>
Commit-Queue: Kai Ninomiya <[email protected]>
@kainino0x
kainino0x requested a review from sbc100 October 3, 2025 19:50
Comment thread test/test_other.py Resolved

@sbc100 sbc100 left a comment

Copy link
Copy Markdown
Collaborator

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?

Comment thread test/test_browser.py Resolved
Comment thread test/test_other.py Resolved
Comment thread test/test_other.py
'-Wno-error=deprecated',
'-sINCLUDE_FULL_LIBRARY',
'-sUSE_WEBGPU',
'--use-port=emdawnwebgpu',

Copy link
Copy Markdown
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
Copy Markdown
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).

Comment thread test/test_other.py
'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
Copy Markdown
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
Copy Markdown
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.

Comment thread test/test_other.py
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@kainino0x kainino0x Oct 3, 2025 •

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread test/webgpu_required_limits.c Resolved
Comment thread test/webgpu_basic_rendering.cpp Resolved
@juj

juj commented Oct 3, 2025

Copy link
Copy Markdown
Collaborator

@juj might have some opinions?

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

@kainino0x

Copy link
Copy Markdown
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
@kainino0x
kainino0x requested a review from sbc100 October 9, 2025 00:44

@sbc100 sbc100 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm % comments

Comment thread test/test_browser.py Resolved
Comment thread test/test_other.py Resolved
Comment thread test/test_other.py Resolved
@kainino0x
kainino0x requested a review from sbc100 October 9, 2025 22:23
@kainino0x

Copy link
Copy Markdown
Collaborator Author

@sbc100 bump!

@kainino0x
kainino0x merged commit 3b36064 into emscripten-core:main Oct 16, 2025
@kainino0x
kainino0x deleted the roll-and-repoint-tests branch October 16, 2025 18:44
@kainino0x

Copy link
Copy Markdown
Collaborator Author

I guess I should have rebased and rerun CI before landing... something broke on main. Seems to be cache related again. Looking into it.

@sbc100

sbc100 commented Oct 16, 2025

Copy link
Copy Markdown
Collaborator

Yes, it looks kind of odd yes. I see cache:INFO: deleting cached file: C:\Users\circleci\cache\sysroot\lib\wasm32-emscripten\libemdawnwebgpu-50506ac3-O0.a after it was built...

@kainino0x

Copy link
Copy Markdown
Collaborator Author

Good catch. Unfortunately no luck so far reproducing this locally on Windows. I'm not entirely clear from the logs if there's an interaction between different tests or not.

@kainino0x

kainino0x commented Oct 16, 2025 •

Copy link
Copy Markdown
Collaborator Author

Ah, just realized this is probably a flake. I think the first failure I saw on #25398 was the same, but after rerunning it, I got something else:

FAIL [14.583s]: test_embuilder_wildcards (test_sanity.sanity)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/project/test/test_sanity.py", line 766, in test_embuilder_wildcards
    self.assertEqual(len(glob.glob(glob_match)), 1)
AssertionError: 30 != 1

and this test passed.

@sbc100

sbc100 commented Oct 16, 2025

Copy link
Copy Markdown
Collaborator

That assertions looks very odd. Line 766 of test_sanity.py reads self.assertGreater(len(glob.glob(glob_match)), 3), not self.assertEqual(len(glob.glob(glob_match)), 1).

@kainino0x

Copy link
Copy Markdown
Collaborator Author

Ohh wait, this flake was the existing one from #25343. I forgot about that and didn't read it closely so I didn't realize it was doing the same thing.

@kainino0x

Copy link
Copy Markdown
Collaborator Author

The test_embuilder_wildcards flake I don't have any clue about.

@kainino0x

Copy link
Copy Markdown
Collaborator Author

The next commit on main (0b127ff) passed CI. (I also retriggered CI on my commit so it might show as passing too once it's done)

inolen pushed a commit to inolen/emscripten that referenced this pull request Feb 13, 2026
…ipten-core#25397)

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.

Emdawnwebgpu roll includes:
- `` bb3dc45 [emscripten] Use Emscripten `diagnostics.error` instead of
`raise` ``
- ``a3650c0 [emscripten] Error on LINK_AS_CXX=0 in
emdawnwebgpu.port.py``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants