REGRESSION (Safari 17): WASM intermittent failure transcoding basis file
https://bugs.webkit.org/show_bug.cgi?id=260252
Summary REGRESSION (Safari 17): WASM intermittent failure transcoding basis file
Donovan Hutchence
Reported 2023-08-16 03:05:35 PDT
Created attachment 467286 [details] html demonstrating intermittent failure We have found basis transcode fail intermittently in Safari 17 TP running on MacOS 13.5. This appears to be a regression: code and asset is unchanged and runs fine on Chrome, Firefox and Safari 16. Please find attached a cut-down example. It loads and transcode a single basis file in a webworker using PlayCanvas. The app logs success or failure result to the console.
Attachments
html demonstrating intermittent failure (1.14 KB, text/html)
2023-08-16 03:05 PDT, Donovan Hutchence
no flags
debuggable (1.27 MB, application/zip)
2023-09-25 16:03 PDT, Justin Michaud
no flags
Disassembly with good/bad path (48.06 KB, text/plain)
2023-09-25 16:56 PDT, Justin Michaud
no flags
simplified repro (1.61 KB, application/x-javascript)
2023-09-26 19:47 PDT, Justin Michaud
no flags
Radar WebKit Bug Importer
Comment 1 2023-08-16 18:21:49 PDT
Alexey Proskuryakov
Comment 2 2023-08-16 18:23:01 PDT
Thank you for the test that easily reproduces the issue!
Donovan Hutchence
Comment 3 2023-09-20 01:42:51 PDT
Hello, Any updates on this issue? Can you suggest any workarounds (seeing as iOS 17.0 has now been released)? Thanks, Donovan
cheryl
Comment 4 2023-09-25 06:00:03 PDT
All 3d models on our playcanvas project showing white texture. 3d rendering unworkable in iOS 17/playcanvas. Please address as high priority.
Donovan Hutchence
Comment 5 2023-09-25 06:46:07 PDT
For playcanvas users, we found a possible mitigation for basis transcode (testing is ongoing). Please see https://github.com/playcanvas/engine/pull/5657 for more info.
Justin Michaud
Comment 6 2023-09-25 15:42:50 PDT
This is likely caused by a regression in the new BBQ jit. This configuration works: ``` __XPC_JSC_useBBQJIT=0 __XCP_JSC_validateOptions=1 /Applications/Safari\ Technology\ Preview.app/Contents/MacOS/Safari\ Technology\ Preview ``` I will try to narrow down where in the test case execution diverges.
Justin Michaud
Comment 7 2023-09-25 16:03:05 PDT
Created attachment 467857 [details] debuggable
Justin Michaud
Comment 8 2023-09-25 16:03:34 PDT
I recompiled the module with binaryen to try to debug it, but that makes the issue go away bin/wasm-opt ~/Desktop/basis.wasm.wasm.orig -o ~/Desktop/basis.wasm.wasm --enable-simd --disable-gc --log-execution --instrument-memory So it seems to be some kind of control flow bug
Justin Michaud
Comment 9 2023-09-25 16:28:48 PDT
I have discovered the culprit: __XPC_JSC_useWasmLLInt=1 __XPC_JSC_wasmFunctionIndexRangeToCompile=76:76 __XPC_JSC_useConcurrentJIT=0 __XPC_JSC_useOMGJIT=0 __XCP_JSC_validateOptions=1 /Applications/Safari\ Technology\ Preview.app/Contents/MacOS/Safari\ Technology\ Preview
Justin Michaud
Comment 10 2023-09-25 16:56:52 PDT
Created attachment 467861 [details] Disassembly with good/bad path
Justin Michaud
Comment 11 2023-09-26 19:47:49 PDT
Created attachment 467887 [details] simplified repro
Note You need to log in before you can comment on or make changes to this bug.