]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
Introduce simple_eval() for lazy evaluations
[stockfish] / src / thread.cpp
index ca1a7c852731d11b530b10ccea2d42ea5d5573e6..60f760ed46ee48bf70b0157773d668b6a5793cfa 100644 (file)
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <cassert>
+#include "thread.h"
 
-#include <algorithm> // For std::count
+#include <algorithm>
+#include <cassert>
+#include <cstdlib>
+#include <deque>
+#include <initializer_list>
+#include <map>
+#include <memory>
+#include <utility>
+
+#include "evaluate.h"
+#include "misc.h"
 #include "movegen.h"
 #include "search.h"
-#include "thread.h"
-#include "uci.h"
 #include "syzygy/tbprobe.h"
 #include "tt.h"
+#include "uci.h"
 
 namespace Stockfish {
 
@@ -60,7 +69,6 @@ void Thread::clear() {
   counterMoves.fill(MOVE_NONE);
   mainHistory.fill(0);
   captureHistory.fill(0);
-  previousDepth = 0;
 
   for (bool inCheck : { false, true })
       for (StatsType c : { NoCaptures, Captures })
@@ -205,6 +213,7 @@ void ThreadPool::start_thinking(Position& pos, StateListPtr& states,
       th->rootMoves = rootMoves;
       th->rootPos.set(pos.fen(), pos.is_chess960(), &th->rootState, th);
       th->rootState = setupStates->back();
+      th->rootSimpleEval = Eval::simple_eval(pos, pos.side_to_move());
   }
 
   main()->start_searching();