On WebAssembly the engine is a Web Worker: a line of UCI is one message each way, the protocol machine is driven by the worker's messages and by timers set for its deadlines; the handshake does not block (Engine::start_worker gives a Starting, polled until readyok). EngineHandle has the same methods as the process one, minus those that block or name a process. Option and search checks are shared by both transports. tests/worker.rs runs the worker transport against a fake engine in JavaScript in headless Firefox (apps/web/check/uci-worker.mjs: wasm-bindgen-test-runner serves, a WebDriver BiDi client reads the outcome): handshake, analysis and stop, coalescing of rapid requests without mixing output, an engine hung on stop, a crash, and every handshake failure. 5 of 5 pass. game-review: the job in engine processes (run and its workers) moves to job/engines.rs, built where there are processes. .cargo/config.toml: the getrandom backend of WebAssembly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 lines
467 B
TOML
9 lines
467 B
TOML
# Windows: the C runtime is linked into the executable, so it starts on a Windows
|
|
# without the Visual C++ Redistributable (VCRUNTIME140.dll).
|
|
[target.x86_64-pc-windows-msvc]
|
|
rustflags = ["-C", "target-feature=+crt-static"]
|
|
|
|
# WebAssembly in a browser: random numbers from crypto.getRandomValues (getrandom 0.3
|
|
# needs this as well as its `wasm_js` feature, enabled by apps/web).
|
|
[target.wasm32-unknown-unknown]
|
|
rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""]
|