-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Roll Emdawnwebgpu and repoint USE_WEBGPU tests at Emdawnwebgpu #25397
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
Open
kainino0x
wants to merge
6
commits into
emscripten-core:main
Choose a base branch
from
kainino0x:roll-and-repoint-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+165
−287
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
595792c
Roll Emdawnwebgpu and repoint USE_WEBGPU tests at Emdawnwebgpu
kainino0x d12517b
stronger test that keepalives work correctly
kainino0x ef5a6da
Roll Emdawnwebgpu
kainino0x 4f93d5f
Skip with FROZEN_CACHE
kainino0x 3d62df6
Remove unneeded NO_DEFAULT_TO_CXX
kainino0x e817b60
Merge branch 'main' into roll-and-repoint-tests
kainino0x File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What to do about this long term?
Is this some fundamental difference between the old and new implementation? The only one manged to avoid depending on libc++ library functions but the new one did not? Are folks who use this library simply bound to link with C++?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question. I'm pretty sure your guess is correct - the old one only used
#include <array>
which probably didn't require any linking, but now we use a whole bunch of stuff, in particular<atomic>
and<mutex>
, at least one of which I believe requires linking.Technically we could remove those dependencies in single-threaded builds, but it's much easier for us to just rely on the compiler to handle those optimizations. (Though, mutexes might actually not be required until we have native multithreading in the browser's WebGPU but I'm not sure off hand. Atomics are used for refcounts which are needed even today.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do
<atomic>
and<mutex>
end up requiring library symbols at link time? If not maybe it could be a goal to avoid link-time libc++ symbols? Might be worth a try to see how hard it would be.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, I suppose I can check. I totally forgot what the original error message was that led me to add this.
wasm-ld: error: /Users/kainino/src/emscripten/cache/sysroot/lib/wasm32-emscripten/libemdawnwebgpu-ac372172-O0.a(webgpu.cpp.o): undefined symbol: operator new(unsigned long)
wasm-ld: error: /Users/kainino/src/emscripten/cache/sysroot/lib/wasm32-emscripten/libemdawnwebgpu-ac372172-O0.a(webgpu.cpp.o): undefined symbol: operator delete(void*, unsigned long)
... many copies of those lines
Those we certainly can't easily get rid of...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe you can? Maybe either by defining your own local versions of new and delete, or switching the placement new/delete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's probably possible, I (mostly) figured out how to overload the new/delete operators - but I read the output properly and realized it said I should pass
-error-limit=0
, so figured out how to do that (-Wl,--error-limit=0
) and here's the full (deduplicated) list:(TBH not sure where some of these things came from (like
__class_type_info
), there must be something in the STL.) Regardless I don't think it is really practical to avoid using libc++.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, yes if you are using STL types then you will need libc++ linked in.
The question is, is it intended to be able to use this port from C programs? I suppose the answer is yes, in which case we need to find a way to add
-lc++
when using the port. I believe this is the first port with this requirement.I imagine the right place to perform this injection would be
process_dependencies
but I'm not sure we have a mechanism to inject link flags like this.Oh way.. I think you can do
settings.LINK_AS_CXX = true
in the function! Can you try that?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh great idea, that works! It overrides
NO_DEFAULT_TO_CXX
for the rest of the program... but certainly easier to use. Will send a Dawn CL.