# Fairy-Stockfish single-thread (browser WASM)

This folder is the engine the page loads for vs-AI play and hints. It is one search thread and does not use SharedArrayBuffer. The multi-thread build remains in `../fairy-stockfish/` and is not loaded.

## Upstream

- Fairy-Stockfish: https://github.com/fairy-stockfish/Fairy-Stockfish
- WASM packaging: https://github.com/fairy-stockfish/fairy-stockfish.wasm branch `nnue` at `4d4b393`
- Xiangqi net: `../fairy-stockfish/xiangqi.nnue` (CC0-lineage `xiangqi-c07e94a5c7cb`). Loaded at runtime as `/xiangqi.nnue`. Not embedded in the wasm.

## Changes in this build

`single-thread.patch` is the diff against that commit. Search runs on the UCI caller instead of `std::thread`. `Threads` above 1 is clamped to 1. `stop` is a flag checked from `MainThread::check_time`, which calls `emscripten_sleep(0)` about every 30ms so a running search can return. The wasm is built with Emscripten 6.0.11, `USE_PTHREADS` off, Asyncify on, and no embedded net.

## Licence

GNU General Public License v3.0. Full text: `COPYING`. Authors: `AUTHORS`.

Fairy-Stockfish and its authors do not endorse this site.
