Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chess-assembly-codex

Starter kit for building a chess engine in assembly language, then benchmarking and estimating Elo.

What is included

  • 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 several UCI_Elo levels with an Elo estimate.
  • Makefile: build + core self-test + smoke + quick rating targets.

Quick start

make build
make core-test
make smoke
make rate

Manual rating run

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=4 \
  --levels 1600,1800,2000,2200 \
  --games-per-level 20 \
  --movetime-ms 100 \
  --output-json build/rating.json

High-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 180

Use 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 UCI setoption name Depth value N, range 1..12), and the bridge also adapts depth from go movetime.

Suggested implementation milestones

  1. Add pawn hash / eval cache and tapered evaluation
  2. Add singular extensions / SEE-guided pruning
  3. Add multi-PV analysis mode and stronger time management
  4. Keep UCI bridge thin and stable
  5. Regression tests + Elo tracking

Interpreting the Elo estimate

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages