mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 08:36:33 +08:00
Implemented perft
Patch from Joona with extension to benchmark and inclusion of Depth(0) moves generation by me. Note that to test also qsearch and in particulary checks generations a change in the end condition is needed. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
committed by
Marco Costalba
parent
d9b920acfb
commit
fa49311b36
@@ -104,7 +104,7 @@ void benchmark(const string& commandLine) {
|
||||
|
||||
if (limitType == "time")
|
||||
secsPerPos = val * 1000;
|
||||
else if (limitType == "depth")
|
||||
else if (limitType == "depth" || limitType == "perft")
|
||||
maxDepth = val;
|
||||
else
|
||||
maxNodes = val;
|
||||
@@ -153,7 +153,9 @@ void benchmark(const string& commandLine) {
|
||||
int dummy[2] = {0, 0};
|
||||
Position pos(*it);
|
||||
cerr << "\nBench position: " << cnt << '/' << positions.size() << endl << endl;
|
||||
if (!think(pos, true, false, 0, dummy, dummy, 0, maxDepth, maxNodes, secsPerPos, moves))
|
||||
if (limitType == "perft")
|
||||
totalNodes += perft(pos, maxDepth * OnePly);
|
||||
else if (!think(pos, true, false, 0, dummy, dummy, 0, maxDepth, maxNodes, secsPerPos, moves))
|
||||
break;
|
||||
totalNodes += nodes_searched();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user