Restore NPS output for Perft

Previously it was possible to also get the node counter after running a bench with perft, i.e.
`./stockfish bench 1 1 5 current perft`, caused by a small regression from the uci refactoring.

```
Nodes searched: 4865609

===========================
Total time (ms) : 18
Nodes searched  : 4865609
Nodes/second    : 270311611
````

closes https://github.com/official-stockfish/Stockfish/pull/5188

No functional change
This commit is contained in:
Disservin
2024-04-22 19:24:10 +02:00
parent d47aa639bd
commit ddd250b9d6
7 changed files with 45 additions and 20 deletions

View File

@@ -26,7 +26,7 @@
#include "types.h"
#include "uci.h"
namespace Stockfish {
namespace Stockfish::Benchmark {
// Utility to verify move generation. All the leaf nodes up
// to the given depth are generated and counted, and the sum is returned.
@@ -56,13 +56,12 @@ uint64_t perft(Position& pos, Depth depth) {
return nodes;
}
inline void perft(const std::string& fen, Depth depth, bool isChess960) {
inline uint64_t perft(const std::string& fen, Depth depth, bool isChess960) {
StateListPtr states(new std::deque<StateInfo>(1));
Position p;
p.set(fen, isChess960, &states->back());
uint64_t nodes = perft<true>(p, depth);
sync_cout << "\nNodes searched: " << nodes << "\n" << sync_endl;
return perft<true>(p, depth);
}
}