📘 Author: Piotr Sowa — Founder of iSowa.io, creator of iChess.io
🧠 Blog: iBlog.io
iChess.io v12.27 is the newest generation of the Darknet-based chess engine — a fully integrated, GPU-accelerated AI system for classical and Fischer 960 chess.
It merges a policy CNN network with a handcrafted, dynamically tuned Piece-Square Table (PST) evaluation system, delivering explainable, deterministic strength without relying on NNUE weights.
- 🧠 Hybrid policy CNN + context-aware PST evaluation
- 🎯 Dual-network system — policy (p) for move guidance and value (v) for outcome estimation
- ♟️ Adaptive PST model — phase-weighted, mobility-adjusted, and material-sensitive heuristics
- 🔁 Monte Carlo Tree Search (MCTS) with top-N pruning and temperature scheduling
- ⚙️ Self-play learning loop — automatic dataset generation (FEN + π + v) and replay training
- 🚀 OpenCL GPU acceleration with full CPU fallback
- 🖥️ Cross-platform — macOS (Intel/Apple Silicon) and Linux x64
- 🎮 UCI-compatible for Arena, CuteChess, and external GUIs
- 📜 Explainable AI — no NNUE, complete transparency of heuristic scores
| Component | Description |
|---|---|
| Policy Network (p) | Darknet CNN producing prior probabilities for legal moves |
| Value Network (v) | Estimates position outcome; guides back-propagation in MCTS |
| PST Evaluator | Context-aware positional heuristic based on handcrafted tables, tuned per game phase |
| MCTS Core | Parallel search with cpuct scaling, Dirichlet noise, and virtual loss handling |
| Trainer | Self-play data pipeline generating supervised targets for both networks |
- Self-play produces (FEN, π, v) triplets.
- Policy/Value networks update using accumulated replay data.
- PST tables auto-rebalance per phase (opening, middlegame, endgame).
- MCTS integrates priors + PST scores for move selection.
- Deterministic evaluation (< 2 ms per node)
- Efficient multi-threaded MCTS arena
- High throughput GPU kernels via OpenCL core
- Consistent play-strength growth during long self-play sessions
# Clone and prepare
mkdir iChess.io.en && cd iChess.io.en
git clone --recursive https://github.com/sowson/darknet
# Build libchess (used in the chess example)
cd darknet/cmake/libchess && mkdir build && cd build
cmake .. && make -j
cp shared/libchess.* ../../../3rdparty/libchess/
# Build (optional) clBLAS (used in the chess example)
cd darknet/cmake/clBLAS && mkdir build && cd build
cmake ../src -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DBUILD_TEST=OFF -DBUILD_PERFORMANCE=OFF && make -j
cp shared/clBLAS.* ../../../3rdparty/clBLAS/
# Build engine with chess example enabled
cd ../../../.. && mkdir darknet/build && cd darknet/build
cmake -DDARKNET_ENG_CHESS=1 .. && make -j
# Copy example config and weights
cp ../cfg/chess.cfg ../../ && cp ../weights/chess.weights ../.././iChess.io.en
iChess.io v12.27 by Piotr Sowa
position startpos moves e2e4 b8c6 d2d4
go
info depth 1 pv e7e5
bestmove e7e5 ponder e7e5- nlohmann/json
- libchess (for chess logic)
- Use a RAMDisk for temporary training files to minimize I/O latency:
- Linux:
sudo mount -t tmpfs -o size=4096M tmpfs /ramdisk - macOS:
diskutil erasevolume HFS+ "ramdisk" $(hdiutil attach -nomount ram://8388608)
- Linux:
- Replace clBLAS with CLBlast for optimized GEMM kernels:
git apply patches/clblast.patch
- ✅ macOS (Intel / Apple Silicon)
- ✅ Ubuntu Linux 20.04 or newer
⚠️ Windows 10/11 (experimental OpenCL build)
Windows build guide: Darknet on OpenCL on Windows 11 x64
This project builds upon the Darknet v1.1.1 AI CNN Computer Vision Engine
📄 Reference paper: https://doi.org/10.1002/cpe.6936
Darknet provided the original multi-GPU CNN core, which now serves as the foundation for policy/value training inside iChess.io v12.27.
Developed by Piotr Sowa — AI researcher, GPU software engineer, and creator of iChess.io.
More information and technical articles available at https://iBlog.io.
For academic citations or collaboration inquiries, please contact via iSowa.io or LinkedIn.
© 2025 Piotr Sowa / iSowa.io — All rights reserved.