X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=08bf90f89845673b79b8197c40e17bab2eccc119;hp=ec443bef92d090b9b92176a4b15fccdd0ababd7d;hb=39257509452a81db28538462e6581b05d1a4b7fb;hpb=cf5d683408a2ef8a1c80be9bf7d6790a38b16277 diff --git a/src/search.cpp b/src/search.cpp index ec443bef..08bf90f8 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -85,10 +85,10 @@ namespace { return d > 17 ? 0 : 29 * d * d + 138 * d - 134; } - // Add a small random component to draw evaluations to keep search dynamic + // Add a small random component to draw evaluations to keep search dynamic // and to avoid 3fold-blindness. Value value_draw(Depth depth, Thread* thisThread) { - return depth < 4 ? VALUE_DRAW + return depth < 4 ? VALUE_DRAW : VALUE_DRAW + Value(2 * (thisThread->nodes.load(std::memory_order_relaxed) % 2) - 1); } @@ -599,7 +599,7 @@ namespace { if ( Threads.stop.load(std::memory_order_relaxed) || pos.is_draw(ss->ply) || ss->ply >= MAX_PLY) - return (ss->ply >= MAX_PLY && !inCheck) ? evaluate(pos) + return (ss->ply >= MAX_PLY && !inCheck) ? evaluate(pos) : value_draw(depth, pos.this_thread()); // Step 3. Mate distance pruning. Even if we mate at the next move our score