# Stockfish.js — corresponding source

The files in this directory are distributed unmodified from the npm package
`stockfish@18.0.8` (GPL-3.0, see `COPYING.txt`). Checksums are in `MANIFEST.json`.

| File | Origin |
|---|---|
| `stockfish-18-lite-single.js` | npm `stockfish@18.0.8`, `bin/stockfish-18-lite-single.js` |
| `stockfish-18-lite-single.wasm` | npm `stockfish@18.0.8`, `bin/stockfish-18-lite-single.wasm` |

## Corresponding source

- Stockfish.js (build scripts and engine port): https://github.com/nmrugg/stockfish.js/tree/v18.0.8
  - tag `v18.0.8` → tag object `6e2146a174a3f50070116669c32aad69ea1c2c62`
  - which points to commit `93c994592dcf3b4b21052ab925e9b534df9c0918`
    (https://github.com/nmrugg/stockfish.js/commit/93c994592dcf3b4b21052ab925e9b534df9c0918),
    identical to the `gitHead` recorded in the npm package metadata.
- Upstream Stockfish: https://github.com/official-stockfish/Stockfish
  - The repository has no git submodules: the Stockfish 18 C++ sources are vendored in its `src/`
    directory. The repository does not record an upstream commit hash; the upstream release it is
    based on is Stockfish 18 (tag `sf_18`, commit `cb3d4ee9b47d0c5aae855b12379378ea1439675c`).
- Embedded NNUE network: `nn-9067e33176e` by Linmiao Xu (linrock),
  https://tests.stockfishchess.org/nns?network_name=nn-9067e33176e

## Self-hosted copy of the corresponding source

So that the source stays available regardless of third-party hosting, we serve a copy:

- File: [`source/stockfish.js-18.0.8-src.tar.gz`](source/stockfish.js-18.0.8-src.tar.gz)
  (6,022,035 bytes)
- SHA-256: `c5540cdf2e68985b17f3289e993299144e7025f7632d71439006d8ce643f2f2e`
- Content: unmodified snapshot of https://github.com/nmrugg/stockfish.js at commit
  `93c994592dcf3b4b21052ab925e9b534df9c0918` (tag `v18.0.8`), fetched on 2026-10-27 from GitHub's
  archive of that commit. It contains the Stockfish C++ sources (`src/*.cpp`, `src/nnue/`,
  `src/syzygy/`), the Emscripten glue (`src/emscripten/`), the build script (`build.js`), the
  licence (`Copying.txt`) and the embedded network `src/nn-9067e33176e8.nnue`.
  `SOURCE-NOTES.txt` at the archive root was added by us and describes the snapshot.
- Embedded network: `nn-9067e33176e8.nnue` (6,617,595 bytes, SHA-256
  `9067e33176e8c5edb7aa8db6a3aedd012f84a1f39872e86357c6c2d0993f314d`), trained by Linmiao Xu
  (linrock) and published on the Stockfish testing site under the same GPL-3.0 terms as
  Stockfish. Original download:
  https://data.stockfishchess.org/nn/nn-9067e33176e8.nnue
- Rebuild: install Emscripten 3.1.7, extract the archive, then run
  `node build.js --single-threaded --lite -f` (equivalent to `npm run build-single-lite`).
  The output is `stockfish-18-lite-single.js` and `.wasm`.

Stockfish.js 18 (c) 2026 Chess.com, LLC. Based on Stockfish (c) T. Romstad, M. Costalba,
J. Kiiski, G. Linscott and other contributors. Licensed under the GNU General Public
License version 3; the full text is in `COPYING.txt`.

The engine runs as a separate Web Worker and communicates with the rest of the site only
through UCI text messages. To refresh these files run `node scripts/sync-engine.mjs`.
