From aba152ea3a0b97c1df7aab3a909d52349bdf6c76 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Thu, 11 Oct 2012 21:11:11 +0200 Subject: [PATCH 1/1] Fix a minor bug in search As Joona says: "The problem is that when doing full window search (-VALUE_INFINITE, VALUE_INFINITE), and pruning all the moves will return fail low which is mate score, because only clause touching alpha is "mate distance pruning". So we are returning mate score although we are just pruning all the moves. In reality there probably is no mate in sight. Bug spotted and fixed by Joona. --- src/search.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index 4139ef96..cf98ca35 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -826,7 +826,8 @@ split_point_start: // At split points actual search starts from here && !inCheck && !dangerous && move != ttMove - && (bestValue > VALUE_MATED_IN_MAX_PLY || bestValue == -VALUE_INFINITE)) + && (bestValue > VALUE_MATED_IN_MAX_PLY || ( bestValue == -VALUE_INFINITE + && alpha > VALUE_MATED_IN_MAX_PLY))) { // Move count based pruning if ( depth < 16 * ONE_PLY -- 2.39.2