mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 18:17:02 +08:00
Move perft out of search
This splits the logic of search and perft. Before, threads were started, which then constructed a search object, which then started perft and returned immediately. All of this is unnecessary, instead uci should start perft right away. closes https://github.com/official-stockfish/Stockfish/pull/5008 No functional change
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include "syzygy/tbprobe.h"
|
||||
#include "types.h"
|
||||
#include "ucioption.h"
|
||||
#include "perft.h"
|
||||
|
||||
namespace Stockfish {
|
||||
|
||||
@@ -172,7 +173,6 @@ void UCI::loop() {
|
||||
|
||||
void UCI::go(Position& pos, std::istringstream& is, StateListPtr& states) {
|
||||
|
||||
|
||||
Search::LimitsType limits;
|
||||
std::string token;
|
||||
bool ponderMode = false;
|
||||
@@ -211,6 +211,12 @@ void UCI::go(Position& pos, std::istringstream& is, StateListPtr& states) {
|
||||
|
||||
Eval::NNUE::verify(options, evalFiles);
|
||||
|
||||
if (limits.perft)
|
||||
{
|
||||
perft(pos.fen(), limits.perft, options["UCI_Chess960"]);
|
||||
return;
|
||||
}
|
||||
|
||||
threads.start_thinking(options, pos, states, limits, ponderMode);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user