X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=7cf4a8a3b583054b651d17b7c422564e859a7296;hp=5b22b8e93730ec7bcce5c6e62cb18e2051c2bba6;hb=158864270a055fe20dca4a87f4b7a8aa9cedfeb9;hpb=a87da2c4b3dce975fa8642c352c99aed5a1420f8 diff --git a/src/search.cpp b/src/search.cpp index 5b22b8e9..7cf4a8a3 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -27,7 +27,7 @@ #include "evaluate.h" #include "movegen.h" #include "movepick.h" -#include "rkiss.h" +#include "misc.h" #include "search.h" #include "timeman.h" #include "thread.h" @@ -1377,11 +1377,8 @@ moves_loop: // When in check and at SpNode search starts from here Move Skill::pick_move() { - static RKISS rk; - - // PRNG sequence should be not deterministic - for (int i = Time::now() % 50; i > 0; --i) - rk.rand(); + // PRNG sequence should be non-deterministic, so we seed it with the time at init + static PRNG rng(Time::now()); // RootMoves are already sorted by score in descending order int variance = std::min(RootMoves[0].score - RootMoves[candidates - 1].score, PawnValueMg); @@ -1402,7 +1399,7 @@ moves_loop: // When in check and at SpNode search starts from here // This is our magic formula score += ( weakness * int(RootMoves[0].score - score) - + variance * (rk.rand() % weakness)) / 128; + + variance * (rng.rand() % weakness)) / 128; if (score > maxScore) {