r/ComputerChess • u/Zanoshky • 3d ago
Shipping Stockfish evaluations as data instead of an engine: how my offline opening trainer judges off book moves


I built Chess Pass, an Android opening trainer with one hard rule: no internet permission at all. That left a question this sub might find interesting: how do you tell a learner how good their off book move is, with no server and without shipping a GPL engine inside a closed source app?
What I ended up with:
- Evaluations worked out at build time. A script runs Stockfish 19 at depth 16 over every position in all 219 lines (52 openings and 15 traps), and scores every legal move the learner could play instead of the line move, in one MultiPV search per position. It takes hours, so it runs in the background with several workers writing per opening group files
- Shipped as plain data. The results ship as small JSON files, one per group, loaded lazily on a background thread with a small cache, never at startup. No Stockfish code ships in the app, only numbers it produced
- A verdict, not just a number. When you play a move that is not in the line, the app compares it with the book move (for example 3.Bc4 +0.3 against 3.g4 -1.3), names it a mistake or not, and plays out the best answer if you tap Show why
- A small engine of our own for everything live. When a line ends you can Play it out against the computer at your level. That uses a small engine written in Kotlin for the app, which also covers any position that has no shipped number
The tradeoff is clear: shipped numbers are exact and instant but only cover what was computed ahead of time, and the small engine is weaker but works anywhere.
Free with any 3 openings you pick. Pro opens all of them with one payment (40% off until November 30).
https://play.google.com/store/apps/details?id=com.zanoshky.chesspass
I am the developer. The code is partly AI generated and I had help with this text. Happy to go into detail on any part, and curious how others here would handle eval coverage for off book moves.
2
u/ChessViper 3d ago
Neat idea, but if you're doing this just to avoid the copyleft license in your app, you could make it so that your app downloads the SF19 engine from a publically available library, and then it runs offline afterwards. This is what I do for ChessViper and I believe it is above board (IANAL)
1
u/ZZ9ZA 2d ago
Depth 16 in the opening? And you expect to be taken seriously?