mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-06 10:53:50 +08:00
Fix wrong constant usage in go mate
Fixes an oversight in https://github.com/official-stockfish/Stockfish/pull/5094 In theory, master could stop search when run with `go mate 247` and return a TB loss (not a mate score). Also fixes the spelling of opponenWorsening. closes https://github.com/official-stockfish/Stockfish/pull/5096 No functional change
This commit is contained in:
committed by
Disservin
parent
0f01a516d2
commit
632f1c21cd
@@ -407,7 +407,7 @@ void Search::Worker::iterative_deepening() {
|
|||||||
&& ((rootMoves[0].score >= VALUE_MATE_IN_MAX_PLY
|
&& ((rootMoves[0].score >= VALUE_MATE_IN_MAX_PLY
|
||||||
&& VALUE_MATE - rootMoves[0].score <= 2 * limits.mate)
|
&& VALUE_MATE - rootMoves[0].score <= 2 * limits.mate)
|
||||||
|| (rootMoves[0].score != -VALUE_INFINITE
|
|| (rootMoves[0].score != -VALUE_INFINITE
|
||||||
&& rootMoves[0].score <= VALUE_TB_LOSS_IN_MAX_PLY
|
&& rootMoves[0].score <= VALUE_MATED_IN_MAX_PLY
|
||||||
&& VALUE_MATE + rootMoves[0].score <= 2 * limits.mate)))
|
&& VALUE_MATE + rootMoves[0].score <= 2 * limits.mate)))
|
||||||
threads.stop = true;
|
threads.stop = true;
|
||||||
|
|
||||||
@@ -539,7 +539,7 @@ Value Search::Worker::search(
|
|||||||
Move ttMove, move, excludedMove, bestMove;
|
Move ttMove, move, excludedMove, bestMove;
|
||||||
Depth extension, newDepth;
|
Depth extension, newDepth;
|
||||||
Value bestValue, value, ttValue, eval, maxValue, probCutBeta;
|
Value bestValue, value, ttValue, eval, maxValue, probCutBeta;
|
||||||
bool givesCheck, improving, priorCapture, opponenWorsening;
|
bool givesCheck, improving, priorCapture, opponentWorsening;
|
||||||
bool capture, moveCountPruning, ttCapture;
|
bool capture, moveCountPruning, ttCapture;
|
||||||
Piece movedPiece;
|
Piece movedPiece;
|
||||||
int moveCount, captureCount, quietCount;
|
int moveCount, captureCount, quietCount;
|
||||||
@@ -748,7 +748,7 @@ Value Search::Worker::search(
|
|||||||
? ss->staticEval > (ss - 2)->staticEval
|
? ss->staticEval > (ss - 2)->staticEval
|
||||||
: (ss - 4)->staticEval != VALUE_NONE && ss->staticEval > (ss - 4)->staticEval;
|
: (ss - 4)->staticEval != VALUE_NONE && ss->staticEval > (ss - 4)->staticEval;
|
||||||
|
|
||||||
opponenWorsening = ss->staticEval + (ss - 1)->staticEval > 2 && (depth != 2 || !improving);
|
opponentWorsening = ss->staticEval + (ss - 1)->staticEval > 2 && (depth != 2 || !improving);
|
||||||
|
|
||||||
// Step 7. Razoring (~1 Elo)
|
// Step 7. Razoring (~1 Elo)
|
||||||
// If eval is really low check with qsearch if it can exceed alpha, if it can't,
|
// If eval is really low check with qsearch if it can exceed alpha, if it can't,
|
||||||
@@ -764,7 +764,7 @@ Value Search::Worker::search(
|
|||||||
// Step 8. Futility pruning: child node (~40 Elo)
|
// Step 8. Futility pruning: child node (~40 Elo)
|
||||||
// The depth condition is important for mate finding.
|
// The depth condition is important for mate finding.
|
||||||
if (!ss->ttPv && depth < 11
|
if (!ss->ttPv && depth < 11
|
||||||
&& eval - futility_margin(depth, cutNode && !ss->ttHit, improving, opponenWorsening)
|
&& eval - futility_margin(depth, cutNode && !ss->ttHit, improving, opponentWorsening)
|
||||||
- (ss - 1)->statScore / 314
|
- (ss - 1)->statScore / 314
|
||||||
>= beta
|
>= beta
|
||||||
&& eval >= beta && eval < 30016 // smaller than TB wins
|
&& eval >= beta && eval < 30016 // smaller than TB wins
|
||||||
@@ -1046,7 +1046,8 @@ moves_loop: // When in check, search starts here
|
|||||||
extension = 2 + (value < singularBeta - 78 && !ttCapture);
|
extension = 2 + (value < singularBeta - 78 && !ttCapture);
|
||||||
depth += depth < 16;
|
depth += depth < 16;
|
||||||
}
|
}
|
||||||
if (PvNode && !ttCapture && ss->multipleExtensions <= 5 && value < singularBeta - 50)
|
if (PvNode && !ttCapture && ss->multipleExtensions <= 5
|
||||||
|
&& value < singularBeta - 50)
|
||||||
extension = 2;
|
extension = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user