Multi-threaded engine, fix lost-stop timeouts, auto update check (v1.1.0) - #1
Merged
Merged
Conversation
…1.0) Engine speed and strength: - The app was shipping the single-threaded Stockfish build (the committed public/stockfish.* matched stockfish-18-single), so Threads was ignored. Switch to the multi-threaded NNUE build: ~4x nodes/sec on 4 cores. - Serve/copy the engine from the stockfish npm package via a Vite plugin instead of committing a 113MB LFS blob. - Wait for readyok after Threads/Hash at startup and drop the redundant ucinewgame that re-cleared the 512MB hash (warm start ~3.5s). Reliability (analysis failing after moving quickly): - The worker queues `go` while a search unwinds but runs `stop` at once, so a stop could be lost; the 3s stop watchdog then restarted the engine and analysis failed. Re-send `stop` every 100ms until its bestmove and raise the stop watchdog to 8s. Regression tests with a fake worker that mirrors the real command queueing. - A final result whose lines all fail the legality filter now surfaces a retry warning instead of spinning forever. App: - Think time setting (1/3/5/10s); shorter analysis debounce. - Automatic update check at startup (toggleable), with a banner and a dot on the settings gear when a newer release exists. - Electron: fixed port so settings persist across launches and the WASM code cache works; streamed files with ETag; single-instance lock. - Bundle fonts locally (Google Fonts was blocked by the app's CSP/COEP). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ZHKbLKcpoa8QJGzqkbDTJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes analysis timing out after moving quickly. The stockfish.js worker queues
gowhile a previous search is still unwinding, but runsstopimmediately. That meant astopcould land before the search it was meant for and be lost. The 3s stop watchdog then rebuilt the engine (recompiling the 113MB WASM) and analysis failed. I reproduced it in Chromium: on the old code, 16 of 35 rapid positions got no analysis. Changes:stopis re-sent every 100ms until itsbestmovearrives, and the stop watchdog is raised to 8s.src/engine/stockfish.test.ts) use a fake worker that mirrors the real command queueing. They fail without the fix.Engine speed and strength
public/stockfish.*byte-matchedstockfish-18-single), so theThreadsoption was ignored. It now uses the multi-threaded NNUE build: about 4× nodes/sec on 4 cores.stockfishnpm package by a Vite plugin, replacing the committed 113MB LFS blob..gitattributesand the LFS checkout in the workflows are removed.readyokafterThreads/Hash, and the redundantucinewgame(a second clear of the 512MB hash) is gone. Warm start is about 3.5s to the first move.Update check
Electron / app
no-cacheinstead of a blockingreadFileSync.@fontsource. Google Fonts was blocked by the app's own CSP/COEP.Testing
npm run lint,npm test(45 tests) andnpm run buildpass.🤖 Generated with Claude Code
https://claude.ai/code/session_017ZHKbLKcpoa8QJGzqkbDTJ
Generated by Claude Code