Bug 222382 - WebAssembly: SIMD support
Summary: WebAssembly: SIMD support
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P1 Normal
Assignee: Justin Michaud
URL:
Keywords: BrowserCompat, InRadar
: 234790 (view as bug list)
Depends on: 233829 245897 246343 246345 246346 246347 246348
Blocks:
  Show dependency treegraph
 
Reported: 2021-02-24 14:24 PST by Sergey Rubanov
Modified: 2023-02-03 02:42 PST (History)
29 users (show)

See Also:


Attachments
SIMD Megapatch WIP 1 (268.05 KB, patch)
2022-01-14 12:18 PST, Justin Michaud
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Wasm SIMD Megapatch 1.1 (277.05 KB, patch)
2022-01-14 14:18 PST, Justin Michaud
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
SIMD Megapatch 1.2 (277.04 KB, patch)
2022-01-14 14:31 PST, Justin Michaud
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
SIMD Megapatch WIP 1.3 (276.46 KB, patch)
2022-01-14 15:04 PST, Justin Michaud
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
SIMD Megapatch 1.4 (no imported tests) (723.04 KB, patch)
2022-03-03 11:17 PST, Justin Michaud
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Rubanov 2021-02-24 14:24:39 PST
SIMD is on phase 4 now.

https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md

Chrome is going to ship it in v91 (May 25)
Firefox is going to ship x86 SIMD in v89 (May 18) and ARM64 SIMD in Firefox 90 (June 15)
Comment 1 Radar WebKit Bug Importer 2021-03-03 14:25:16 PST
<rdar://problem/75003618>
Comment 2 Sergey Rubanov 2021-07-14 09:51:59 PDT
SIMD was promoted to phase 5 today and it will be merged to spec soon
Comment 3 MaxGraey 2021-07-28 03:15:13 PDT
Fixed SIMD currently supports (or will soon come out from under the flag) by all runtimes except Safari:
https://webassembly.org/roadmap
Comment 4 Vladimir Prelovac 2021-11-14 23:05:02 PST
Wanted to give a vote for SIMD support from a user perspective.

lichess.org which is the biggest, open-source, chess community on the web, has in-browser analysis for chess games using Stockfish NNUE (strongest chess engine) available only for WASM SIMD browsers, which sadly means not WebKit forcing me to use a Blink browser on a Mac to analyze chess games.
Comment 5 Vladimir Prelovac 2021-12-03 10:36:01 PST
I see the card got updated.

Here is an example to check SIMD support.


https://lichess.org/study/7WCFYt0R/XVxUIL9r

In Chrome this uses StockFish NNUE for analysis, with a much detailed analysis. In Safari currently just StockFish.
Comment 6 Yusuke Suzuki 2022-01-02 00:27:38 PST
*** Bug 234790 has been marked as a duplicate of this bug. ***
Comment 7 Justin Michaud 2022-01-14 12:18:18 PST
Created attachment 449200 [details]
SIMD Megapatch WIP 1

WIP patch supporting v128.const and i8x16.ExtractLane, but with many bugs. 

Spilling and filling is currently not even close to correct, and callee-save fp registers on arm are also completely wrong. There are also probably a bunch of places where even simple control flow will cause a crash.

I am working on fixing the long list of bugs next, but this patch should hopefully be in a somewhat hackable state.
Comment 8 EWS Watchlist 2022-01-14 12:19:38 PST Comment hidden (obsolete)
Comment 9 Justin Michaud 2022-01-14 12:36:34 PST
simdOpcodes.csv is exported from https://docs.google.com/spreadsheets/d/1mItAPDDyUD97QdtB9yp44utTP9vRRS9XMv0YZ_ePz9s/edit?usp=sharing
Comment 10 Justin Michaud 2022-01-14 14:18:09 PST
Created attachment 449222 [details]
Wasm SIMD Megapatch 1.1

Let's try this again EWS
Comment 11 Justin Michaud 2022-01-14 14:31:34 PST
Created attachment 449226 [details]
SIMD Megapatch 1.2
Comment 12 Justin Michaud 2022-01-14 15:04:42 PST
Created attachment 449230 [details]
SIMD Megapatch WIP 1.3
Comment 13 Justin Michaud 2022-03-03 11:17:01 PST
Created attachment 453765 [details]
SIMD Megapatch 1.4 (no imported tests)

I removed 38mb of imported v8 tests from the diff so that I could actually upload the patch
Comment 14 Sanjay Kumar 2022-05-12 14:01:41 PDT
I hope this is done soon.

Safari is the only browser left that does not support SIMD and without it we can not release so many performance enhancements to our Pilot navigation App (AvNav).

We use SIMD to speed up Martini (Delauney) terrain mesh generation and it accelerates things by factor of 2-3 which is precious knowing how demanding terrain rendering can be.

We are using JPEG XL for our raster/image formats which cuts down image sizes by 60-70% (and helps us stay within Safari's 1 GB storage limit). libjxl the reference implementation of JPEG XL is 3x faster with SIMD - its only image format optimized for SIMD (reason we chose it) but there will be others (AVIF ?)

SIMD is very important (given hassles/limitations of SharedArrayBuffers).

Apple please add support for SIMD ASAP - no more delays please.
Thank you!
Comment 15 Vladimir Prelovac 2022-05-12 14:04:16 PDT
Came here to vote support for SIMD in WebKit. Go Justin!
Comment 16 Robert Knight 2022-05-31 00:33:16 PDT
I am interested in testing this when available. https://robertknight.github.io/tesseract-wasm/ is a demo that uses a WebAssembly build of the Tesseract OCR engine. It runs approximately 2-2.5x faster in Chrome and Firefox than Safari due to use of SIMD.
Comment 17 Vladimir Prelovac 2022-09-30 13:53:29 PDT
Looks like all blockers have been removed now, hoping to see this land soon!
Comment 18 Karl Dubost 2022-10-03 22:10:22 PDT
This creates a WebCompat issue for a number of projects depending on 
https://github.com/Volcomix/virtual-background
used by projects like
https://github.com/bigbluebutton/bigbluebutton
Comment 19 Justin Michaud 2022-12-23 10:48:57 PST
All features are landed in ToT, and we are now looking to fix as many bugs as possible.