From: Marco Costalba Date: Sat, 17 Nov 2012 11:44:19 +0000 (+0100) Subject: Better document fail-high condition X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=942989939a0f84de8439a692a090b2b5e5dd0590 Better document fail-high condition At this point we have already verified (value > alpha) and this implies, in case of a non-PV node, where search window size is zero, that value >= beta. This is not so self-evident, so document the code with an assert condition. No functional change. --- diff --git a/src/search.cpp b/src/search.cpp index c80a064d..4915b502 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1003,8 +1003,10 @@ split_point_start: // At split points actual search starts from here alpha = value; // Update alpha here! Always alpha < beta if (SpNode) sp->alpha = value; } - else // Fail high + else { + assert(value >= beta); // Fail high + if (SpNode) sp->cutoff = true; break; }