Skip to content

Commit

Permalink
Apply King Safety later in the endgame
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lucasart authored and glinscott committed Nov 6, 2014
1 parent bc83515 commit 8e98bd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/evaluate.cpp
Expand Up @@ -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<Down>(b);
b &= ei.attackedBy[Us][PAWN];
Expand Down

0 comments on commit 8e98bd6

Please sign in to comment.