This repository gives you a complete starter workflow to:
- build a chess engine in Icon (
src/icon_chess.icn), - expose it via UCI,
- validate move generation with perft checks,
- run automated matches with cutechess-cli,
- estimate Elo from match scores against Stockfish at nearby strength levels.
-
Engine core in Icon
- 0x88 board representation
- UCI loop (
uci,isready,position,go,setoption,quit) - legal move handling via make-move legality checks
- alpha-beta + quiescence search
- basic material + positional evaluation
- castling, en passant, promotion
-
Tooling for validation and Elo estimation
scripts/uci_smoke.py: protocol smoke testscripts/perft_check.py: perft regression checks against reference node countsscripts/run_matches.py: runs match batches via cutechessscripts/elo_math.py: Elo and confidence-interval mathscripts/build_engine.sh: compile Icon enginescripts/run_engine.sh: run compiled binary
python3stockfishin PATHcutechess-cliin PATH- Icon compiler in PATH:
icontorunicon
On your machine right now, stockfish and cutechess-cli are available.
You still need to install icont/unicon before compiling the Icon source.
./scripts/build_engine.shExpected output binary:
build/icon_chess
python3 scripts/uci_smoke.py --engine-path ./build/icon_chess --timeout 8 --movetime-ms 120This confirms the engine answers UCI commands and returns a valid bestmove.
Quick suite:
python3 scripts/perft_check.py --engine-path ./build/icon_chessFull suite (deeper/slower):
python3 scripts/perft_check.py --engine-path ./build/icon_chess --fullThe engine also supports interactive perft commands:
perft 3
go perft 3
Example with three nearby anchors:
python3 scripts/run_matches.py \
--engine-path ./build/icon_chess \
--engine-name IconKnight \
--opponent-elo 1320 1450 1600 \
--games 40 \
--tc 10+0.1 \
--repeatEach run writes:
- one PGN per anchor,
- cutechess logs,
summary.json+summary.txtwith Elo estimate and CI,
under results/<timestamp>/.
For a quick assessment against different Stockfish skill levels:
python3 scripts/quick_elo_skills.py \
--engine-path ./build/icon_chess \
--games 20 \
--skill 0 4 8 12 16 20 \
--tc 3+0.05Notes:
- This reports Elo difference versus each specific Stockfish skill configuration.
- If you also provide
--skill-elo SKILL=ELO, the script computes anchored absolute-Elo estimates.
Use this loop:
- Start with weak anchors (e.g.
1320 1450 1600). - Check score at each anchor.
- Keep anchors where your score is roughly 35% to 65%.
- Re-run more games around that band (100-300 games total).
- Use the weighted aggregate Elo from
summary.txt.
This gives a much more stable estimate than playing only one fixed level.
- Add transposition table and iterative deepening with aspiration windows.
- Add better move ordering (history, killer moves, MVV-LVA tuning).
- Add piece-square tables and endgame-aware king evaluation.
- Add null-move pruning / late move reductions (carefully, with regression tests).