Skip to content

peterellisjones/rustperft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Perft

A reasonably fast, multi-threaded, chess perft tool. Features:

  • Counts nodes, captures, en-passant captures, castles and promotions at a given depth from an given position.
  • Bulk counting at leaves
  • Threads root node accross available CPUs using Threadpool crate
  • Shared hash for nodes near root and thread-local hash for leaf nodes, using Zobrist hashing.
  • Uses chess-move-gen create for move generation

Related blogpost here.

Building

Make sure you have rust installed.

RUSTFLAGS="-C target-cpu=native" cargo build --release

Usage

Pass in a fen string with the --fen flag, and search depth with the --depth flag.

➜ ./target/release/rustperft --fen "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w QqKk - 0 1" --depth 8 -h 100000000
+-------+---------+------------------+-------------+------------+-------------+----------+------------+
| depth | seconds | nodes per second |       nodes |   captures | ep captures |  castles | promotions |
+-------+---------+------------------+-------------+------------+-------------+----------+------------+
|     8 |   57.56 |       1476585843 | 84998978956 | 3523740106 |     7187977 | 23605205 |          0 |
+-------+---------+------------------+-------------+------------+-------------+----------+------------+
+--------+---------+----------+-------------+-----------------+
|   hash | entries |    bytes | utilization | nodes from hash |
+--------+---------+----------+-------------+-----------------+
| shared | 1822917 | 87500016 |         49% |             64% |
+--------+---------+----------+-------------+-----------------+
| thread | 1953120 | 31249920 |        100% |              1% |
+--------+---------+----------+-------------+-----------------+

About

Reasonably fast multi-threaded chess perft (performance test)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages