# Browser YaneuraOu corresponding source

This archive corresponds to the Shoginote Wasm built 2026-11-04.
Upstream: yaneurao/YaneuraOu, commit 3a0e4fd2394e40f72fc6e2ad5aada832b4045cd9.
Upstream archive SHA-256: 05a7fd9f3566c417901c0c11949528a90b261ed4ce2038ed30f5c056720a538e.
The engine directory contains the complete upstream sources with the listed browser changes applied.
No temporary instrumentation is included. engine-changes.patch records every changed upstream source file.

Run ./rebuild.sh with official Emscripten 6.0.13, make and Python 3 on PATH.
SDK tag commit: 35659964bc2762fffec0d257997fb61475f765b7.
Compiler reports: Emscripten 6.0.13 (e13ee988ce3d87a738dd8f3661d02223308c412a).
The compiler SDK is a general-purpose build tool and is not included in this archive.
https://github.com/emscripten-core/emsdk

Browser-specific changes (2026-11-04):
- Explicit Emscripten incoming API list (STRICT mode otherwise drops preRun/postRun and loader callbacks), including noExitRuntime. The runtime stays alive after main returns so its preloaded pthread pool survives until explicit termination.
- Two pre-created runtime pthread Workers allow thread replacement without waiting for a new Worker load; exactly one engine search thread (USI Threads default/max 1). USI_Hash default32MB/max128MB.
- Main and pthread stack16MiB; initial memory132MiB, growing to maximum512MiB.
- wasm_pre.js only installs the command/print adapter on the owning runtime, not on pthreads.
- USI PV/iteration/bestmove delivery uses asynchronous Module.print in Wasm to avoid search-pthread synchronous filesystem/stdout proxy blocking. Native builds retain ordinary stdout.
- Wasm initialization omits the desktop GUI keepalive helper pthread; the owning browser Worker already isolates the heavy load. Native keepalive behavior is unchanged.
- wrapper/pthread.js explicitly preserves the Emscripten pthread identity and imports the same cache-versioned runtime script.
- wrapper/worker.js exposes a classic same-origin Worker USI transport, verifies model SHA-256, loads MEMFS /eval, sets EvalDir=/eval and FV_SCALE=24, forwards progress/errors, and supports quit/termination.
- Search algorithm and NNUE numerical evaluation are unchanged.

Models: TsuyouraOu11micro SFNN_ka2_2048_8_64_progress8 epoch0010 20261001.
The author explicitly grants MIT for nn.bin and progress.bin at https://yaneurao.fanbox.cc/posts/12761272.
Both parameter files are included unchanged. The original banner is not distributed.
See notices for complete GPL, MIT, Emscripten and linked runtime license texts.

Runtime API: new Worker('/engines/yaneuraou/worker.js')
Messages to Worker: {type:'command', command:'usi'} (one USI line; never concurrent searches).
Messages from Worker: {type:'ready'}, {type:'line',line}, {type:'status',message}, {type:'error',message}.
ready means native USI entry exists; the caller must still do usi/options/isready and wait for readyok.
A stop must be followed by bestmove before issuing the next position/go; terminate a nonresponsive worker.
This build requires Wasm SIMD, SharedArrayBuffer, and cross-origin isolation on document, Worker and engine responses.
Serve with Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp.

This archive covers the engine build and browser transport. It does not assert a license boundary for the enclosing site application.
