X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=ff7a2c2309cb91624da7b083be34ff1bf5d8a4cc;hp=e008bec1e45d8a063cca7d05dd803411d7cb38c6;hb=5a7827d59de5e3dea0d90bdb3e7c57153c0a9f1f;hpb=217840a6a5a40b516cab59a450a9f36352997240 diff --git a/src/search.cpp b/src/search.cpp index e008bec1..ff7a2c23 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -335,7 +335,12 @@ void Thread::search() { beta = VALUE_INFINITE; multiPV = Options["MultiPV"]; - Skill skill(Options["Skill Level"]); + // Pick integer skill levels, but non-deterministically round up or down + // such that the average integer skill corresponds to the input floating point one. + PRNG rng(now()); + int intLevel = int(Options["Skill Level"]) + + ((Options["Skill Level"] - int(Options["Skill Level"])) * 1024 > rng.rand() % 1024 ? 1 : 0); + Skill skill(intLevel); // When playing with strength handicap enable MultiPV search that we will // use behind the scenes to retrieve a set of possible moves. @@ -1065,7 +1070,7 @@ moves_loop: // When in check, search starts from here Depth r = reduction(improving, depth, moveCount); // Reduction if other threads are searching this position. - if (th.marked()) + if (th.marked()) r += ONE_PLY; // Decrease reduction if position is or has been on the PV @@ -1110,7 +1115,7 @@ moves_loop: // When in check, search starts from here r += ONE_PLY; // Decrease/increase reduction for moves with a good/bad history (~30 Elo) - r -= ss->statScore / 20000 * ONE_PLY; + r -= ss->statScore / 16384 * ONE_PLY; } Depth d = clamp(newDepth - r, ONE_PLY, newDepth);