Merge pull request #164 from rektdie/reorder-alpha-raise
place alpha raise above beta cutoff | bench 1136840
This commit was merged in pull request #164.
This commit is contained in:
1 file changed
+9
-9
+9
-9
@@ -690,6 +690,15 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
|||||||
seenCapturesCount++;
|
seenCapturesCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
results.score = std::max(score, results.score);
|
||||||
|
|
||||||
|
if (score > alpha) {
|
||||||
|
nodeType = PV;
|
||||||
|
alpha = score;
|
||||||
|
results.bestMove = currMove;
|
||||||
|
ctx->pvLine.SetMove(ply, currMove);
|
||||||
|
}
|
||||||
|
|
||||||
// Fail high (beta cutoff)
|
// Fail high (beta cutoff)
|
||||||
if (score >= beta) {
|
if (score >= beta) {
|
||||||
int bonus = historyBonusMultiplier * (depth + (!board.InCheck() && staticEval <= alpha)) - historyBonusSub;
|
int bonus = historyBonusMultiplier * (depth + (!board.InCheck() && staticEval <= alpha)) - historyBonusSub;
|
||||||
@@ -775,15 +784,6 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
|||||||
ctx->TT->WriteEntry(board.hashKey, depth, score, CutNode, currMove, ttpv);
|
ctx->TT->WriteEntry(board.hashKey, depth, score, CutNode, currMove, ttpv);
|
||||||
return score;
|
return score;
|
||||||
}
|
}
|
||||||
|
|
||||||
results.score = std::max(score, results.score);
|
|
||||||
|
|
||||||
if (score > alpha) {
|
|
||||||
nodeType = PV;
|
|
||||||
alpha = score;
|
|
||||||
results.bestMove = currMove;
|
|
||||||
ctx->pvLine.SetMove(ply, currMove);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moveSeen == 0) {
|
if (moveSeen == 0) {
|
||||||
|
|||||||
Reference in new issue
Block a user