From 942989939a0f84de8439a692a090b2b5e5dd0590 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 17 Nov 2012 12:44:19 +0100 Subject: [PATCH] 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. --- src/search.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.39.2