Releases: abulmo/MPerft
Release list
Version 5.3
5.2
Fix missing 128 bit counters. I hope the 128 bit version to now count right above 64 bit numbers.
Also use the depth to compute the hash table index of a position, so that the same position with different depths occupies different slot in the hash table. This particularly make endgame with hash table search faster.
version 5.1
Add a --bench option with the same positions & depths than Gigantua's ones
More accurate nullmove search
Revisited castling, pins & checks detection.
More readable printing using comma separated big numbers, standard time display & unit prefix speed.
Overall this version is about 5% faster than the previous one (5.0).
Version 5.0
The main change was to add nullmove (or multiply) counting at depth 2. In nullmove counting, the current player's moves are separated into two categories, one that do not change the move list of the next player (harmless moves), the other one that may affect the move list of the next player (harmful moves). The logic to compute the perft at depth 2 is then:
do nullmove // <= so the name of nullmove counting
opponent_count = count_moves(board)
undo nullmove
player_moves = generate_moves
player_moves separated into harmful_moves & harmless_moves
count = count(harmless_moves) * opponent_moves // so the name of multiply counting
foreach harmfull_moves
do move
count += count_moves(board)
undo_move
return move
On the chess starting position, this algorithm improve significantly the perft speed.
Version 4.1
Cleaner, simpler & faster code (~5% faster than version 4.0 & ~15% faster than version 3.2)
The source code can optionally use 128 bit integer for the node counter & the Zobrist's hash key used to discriminate positions with the same index to the transposition table. A fast binary (for computer with the pext instruction) including 128 bit integer is included in the compressed file below.
The index now uses a 64 bit integer; thus, the transposition table size is practically unlimited.
Version 4.0
More optimised & simplified code
Remove --capture command line argument
Add a --fast command line argument to automatically set memory & multithreading usage to what is available
Add a --moves command line argument to set a position after a list of moves has been played
Version 3.2
Remove aligned_alloc => pgo now works on MS-Windows 10/11.
Fix builtin naming
Version 2.0
Version 2.0 of MPerft
Use C23 (with some workaround for windows)
Use copy/make instead of update/restore to apply a move on the board.
Fix a major slowdown under Windows (bitfields did not work as expected there) when using hashtable.
Binaries for MS-Windows 11 & Linux for 3 kind of x86 CPUS are available:
x86-64: basic 64 bits x86
x86-64-v2: x86-64 + popcount
x86-64-v3: x86-64 + popcount + pext
Clang was used with both OS ; yet, I was unable to compile the MS-Windows versions with PGO and they are about 20% slower than the Linux version.