RESOLVED FIXED 267323
REGRESSION(270429@main): [Win Wasm] Nothing is shown in https://threejs.org/examples/#webgl_animation_keyframes
https://bugs.webkit.org/show_bug.cgi?id=267323
Summary REGRESSION(270429@main): [Win Wasm] Nothing is shown in https://threejs.org/e...
Fujii Hironori
Reported 2024-01-10 01:33:26 PST
[Win] Nothing is shown in https://threejs.org/examples/#webgl_animation_keyframe 1. Start WinCairo Release MiniBrowser 2. Load https://threejs.org/examples/#webgl_animation_keyframe 3. Select the first demo 4. No object is shown I did bisecting with my WinCairo collection. 270065@main good 270682@main bad
Attachments
instantiate in worker fails (1.65 KB, application/x-zip-compressed)
2024-08-16 09:09 PDT, Ian Grunert
no flags
Fujii Hironori
Comment 1 2024-01-10 22:14:38 PST
270429@main is the regression point.
Ian Grunert
Comment 2 2024-01-16 10:44:20 PST
Looks like if webassembly is available it uses a wasm decoder for 3D meshes https://github.com/mrdoob/three.js/tree/534737d242a82239d7e89457ba6005810a361153/examples/jsm/libs/draco So something in Windows LLInt breaks on that wasm.
Radar WebKit Bug Importer
Comment 3 2024-01-17 01:34:16 PST
Fujii Hironori
Comment 4 2024-03-13 14:33:48 PDT
This problem can be worked around by disabling WASM. $env:JSC_useWebAssembly = 0
Ian Grunert
Comment 5 2024-08-14 11:18:10 PDT
This is still an issue on main after the changes to switch to SystemV ABI JSC on Windows. Doesn't repro on Epiphany running under WSL either, so seems Windows-specific rather than something in x86_64.
Ian Grunert
Comment 6 2024-08-16 09:09:47 PDT
Created attachment 472191 [details] instantiate in worker fails Here's a minimal repro - WebAssembly.instantiate doesn't work within a Web Worker on Windows.
Ian Grunert
Comment 7 2024-08-19 17:18:39 PDT
The callback scheduled in JSWebAssembly.cpp compileAndInstantiate via vm.deferredWorkTimer->scheduleWorkSoon is never called: https://github.com/WebKit/WebKit/blob/main/Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp#L255-L275 After vm.deferredWorkTimer->scheduleWorkSoon is called, DeferredWorkTimer::doWork is never called. This is also a problem for compileStreaming which uses the deferredWorkTimer as well. The docs for SetTimer state the HWND passed must be owned by the calling thread; we're trying to use the parent's runloop here from the web worker thread. https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-settimer A possible fix: We could store the thread id that owns the runloop. If you try and set a timer from a different thread, we could PostMessageW to the window a ScheduleTimerMessage (that we define like we do for PerformWorkMessage) which could then call SetTimer from the correct thread.
Ian Grunert
Comment 8 2024-08-22 13:14:50 PDT
EWS
Comment 9 2024-08-29 07:52:36 PDT
Committed 282906@main (f659dfd72562): <https://commits.webkit.org/282906@main> Reviewed commits have been landed. Closing PR #32602 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.