2026-06-24 · 3 MIN READ
The opponent thinks on another thread
A chess AI that searches a tree deep enough to matter, without ever freezing the board it is playing on.

A chess opponent that thinks is a chess opponent that blocks. Minimax with alpha-beta pruning searches a tree of possible futures, and at a depth worth playing against, that search takes real time — long enough that if you run it on the thread drawing the board, the whole app locks while the engine ponders. Most hobby chess apps either search too shallow to be interesting or stutter every time it is the computer's move.
Chesmeski runs the search in a background isolate. The minimax-with-alpha-beta engine lives on its own thread of execution with its own memory, so it can grind through the tree while the UI thread stays completely free. The board animates, the input stays responsive, and the move appears when the engine is done — no freeze, no spinner that blocks interaction, no dropped frames while it thinks.
Underneath the opponent is a rules engine that does not cut the corners hobby chess usually cuts. It is pure Dart: full legal-move generation that accounts for pins and checks, checkmate and stalemate detection, and the draws most apps skip — fifty-move, threefold repetition, and insufficient material. Undo walks the whole game backward, reverting both your move and the engine's reply in one step, which is only clean because the state is modeled honestly in the first place.
It is one codebase across Android and Windows in Flutter, dressed in the warm-black Hive theme the rest of my work shares. The headline feature is invisible when it works: an opponent that thinks as hard as you let it, on a board that never once stutters. Concurrency done right is a feature you feel and never see.
- 01
- 02Functional core, thin bridge
Companion: the pure-core architecture the engine is built on.
/blog/functional-core-thin-bridge
- 03
- 04Alpha-beta pruning
The search optimization the opponent uses.
https://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning