lichess.org
Donate

Stockfish testing with multi-threaded WebAssembly

We're running another trial with multi-threaded WebAssembly for client-side Stockfish. If supported, it will be labeled WASMX (WebAssembly experiment) instead of PNaCl, WASM or ASMJS. It should work on:

* Chrome >= 70
* Firefox 65 with javascript.options.shared_memory enabled in about:config

I'd like to hear about any issues (outright bugs, as well as performance), so that we can prepare for the removal of PNaCl. The Chrome team moved the deadline to Q3 this year.

Edit: For interested developers: github.com/niklasf/stockfish.wasm
@nikolajtesla Thanks, that's a lot slower :( Can you please share details about your processor and browser version? Is that with the same number of threads?
Boy, this is fast as hell. It improved a lot for me with WASMX.

Good job!
@revoof chrome version 71.0.3578.98
It was for the same number of threads/CPUs (6 out of 7).
The processor is IntelCore i76700k CPU4.00Ghz

Btw, are you a right person to ask questions about cloud analysis?
Unfortunately, WASMX performance seems less than half as fast as PNaCl based on an initial check, but that's just a guesstimate. (In both cases, I had the engine set to use 2 CPUs). This is pretty similar to the last time Lichess tested WASMX.

On the plus side, this time around I haven't yet noticed the bug where the engine hangs or takes an inordinately long time to load.

I haven't used it much yet so that's just my initial impression. I'll post an update if I notice anything else.

Chrome 72.0, 1.6 GHz Core i5.
Let's make it clear. It is not the analysis speed in terms of kNodes/sec that got better. But the whole load time of the engine. In the old days this little progress bar went on for ages before the anlaysis of the position finally started. Now it is almost immediate. When I switch between positions, the analysis also switches quickly.

If one wants real substantial analysis then use a desktop gui. The important thing for in browser analysis is no engine load overhead and quick swtiching between positions.
Thanks for the feedback, everyone. I agree that stability and responsiveness are more important than raw NPS, but a 2x slowdown (or more) is a bit much of a regression. I hope we can get much closer to native speed.

@nikolajtesla Regarding cloud analysis, it depends. What do you want to know?
@revoof I am a big fan of cloud analysis and think that this is an amazing feature which allows players to learn openings in details. But I am confused by the artificial limitations which lichess imposes. Here are the limitations:

- it is limited to move 7: lichess.org/forum/lichess-feedback/why-is-cloud-analysis-limited-to-move-7 . In many popular openings (Alekhine, Ruy Lopez), move 7 is just a a beginning of the opening.
- even if the you are below move 7, all the evaluations above and below 1 pawn advantage are not saved. This prevents people from learning how to capitalize on the inaccuracies of the openings and gives them a false sense of correctness. A cloud analysis might show the evaluation as 0.7 which looks like not a big deal, but in fact it is closer to 1.6.

This topic has been archived and can no longer be replied to.