Add perft section to readme
All checks were successful
Python tests (make) / test (push) Successful in 11s
All checks were successful
Python tests (make) / test (push) Successful in 11s
This commit is contained in:
29
README.md
29
README.md
@@ -1,4 +1,4 @@
|
|||||||
# Chess Engine in C — Project Goal
|
# Chess Engine in C
|
||||||
|
|
||||||
Build a clean, fast chess engine in C that starts from a FEN string and produces fully legal moves, verified via **PERFT** for correctness and speed.
|
Build a clean, fast chess engine in C that starts from a FEN string and produces fully legal moves, verified via **PERFT** for correctness and speed.
|
||||||
|
|
||||||
@@ -29,6 +29,33 @@ FEN is a single line string that describes a chess position. Format:
|
|||||||
- halfmove: `0`
|
- halfmove: `0`
|
||||||
- fullmove: `1`
|
- fullmove: `1`
|
||||||
|
|
||||||
|
# Perft Testing A Chess Engine
|
||||||
|
|
||||||
|
**Perft** (“performance test”) walks the move tree *without move evaluation* and counts nodes at certain depths in the tree. It’s a standard way to verify an engine's **move generation + make/unmake (or make-on-copy)** are correct. The important to understand that the node counts have been generated and verified by the chess programming community, meaning that these counts are a reliable reference point for a chess engine to match against.
|
||||||
|
|
||||||
|
## What perft checks
|
||||||
|
- **Legality filtering:** no moves that leave your own king in check.
|
||||||
|
- **Special rules:** castling path/rights, en passant (incl. pinned-EP edge case), promotions.
|
||||||
|
- **State integrity:** side-to-move flips; occupancy stays consistent.
|
||||||
|
|
||||||
|
## Start-position reference counts
|
||||||
|
|
||||||
|
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
|
||||||
|
|
||||||
|
- d1 = **20**
|
||||||
|
- d2 = **400**
|
||||||
|
- d3 = **8,902**
|
||||||
|
- d4 = **197,281**
|
||||||
|
- d5 = **4,865,609**
|
||||||
|
- d6 = **119,060,324**
|
||||||
|
|
||||||
|
## Other Positions
|
||||||
|
|
||||||
|
The chess programming wiki provides several other starting positions to test. They
|
||||||
|
can be found here.
|
||||||
|
|
||||||
|
**PERFT Results & test positions:** <https://www.chessprogramming.org/Perft_Results>
|
||||||
|
|
||||||
## Future Work
|
## Future Work
|
||||||
- Incorporate algorithms and evaluation methods for chess positions to enable an **AI player**.
|
- Incorporate algorithms and evaluation methods for chess positions to enable an **AI player**.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user