From: Marco Costalba Date: Mon, 28 Feb 2011 19:17:57 +0000 (+0100) Subject: Fix aspiration corner case X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=1f73a9ed639b6e55b96635c33b249f29ba726145 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 --- 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];