From 1f73a9ed639b6e55b96635c33b249f29ba726145 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Mon, 28 Feb 2011 20:17:57 +0100 Subject: [PATCH] Fix aspiration corner case Fix a corner case where we start aspiration window and suddendly we get a VALUE_KNOWN_WIN / MATE score, this makes aspiration to blow up in a series of researches loops. Exit aspiration loop in that case. Signed-off-by: Marco Costalba --- src/search.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 5a0af8f8..3f367d83 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -643,8 +643,7 @@ namespace { // Start with a small aspiration window and, in case of fail high/low, // research with bigger window until not failing high/low anymore. - while (true) - { + do { // Search starting from ss+1 to allow calling update_gains() value = search(pos, ss+1, alpha, beta, depth * ONE_PLY, 0); @@ -680,7 +679,8 @@ namespace { } else break; - } + + } while (abs(value) < VALUE_KNOWN_WIN); // Collect info about search result bestMove = Rml[0].pv[0]; -- 2.39.2