mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Fix a (bestValue == -VALUE_INFINITE) assert
In case of a Root node we can leave with bestValue set to -VALUE_INFINITE if search is stopped by the GUI and stopReques flag is raised. This patch fixes the issue. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -802,7 +802,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
else if (Root)
|
else if (Root)
|
||||||
bestValue = alpha;
|
bestValue = alpha;
|
||||||
else {} // Hack to fix icc's "statement is unreachable" warning
|
else {} // Hack to fix icc's "statement is unreachable" warning FIXME
|
||||||
|
|
||||||
// Step 1. Initialize node and poll. Polling can abort search
|
// Step 1. Initialize node and poll. Polling can abort search
|
||||||
ss->currentMove = ss->bestMove = threatMove = MOVE_NONE;
|
ss->currentMove = ss->bestMove = threatMove = MOVE_NONE;
|
||||||
@@ -1233,6 +1233,10 @@ split_point_start: // At split points actual search starts from here
|
|||||||
|
|
||||||
if (Root)
|
if (Root)
|
||||||
{
|
{
|
||||||
|
// To avoid to exit with bestValue == -VALUE_INFINITE
|
||||||
|
if (value > bestValue)
|
||||||
|
bestValue = value;
|
||||||
|
|
||||||
// Finished searching the move. If StopRequest is true, the search
|
// Finished searching the move. If StopRequest is true, the search
|
||||||
// was aborted because the user interrupted the search or because we
|
// was aborted because the user interrupted the search or because we
|
||||||
// ran out of time. In this case, the return value of the search cannot
|
// ran out of time. In this case, the return value of the search cannot
|
||||||
@@ -1274,10 +1278,10 @@ split_point_start: // At split points actual search starts from here
|
|||||||
{
|
{
|
||||||
// Raise alpha to setup proper non-pv search upper bound
|
// Raise alpha to setup proper non-pv search upper bound
|
||||||
if (value > alpha)
|
if (value > alpha)
|
||||||
alpha = bestValue = value;
|
alpha = value;
|
||||||
}
|
}
|
||||||
else // Set alpha equal to minimum score among the PV lines
|
else // Set alpha equal to minimum score among the PV lines
|
||||||
alpha = bestValue = Rml[Min(moveCount, MultiPV) - 1].pv_score; // FIXME why moveCount?
|
alpha = Rml[Min(moveCount, MultiPV) - 1].pv_score; // FIXME why moveCount?
|
||||||
|
|
||||||
} // PV move or new best move
|
} // PV move or new best move
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user