Skip to content

Commit ab4f498

Browse files
lucasartmcostalba
authored andcommitted
Remove SafeCheck (#946)
It was a bit of a hack, without intrinsic value, but rather compensating for the fact that checks were mistuned. STC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 88308 W: 15553 L: 15545 D: 57210 LTC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 53115 W: 6741 L: 6662 D: 39712 bench 5468995
1 parent 8765f9c commit ab4f498

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/evaluate.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ namespace {
190190
const Score RookOnPawn = S( 8, 24);
191191
const Score TrappedRook = S(92, 0);
192192
const Score CloseEnemies = S( 7, 0);
193-
const Score SafeCheck = S(20, 20);
194193
const Score OtherCheck = S(10, 10);
195194
const Score ThreatByHangingPawn = S(71, 61);
196195
const Score LooseEnemies = S( 0, 25);
@@ -214,10 +213,10 @@ namespace {
214213

215214
// Penalties for enemy's safe checks
216215
const int QueenContactCheck = 997;
217-
const int QueenCheck = 695;
218-
const int RookCheck = 638;
219-
const int BishopCheck = 538;
220-
const int KnightCheck = 874;
216+
const int QueenCheck = 745;
217+
const int RookCheck = 688;
218+
const int BishopCheck = 588;
219+
const int KnightCheck = 924;
221220

222221

223222
// eval_init() initializes king and attack bitboards for a given color
@@ -447,7 +446,7 @@ namespace {
447446

448447
// Enemy queen safe checks
449448
if ((b1 | b2) & ei.attackedBy[Them][QUEEN] & safe)
450-
kingDanger += QueenCheck, score -= SafeCheck;
449+
kingDanger += QueenCheck;
451450

452451
// For other pieces, also consider the square safe if attacked twice,
453452
// and only defended by a queen.
@@ -457,22 +456,22 @@ namespace {
457456

458457
// Enemy rooks safe and other checks
459458
if (b1 & ei.attackedBy[Them][ROOK] & safe)
460-
kingDanger += RookCheck, score -= SafeCheck;
459+
kingDanger += RookCheck;
461460

462461
else if (b1 & ei.attackedBy[Them][ROOK] & other)
463462
score -= OtherCheck;
464463

465464
// Enemy bishops safe and other checks
466465
if (b2 & ei.attackedBy[Them][BISHOP] & safe)
467-
kingDanger += BishopCheck, score -= SafeCheck;
466+
kingDanger += BishopCheck;
468467

469468
else if (b2 & ei.attackedBy[Them][BISHOP] & other)
470469
score -= OtherCheck;
471470

472471
// Enemy knights safe and other checks
473472
b = pos.attacks_from<KNIGHT>(ksq) & ei.attackedBy[Them][KNIGHT];
474473
if (b & safe)
475-
kingDanger += KnightCheck, score -= SafeCheck;
474+
kingDanger += KnightCheck;
476475

477476
else if (b & other)
478477
score -= OtherCheck;

0 commit comments

Comments
 (0)