From 04ac1bcabefaa5b6895b8c20c3c6e3ba7e3a5a61 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 22 Jan 2012 11:33:53 +0100 Subject: [PATCH] Fix incorrect assert(PvNode == (alpha != beta - 1)) In case of a PvNode could happen that alpha == beta - 1, for instance in case the same previous node was visited with same beta during a non-pv search, the node failed low and stored beta-1 in TT. Then the node is searched again in PV mode, TT value beta-1 is retrieved and updates alpha that now happens to be beta-1. No functional change. Signed-off-by: Marco Costalba --- src/search.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 437eb4a2..eb9f63f1 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -544,7 +544,7 @@ namespace { const bool RootNode = (NT == Root || NT == SplitPointRoot); assert(alpha >= -VALUE_INFINITE && alpha < beta && beta <= VALUE_INFINITE); - assert(PvNode == (alpha != beta - 1)); + assert((alpha == beta - 1) || PvNode); assert(depth > DEPTH_ZERO); assert(pos.thread() >= 0 && pos.thread() < Threads.size()); @@ -1154,7 +1154,7 @@ split_point_start: // At split points actual search starts from here assert(NT == PV || NT == NonPV); assert(alpha >= -VALUE_INFINITE && alpha < beta && beta <= VALUE_INFINITE); - assert(PvNode == (alpha != beta - 1)); + assert((alpha == beta - 1) || PvNode); assert(depth <= DEPTH_ZERO); assert(pos.thread() >= 0 && pos.thread() < Threads.size()); -- 2.39.2