X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=36a89d835411bcca9d797e3265a1a66b7fcf7590;hp=dcf3e6134a4a5d4c83c48a1542f85f8ec3ebb23f;hb=d9be00342cb1719b1ec510a4284f198607ce25df;hpb=7f142d68179919a507204e7980fff4f79648dbbc diff --git a/src/search.cpp b/src/search.cpp index dcf3e613..36a89d83 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -84,7 +84,7 @@ namespace { size_t PVSize, PVIdx; TimeManager TimeMgr; - float BestMoveChanges; + double BestMoveChanges; Value DrawValue[COLOR_NB]; HistoryStats History; GainsStats Gains; @@ -143,6 +143,9 @@ 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 @@ -333,7 +336,7 @@ namespace { while (++depth <= MAX_PLY && !Signals.stop && (!Limits.depth || depth <= Limits.depth)) { // Age out PV variability metric - BestMoveChanges *= 0.8f; + BestMoveChanges *= 0.8; // Save last iteration's scores before first PV line is searched and all // the move scores but the (new) PV are set to -VALUE_INFINITE. @@ -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