Stockfish | Fairy Stockfish perft for chess & chess variants

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Stockfish | Fairy Stockfish perft for chess & chess variants

Post by maksimKorzh »

Hey what's up guys, Code Monkey King's here.
I've made little tutorial I've made on how to use Stockfish/Fairy Stockfish for perft testing of chess and chess variants:

See the cheat sheet in the description below the video and timestamps in the pinned comment to watch only interesting part.

For those who don't want to watch the video, here's the summary:

Code: Select all

// Stockfish, UCI commands to run perft test for a specific position
position fen r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1
bench 1 1 4 current perft

// Stockfish, command line arguments to run perft test for a specific position
./stockfish bench 1 1 4 positions.txt perft

// Fairy Stockfish, UCI commands to run perft test for a specific position of a specific variant
setoption name UCI_Variant value janggi
position fen rnba1abnr/4k4/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/4K4/RNBA1ABNR w - - 0 1
bench 1 1 4 current perft

// Fairy Stockfish, command line arguments to run perft test for a specific position of a specific variant
./fairy-stockfish bench janggi 1 1 4 janggi_bench.txt perft

=================================================================================
1 1 4 means 1MB transposition table size, 1 thread, depth 4
=================================================================================
Here're the "docs" from benchmark.cpp source file:

Code: Select all

/// setup_bench() builds a list of UCI commands to be run by bench. There
/// are five parameters: TT size in MB, number of search threads that
/// should be used, the limit value spent for each position, a file name
/// where to look for positions in FEN format, the type of the limit:
/// depth, perft, nodes and movetime (in millisecs), and evaluation type
/// mixed (default), classical, NNUE.
///
/// bench -> search default positions up to depth 13
/// bench 64 1 15 -> search default positions up to depth 15 (TT = 64MB)
/// bench 64 4 5000 current movetime -> search current position with 4 threads for 5 sec
/// bench 64 1 100000 default nodes -> search default positions for 100K nodes each
/// bench 16 1 5 default perft -> run a perft 5 on default positions

I'm not sure how useful this might be for you but for me it was incredibly useful because from now on
I can calibrate my Korean chess (janggi) engine's move generator basing on perft results from Fairy Stockfish.