mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Update nodes after a do_move()
And also store the node counter in Position and not in Thread. This will allow to properly count nodes also in sub trees with SMP active. This requires a surprisingly high number of changes in a lot of places to make it work properly. No functional change but node count changed for obvious reasons. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -57,7 +57,7 @@ namespace {
|
||||
// The root position. This is set up when the user (or in practice, the GUI)
|
||||
// sends the "position" UCI command. The root position is sent to the think()
|
||||
// function when the program receives the "go" command.
|
||||
Position RootPosition(0);
|
||||
Position RootPosition(StartPositionFEN, 0);
|
||||
|
||||
// Local functions
|
||||
bool handle_command(const string& command);
|
||||
@@ -82,7 +82,6 @@ namespace {
|
||||
|
||||
void uci_main_loop() {
|
||||
|
||||
RootPosition.from_fen(StartPositionFEN);
|
||||
string command;
|
||||
|
||||
do {
|
||||
@@ -312,14 +311,13 @@ namespace {
|
||||
|
||||
string token;
|
||||
int depth, tm, n;
|
||||
Position pos(RootPosition, RootPosition.thread());
|
||||
|
||||
if (!(uip >> depth))
|
||||
return;
|
||||
|
||||
tm = get_system_time();
|
||||
|
||||
n = perft(pos, depth * ONE_PLY);
|
||||
n = perft(RootPosition, depth * ONE_PLY);
|
||||
|
||||
tm = get_system_time() - tm;
|
||||
std::cout << "\nNodes " << n
|
||||
|
||||
Reference in New Issue
Block a user