From 8e98bd616e33cbe2d5cd7a22867a29d29bd67a1b Mon Sep 17 00:00:00 2001 From: lucasart Date: Thu, 6 Nov 2014 13:00:07 -0500 Subject: [PATCH] Apply King Safety later in the endgame Idea is to apply king safety later in the endgame. Previously, we didn't apply KS in a RR vs. Q ending for example, which causes poor play. Now we calculate king attacks when the attacking side has a queen or more. STC with 8moves_v3 LLR: 3.06 (-2.94,2.94) [0.00,4.00] Total: 38481 W: 6228 L: 5952 D: 26301 LTC with 2moves_v1 LLR: 2.95 (-2.94,2.94) [0.00,4.00] Total: 51053 W: 8670 L: 8353 D: 34030 Bench: 7514010 Resolves #98 --- src/evaluate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index f76862c7..d3665ea1 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -221,7 +221,7 @@ namespace { ei.attackedBy[Us][ALL_PIECES] = ei.attackedBy[Us][PAWN] = ei.pi->pawn_attacks(Us); // Init king safety tables only if we are going to use them - if (pos.non_pawn_material(Us) > QueenValueMg + PawnValueMg) + if (pos.non_pawn_material(Us) >= QueenValueMg) { ei.kingRing[Them] = b | shift_bb(b); b &= ei.attackedBy[Us][PAWN]; -- 2.39.2