X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=40808c6adfc77797484fb196cb8c14310d16837e;hp=3dbcb526dbff7187014d5d477df9ae7792f03f04;hb=d4575941974ade5135971b87ff663ef4ff000de9;hpb=55745f410547f22b1edce873b38cc3ce5f3ace5f diff --git a/src/search.cpp b/src/search.cpp index 3dbcb526..40808c6a 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -172,9 +172,9 @@ namespace { // best move from the previous iteration, Problem is set back to false. const Value NoProblemMargin = Value(0x14); - // Null move margin. A null move search will not be done if the approximate + // Null move margin. A null move search will not be done if the static // evaluation of the position is more than NullMoveMargin below beta. - const Value NullMoveMargin = Value(0x300); + const Value NullMoveMargin = Value(0x200); // If the TT move is at least SingleReplyMargin better then the // remaining ones we will extend it. @@ -190,13 +190,6 @@ namespace { // Depth limit for razoring const Depth RazorDepth = 4 * OnePly; - // Remaining depth: 1 ply 1.5 ply 2 ply 2.5 ply 3 ply 3.5 ply - const Value RazorMargins[6] = { Value(0x180), Value(0x300), Value(0x300), Value(0x3C0), Value(0x3C0), Value(0x3C0) }; - - // Remaining depth: 1 ply 1.5 ply 2 ply 2.5 ply 3 ply 3.5 ply - const Value RazorApprMargins[6] = { Value(0x520), Value(0x300), Value(0x300), Value(0x300), Value(0x300), Value(0x300) }; - - /// Variables initialized by UCI options // Minimum number of full depth (i.e. non-reduced) moves at PV and non-PV nodes @@ -659,6 +652,7 @@ void SearchStack::init(int ply) { pv[ply] = pv[ply + 1] = MOVE_NONE; currentMove = threatMove = MOVE_NONE; reduction = Depth(0); + eval = VALUE_NONE; } void SearchStack::initKillers() { @@ -844,7 +838,7 @@ namespace { // If we are pondering or in infinite search, we shouldn't print the // best move before we are told to do so. - if (PonderSearch || InfiniteSearch) + if (!AbortSearch && (PonderSearch || InfiniteSearch)) wait_for_stop_or_ponderhit(); else // Print final search statistics @@ -1398,6 +1392,7 @@ namespace { const int FutilityValueMargin = 112 * bitScanReverse32(int(depth) * int(depth) / 2); // Enhance score accuracy with TT value if possible + ss[ply].eval = staticValue; futilityValue = staticValue + FutilityValueMargin; staticValue = refine_eval(tte, staticValue, ply); @@ -1452,13 +1447,14 @@ namespace { } // Null move search not allowed, try razoring else if ( !value_is_mate(beta) + && !isCheck && depth < RazorDepth - && staticValue < beta - RazorApprMargins[int(depth) - 2] + && staticValue < beta - (NullMoveMargin + 16 * depth) && ss[ply - 1].currentMove != MOVE_NULL && ttMove == MOVE_NONE && !pos.has_pawn_on_7th(pos.side_to_move())) { - Value rbeta = beta - RazorMargins[int(depth) - 2]; + Value rbeta = beta - (NullMoveMargin + 16 * depth); Value v = qsearch(pos, ss, rbeta-1, rbeta, Depth(0), ply, threadID); if (v < rbeta) return v;