Skip to content

Commit 8765f9c

Browse files
joergostermcostalba
authored andcommitted
Further simplify unstoppable (#938)
By finally moving it into passed pawns eval. Tested for no regression: STC LLR: 3.25 (-2.94,2.94) [-3.00,1.00] Total: 57109 W: 10023 L: 9947 D: 37139 LTC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 21511 W: 2800 L: 2680 D: 16031 Bench: 5255881
1 parent 3728e83 commit 8765f9c

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/evaluate.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ namespace {
197197
const Score WeakQueen = S(50, 10);
198198
const Score Hanging = S(48, 27);
199199
const Score ThreatByPawnPush = S(38, 22);
200-
const Score Unstoppable = S( 0, 45);
201200
const Score PawnlessFlank = S(20, 80);
202201
const Score HinderPassedPawn = S( 7, 0);
203202
const Score ThreatByRank = S(16, 3);
@@ -678,6 +677,10 @@ namespace {
678677
mbonus += rr + r * 2, ebonus += rr + r * 2;
679678
} // rr != 0
680679

680+
// Assign a small bonus when no pieces left (unstoppable)
681+
if (!pos.non_pawn_material(Us) && !pos.non_pawn_material(Them))
682+
ebonus += 20;
683+
681684
score += make_score(mbonus, ebonus) + PassedFile[file_of(s)];
682685
}
683686

@@ -852,16 +855,6 @@ Value Eval::evaluate(const Position& pos) {
852855
score += evaluate_passed_pawns<WHITE, DoTrace>(pos, ei)
853856
- evaluate_passed_pawns<BLACK, DoTrace>(pos, ei);
854857

855-
// If both sides have only pawns, score for potential unstoppable pawns
856-
if (!pos.non_pawn_material(WHITE) && !pos.non_pawn_material(BLACK))
857-
{
858-
if (ei.pi->passed_pawns(WHITE))
859-
score += Unstoppable;
860-
861-
if (ei.pi->passed_pawns(BLACK))
862-
score -= Unstoppable;
863-
}
864-
865858
// Evaluate space for both sides, only during opening
866859
if (pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK) >= 12222)
867860
score += evaluate_space<WHITE>(pos, ei)

0 commit comments

Comments
 (0)