- Notifications
You must be signed in to change notification settings - Fork3.8k
wasm disable mutex usage, wasm CI updates#3203
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This might be a good place to make more WASM CI improvements like caching. @pmp-p please do review this PR |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-Authored-By: Paul m. p. Peny <16009100+pmp-p@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
Pass EMCC_CFLAGS, bump cython commit, generate libpygame.a too
Uh oh!
There was an error while loading.Please reload this page.
pmp-p commentedJun 10, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Great ! CI seems to work very fast. note : could they been non-pic ones ?https://github.com/pygame-web/python-wasm-sdk/blob/30145fd56a48c1608dae65c1cdf156f99467ea9b/scripts/emsdk-fetch.sh#L80 |
Uh oh!
There was an error while loading.Please reload this page.
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.
LGTM on a read through. Tricky for me to test it fully right now, so I'm leaving the details in the capable hands of our emscripten expert.
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.
Everything looks good on read through
Tricky for me to test it fully right now, so I'm leaving the details in the capable hands of our emscripten expert.
Same, same.
| #ifdefWITH_THREAD | ||
| /* | ||
| static void |
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.
Probably this commented code should have been removed.
I thought threads were supported on emscripten? I vaguely remember using them a long time ago... |
pmp-p commentedAug 28, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@illume in a way they are, but using them means crashes and most important losing dynamic linking ( but we still want numpy/pymunk and maybe others as shared modules and hopefully built and tested by upstream ) |
Ok. So I guess the guard should be slightly different to account for emscripten with threads? Do you have any links re the crashes or losing dynamic linking? |
pmp-p commentedAug 28, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
it'spossible but at the moment dynamic linking with preload plugins is quite broken on emscripten ( probably missing trampolines for 64bits return values from js ) : it happens quite often and patience is the key. I don't intend to even try threading again until wasm64 is out, stable and pyodide has battle tested against its sci-stack. Also actually using threading would mean lose real time input and sound fx (not music i've found a way) since to allow use spinlock+atomics in pygame thread it would have to run in a worker unless i'm wrong and a correct example is provided. old mobile devices dont like workers and atomics at all so i prefer actual solution to get wider adoption. imho threading + simd/neon should come last because it's the next stage of evolution and rely too much on host : webgpu and proper sound come first. |
Uh oh!
There was an error while loading.Please reload this page.
I added a mutex for event module in#3177 and this was not guarded on emscripten. This PR fixes this and also comments unneeded mutex create/destroy in imageext module.
The PR also makes it so that
set_timeralways fails on WASM now (because threading is an issue on WASM). This needs more work in the future, and possibly an alternate implementation to work better with the constraints of browsers.Following#3185, this makes WASM CI run only on source changes.
I (along with a lot of help from@pmp-p) also changed the CI to use
python-wasm-sdkprebuilts to save a lot of compile time on pygame CI, and added some cython (latest) build caching too. After this PR, our WASM builds should take around a minute, previously it took anywhere between 25 and 40 minutes (usually averaging out at 30 min)