- When
- April 2026 – present
- Role
- Solo project
- Status
- Working engine, under active development
- Stack
- Python, PyTorch, python-chess, NumPy, SQLite, Stockfish
Chess Engine with a Learned Evaluation
A Python chess engine that combines alpha-beta search with an evaluation model trained on positions labeled by Stockfish.
Overview
A chess engine built to explore one question: how much can a learned evaluation replace hand-tuned chess knowledge? It uses a classical search core and an evaluation function trained against Stockfish's scores, plus the tooling to generate data, train models, and measure the results.
Why I built it
I'd written a neural-network chess player before. It could play, but I couldn't tell why it was weak. This time I wanted a search I fully understood and an evaluation I could measure, so I could see where the strength actually comes from.
What I built
- Minimax search with alpha-beta pruning and iterative deepening
- Transposition table keyed by Zobrist hashes
- Move ordering with killer moves and the history heuristic
- Quiescence search, null-move pruning, and late-move reductions
- More than 50 hand-engineered positional features
- A data pipeline that pulls positions from PGN games, random play, and self-play, then labels them with Stockfish
- Ridge-regression and multilayer-perceptron evaluators, plus tools to compare their predictions
- A small GUI for playing against the engine and inspecting its evaluations
How it fits together
Positions are collected and stored in SQLite, then scored by Stockfish to make the training set. Training scripts fit the evaluation models in NumPy or PyTorch and export the weights. At play time, the search calls the selected evaluator at its leaf nodes. Because the cache and move ordering sit on top of the search, evaluators can be swapped without touching them.
Hard parts
Every gain in model accuracy costs time at every leaf. A better model that runs slower can still make the engine weaker overall. Most of the work has been balancing that: picking features that are cheap to compute, keeping board updates fast, and benchmarking at a fixed time budget instead of a fixed depth.
Where it stands
The engine plays complete games and the regression evaluator is in use. I'm currently testing neural-network evaluators and building fixed-budget benchmarks to compare them fairly.