Starter kit for building a chess engine in assembly language, then benchmarking and estimating Elo.
src/core/core_impl.c: maintainable source for the search core (compiled to assembly).src/core/core.s: generated ARM64 macOS assembly core used at build time.scripts/asm_core.py: ctypes bridge for calling the assembly core.scripts/uci_bridge.py: thin UCI adapter in Python (protocol/state only).scripts/uci_smoke.py: protocol smoke test (uci,isready,go).scripts/run_matches.py: automated matches vs Stockfish at severalUCI_Elolevels with an Elo estimate.Makefile: build + core self-test + smoke + quick rating targets.
make build
make core-test
make smoke
make ratepython3 scripts/run_matches.py \
--engine-path python3 \
--engine-arg=scripts/uci_bridge.py \
--engine-arg=--core \
--engine-arg=build/libasm_core.dylib \
--engine-arg=--depth \
--engine-arg=4 \
--levels 1600,1800,2000,2200 \
--games-per-level 20 \
--movetime-ms 100 \
--output-json build/rating.jsonHigh-strength run (ambitious):
python3 scripts/run_matches.py \
--engine-path python3 \
--engine-arg=scripts/uci_bridge.py \
--engine-arg=--core \
--engine-arg=build/libasm_core.dylib \
--engine-arg=--depth \
--engine-arg=8 \
--levels 2300,2500 \
--games-per-level 8 \
--movetime-ms 180Use enough games for credible estimates; short runs can vary by a few hundred Elo.
Notes:
- UCI handling lives in Python by design; move choice logic runs in assembly.
- The current assembly core includes: castling + en-passant aware make/unmake, repetition + 50-move draw handling, quiescence search, iterative deepening, aspiration windows, transposition table, killer/history move ordering, null-move pruning, and late-move reductions.
- The current assembly core additionally uses PVS-style re-search, delta/futility-style pruning at shallow depths, and counter-move ordering.
- The current assembly core now includes SEE-based tactical filtering and two evaluation caches: pawn-structure hash cache + full eval cache.
- You can control search depth with
--depth(bridge args or UCIsetoption name Depth value N, range1..12), and the bridge also adapts depth fromgo movetime.
- Add pawn hash / eval cache and tapered evaluation
- Add singular extensions / SEE-guided pruning
- Add multi-PV analysis mode and stronger time management
- Keep UCI bridge thin and stable
- Regression tests + Elo tracking
scripts/run_matches.py fits an approximate rating against fixed Stockfish UCI_Elo opponents. Treat it as a practical progress metric, not an official rating pool.