X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=6715d6808f3f26dc28261108247203b62eb1823f;hp=8fa1a37928399d45da5d8bf4173e7bbe20f7d08a;hb=5f3c660d5d768ea5132439c5a8916673b909c0c9;hpb=ab127028ed51ccf2fe22285f8032d2455e6d98d2 diff --git a/src/search.cpp b/src/search.cpp index 8fa1a379..6715d680 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1467,12 +1467,13 @@ namespace { EvalInfo ei; StateInfo st; Move ttMove, move; - Value staticValue, bestValue, value, futilityBase, futilityValue; + Value staticValue, bestValue, value, futilityBase; bool isCheck, enoughMaterial, moveIsCheck, evasionPrunable; const TTEntry* tte = NULL; int moveCount = 0; int ply = pos.ply(); Value oldAlpha = alpha; + Value futilityValue = VALUE_INFINITE; TM.incrementNodeCounter(pos.thread()); ss->init(ply); @@ -1524,7 +1525,7 @@ namespace { return bestValue; } - if (bestValue > alpha) + if (PvNode && bestValue > alpha) alpha = bestValue; // If we are near beta then try to get a cutoff pushing checks a bit further @@ -1560,6 +1561,11 @@ namespace { && !move_is_promotion(move) && !pos.move_is_passed_pawn_push(move)) { + // Can only decrease from previous move because of + // MVV ordering so we don't need to recheck. + if (futilityValue < alpha) + continue; + futilityValue = futilityBase + pos.endgame_value_of_piece_on(move_to(move)) + (move_is_ep(move) ? PawnValueEndgame : Value(0));