mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Rework perft implementation
Unify various perft functions and move all the code to search.cpp. Avoid perft implementation to be splitted between benchmark.cpp (where it has no reason to be) and search.cpp No functional and no speed change (tested).
This commit is contained in:
@@ -139,15 +139,8 @@ void benchmark(const Position& current, istream& is) {
|
||||
cerr << "\nPosition: " << i + 1 << '/' << fens.size() << endl;
|
||||
|
||||
if (limitType == "perft")
|
||||
for (MoveList<LEGAL> it(pos); *it; ++it)
|
||||
{
|
||||
StateInfo si;
|
||||
pos.do_move(*it, si);
|
||||
uint64_t cnt = limits.depth > 1 ? Search::perft(pos, (limits.depth - 1) * ONE_PLY) : 1;
|
||||
pos.undo_move(*it);
|
||||
cout << move_to_uci(*it, pos.is_chess960()) << ": " << cnt << endl;
|
||||
nodes += cnt;
|
||||
}
|
||||
nodes += Search::perft<true>(pos, limits.depth * ONE_PLY);
|
||||
|
||||
else
|
||||
{
|
||||
Threads.start_thinking(pos, limits, st);
|
||||
|
||||
Reference in New Issue
Block a user