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 <mcostalba@gmail.com>
// 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<PV, false, true>(pos, ss+1, alpha, beta, depth * ONE_PLY, 0);
}
else
break;
- }
+
+ } while (abs(value) < VALUE_KNOWN_WIN);
// Collect info about search result
bestMove = Rml[0].pv[0];