Changes

Jump to: navigation, search

Perft

453 bytes added, 08:39, 15 April 2021
no edit summary
=Speed up=
==<span id="Bulk"></span>Bulk-counting==
Assuming the above code used a legal move generator. The algorithm is simple, short but it generates makes moves for every node even they are the leave (ends of branches). It could improve speed significantly: instead of counting nodes at "depth 0", legal move generators can take advantage of the fact that the number of moves generated at "depth 1" represents the accurate Perft value for that branch. Therefore they can skip the last [[Make Move|makemove]]/[[Unmake Move|undomove]], which gives much faster results and is a better indicator of the raw move generator speed (versus move generator + make/unmake). However, this can cause some confusion when comparing Perft valuesand may make the task of collecting some extra information such as the number of captures and checks be almost impossible.
<pre>
==Pseudo Legal Moves==
To generate legal moves some programs have to make moves first, call a function to check if the function IsIncheck position incheck and then undo those moves. That makes the above Perft function to make and undo moves twice for all moves. Below code can avoid that problem and run much faster:
<pre>
u64 Perft(int depth)
* [[Perft Results]]
* [[Chess960 Perft Results]]
* [[Chinese Chess PerftResults]]
=Publications=
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75877 Place to find correct perft result from a fen position] by [[Elias Nilsson]], [[CCC]], November 20, 2020 » [[Perft Results]]
'''2021'''
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=76430 Chinese chess Xiangqi perft results] by [[Maksim Korzh]], [[CCC]], January 27, 2021 » [[Chinese ChessPerft Results]]* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=77054 PERFT transposition table funny?!] by [[Martin Bryant]], [[CCC]], April 10, 2021 » [[Transposition Table]], [[Memory]]* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=77069 Perft 7 -> 1.6 trillion moves] by [[Michael Byrne|XiangqiMikeB]], [[Chinese Chess PerftCCC]], April 12, 2021
=External Links=

Navigation menu