lichess.org

Stockfish 13 NNUE on Lichess

@revoofTechnical

The latest release of the strong open source engine is now available in your browser!

We congratulate the Stockfish developers for their latest release, Stockfish 13. Check out the release announcement for details.

Client-side analysis

Securely running programs like Stockfish in your browser requires them to be ported to JavaScript and/or WebAssembly (WASM). Previously this would disproportionately slow down NNUE. The slowdown has been fixed thanks to a recent contribution, so we can now provide Stockfish 13 NNUE for modern browsers.

Note that NNUE is most likely crunching fewer nodes per second than Stockfish with classical evaluation, but it is stronger nonetheless.

The implementation uses WASM SIMD, which allows efficiently applying the same CPU instruction to multiple pieces of data, speeding up the evaluation of the neural network.

When we last reported on the status of NNUE in WASM , the prototype was letting Emscripten choose the instructions based on the x86-targeted code, and failing to achieve good results. Now the proper WASM SIMD instructions are picked by hand using compiler intrinsics.

Computing a dot product with WASM SIMD intrinsics

Using NNUE will require a download of about 10 MB (20 MB uncompressed) for the neural network file. We will refrain from using NNUE, if your browser communicates that your device is in save data mode.

Update 6th Mar: There is now a "Use NNUE" toggle in the engine settings, that can override save data mode.

Using in Chromium, Chrome (except on iOS), and Edge

Requires version 88. WASM SIMD should work out of the box, because Lichess is participating in an Origin Trial for chrome://flags/#enable-webassembly-simd.

Update 23th Feb: Some Android users have reported that updating to Chrome 89 Beta was required.

Firefox

Firefox users will need more patience. If you’re feeling adventurous, you can enable  javascript.options.wasm_simd in about:config. We have tested this with Firefox 85, but note that Firefox does not guarantee stability or security when tinkering with these flags.

Other browsers

Other browsers do not yet support WASM SIMD and will fall back to other Stockfish builds. We do not plan to update the fallbacks, so the gap in strength will grow as Stockfish progresses. This applies also to classical evaluation in newer Stockfish versions, since NNUE-specific search optimizations can be detrimental to classical evaluation strength. Here is the definitive list of available builds on Lichess, best to worst.

Update 23th Feb: Downgraded HCE build from Stockfish 12 to the optimal branching point for handcrafted evaluation (SF_classical). Later NNUE-specific search optimizations would lose Elo when not using NNUE.

TagSourceStockfish versionTech
NNUEhi-ogawa/Stockfish13+Multi-threaded WASM. Uses SIMD. Strongest.
HCEniklasf/stockfish.wasm11+ (SF_classical)Multi-threaded WASM, but using the classical handcrafted evaluation function. A multi-variant build is also used for chess variants.
WASMniklasf/stockfish.js10+Slower-single threaded WASM fallback.
ASMJSniklasf/stockfish.js10+Extremely slow pure JavaScript fallback.

Server-side analysis

Unlike client side analysis, when you click “request a computer analysis”, analysis is handled by a user sharing their computing power using the fishnet client. A new version (fishnet 2.2.5) with Stockfish 13 (using NNUE, just like the previous version) was published on the day of release.

Number of fishnet contributors for each version. See how the rising yellow line with Stockfish 13 is overtaking all other versions as contributors are updating their clients.

Reconnecting