]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Introduce dynamic contempt
[stockfish] / src / evaluate.cpp
index 60eee7a2a03e0f99af502a20ab60a3bf230faf63..1c30a5ac5ee0e40258b9d43d52f84726b73ee129 100644 (file)
@@ -905,7 +905,7 @@ namespace {
 
 } // namespace
 
-Score Eval::Contempt = SCORE_ZERO;
+std::atomic<Score> Eval::Contempt;
 
 /// evaluate() is the evaluator for the outer world. It returns a static evaluation
 /// of the position from the point of view of the side to move.
@@ -923,7 +923,10 @@ std::string Eval::trace(const Position& pos) {
 
   std::memset(scores, 0, sizeof(scores));
 
-  Value v = Evaluation<TRACE>(pos).value() + Eval::Tempo;
+  Eval::Contempt = SCORE_ZERO;
+
+  Value v = Eval::Tempo + Evaluation<TRACE>(pos).value();
+
   v = pos.side_to_move() == WHITE ? v : -v; // White's point of view
 
   std::stringstream ss;