Merge pull request #45 from rektdie/insuff_mat

checking insufficient material draws | bench 2795598
This commit was merged in pull request #45.
This commit is contained in:
rektdie authored and GitHub committed 2025-03-30 12:23:11 +02:00
commit f05ba64487
1 file changed
+6 -1
+6 -1
View File
@@ -117,6 +117,11 @@ static bool IsFifty(Board &board) {
return (board.halfMoves >= 100);
}
static bool IsInsuffMat(Board &board) {
return (board.occupied.PopCount() <= 3
&& !(board.pieces[Pawn] | board.pieces[Queen] | board.pieces[Rook]));
}
static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int ply) {
int reduction = 0;
@@ -192,7 +197,7 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) {
}
pvLine.SetLength(ply);
if (ply && (IsThreefold(board) || IsFifty(board))) return 0;
if (ply && (IsThreefold(board) || IsFifty(board) || IsInsuffMat(board))) return 0;
// if NOT PV node then we try to hit the TTable