X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=442f7f5ddc3e4fda6592ac903407d3f4f04550a4;hp=e56b2c7f60e4839843cdd95ff04219e2c86b4d53;hb=fbfce2132aff3e8528086fb14ae3fb8ef47c212e;hpb=a0cc15ccbc5dc48ea3c871915c8f96c7a624597d diff --git a/src/search.cpp b/src/search.cpp index e56b2c7f..442f7f5d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -143,11 +143,14 @@ void Search::init() { if (Reductions[0][0][hd][mc] > 2 * ONE_PLY) Reductions[0][0][hd][mc] += ONE_PLY; + + else if (Reductions[0][0][hd][mc] > 1 * ONE_PLY) + Reductions[0][0][hd][mc] += ONE_PLY / 2; } // Init futility margins array for (d = 1; d < 16; ++d) for (mc = 0; mc < 64; ++mc) - FutilityMargins[d][mc] = Value(112 * int(log(double(d * d) / 2) / log(2.0) + 1.001) - 8 * mc + 45); + FutilityMargins[d][mc] = Value(112 * int(2.9 * log(double(d))) - 8 * mc + 45); // Init futility move count array for (d = 0; d < 32; ++d) @@ -1188,6 +1191,11 @@ moves_loop: // When in check and at SpNode search starts from here if ( (ss->staticEval = bestValue = tte->eval_value()) == VALUE_NONE ||(ss->evalMargin = tte->eval_margin()) == VALUE_NONE) ss->staticEval = bestValue = evaluate(pos, ss->evalMargin); + + // Can ttValue be used as a better position evaluation? + if (ttValue != VALUE_NONE) + if (tte->bound() & (ttValue > bestValue ? BOUND_LOWER : BOUND_UPPER)) + bestValue = ttValue; } else ss->staticEval = bestValue = evaluate(pos, ss->evalMargin); @@ -1205,7 +1213,7 @@ moves_loop: // When in check and at SpNode search starts from here if (PvNode && bestValue > alpha) alpha = bestValue; - futilityBase = ss->staticEval + ss->evalMargin + Value(128); + futilityBase = bestValue + ss->evalMargin + Value(128); } // Initialize a MovePicker object for the current position, and prepare