Skip to content

Commit 75ac6c7

Browse files
xu-shawnvondele
authored andcommitted
simplify stalemate further
Non-regression STC: LLR: 2.93 (-2.94,2.94) <-1.75,0.25> Total: 155200 W: 40650 L: 40562 D: 73988 Ptnml(0-2): 533, 17588, 41258, 17700, 521 https://tests.stockfishchess.org/tests/view/68abe11375da51a345a5adec Non-regression LTC: LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 82824 W: 21442 L: 21287 D: 40095 Ptnml(0-2): 51, 8738, 23675, 8901, 47 https://tests.stockfishchess.org/tests/view/68b205606217b8721dca9c8e 10k Stalemate: Elo: 1.46 ± 1.2 (95%) LOS: 99.0% Total: 10000 W: 4640 L: 4598 D: 762 Ptnml(0-2): 0, 140, 4678, 182, 0 https://tests.stockfishchess.org/tests/view/68b2059b6217b8721dca9c90 closes #6283 Bench: 2431727
1 parent da63060 commit 75ac6c7

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/search.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,16 +1049,11 @@ Value Search::Worker::search(
10491049
}
10501050

10511051
// SEE based pruning for captures and checks
1052+
// Avoid pruning sacrifices of our last piece for stalemate
10521053
int margin = std::max(157 * depth + captHist / 29, 0);
1053-
if (!pos.see_ge(move, -margin))
1054-
{
1055-
bool mayStalemateTrap =
1056-
depth > 2 && alpha < 0 && pos.non_pawn_material(us) == PieceValue[movedPiece];
1057-
1058-
// avoid pruning sacrifices of our last piece for stalemate
1059-
if (!mayStalemateTrap)
1060-
continue;
1061-
}
1054+
if ((alpha >= VALUE_DRAW || pos.non_pawn_material(us) != PieceValue[movedPiece])
1055+
&& !pos.see_ge(move, -margin))
1056+
continue;
10621057
}
10631058
else
10641059
{

0 commit comments

Comments
 (0)