Skip to content

Commit

Permalink
Simplify unstoppable condition
Browse files Browse the repository at this point in the history
STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 86389 W: 15165 L: 15153 D: 56071

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 98143 W: 12311 L: 12288 D: 73544

Bench: 5437987
  • Loading branch information
jcalovski authored and mcostalba committed Dec 11, 2016
1 parent a47bbca commit 589049a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/evaluate.cpp
Expand Up @@ -197,7 +197,7 @@ namespace {
const Score WeakQueen = S(50, 10);
const Score Hanging = S(48, 27);
const Score ThreatByPawnPush = S(38, 22);
const Score Unstoppable = S( 0, 20);
const Score Unstoppable = S( 0, 45);
const Score PawnlessFlank = S(20, 80);
const Score HinderPassedPawn = S( 7, 0);
const Score ThreatByRank = S(16, 3);
Expand Down Expand Up @@ -855,12 +855,11 @@ Value Eval::evaluate(const Position& pos) {
// If both sides have only pawns, score for potential unstoppable pawns
if (!pos.non_pawn_material(WHITE) && !pos.non_pawn_material(BLACK))
{
Bitboard b;
if ((b = ei.pi->passed_pawns(WHITE)) != 0)
score += Unstoppable * int(relative_rank(WHITE, frontmost_sq(WHITE, b)));
if (ei.pi->passed_pawns(WHITE))
score += Unstoppable;

if ((b = ei.pi->passed_pawns(BLACK)) != 0)
score -= Unstoppable * int(relative_rank(BLACK, frontmost_sq(BLACK, b)));
if (ei.pi->passed_pawns(BLACK))
score -= Unstoppable;
}

// Evaluate space for both sides, only during opening
Expand Down

1 comment on commit 589049a

@Rocky640
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in #998

To be exact:

A 1st simplification was committed Dec 11, 2016 #924
A 2nd simplification was committed Dec 22, 2016 #938
A 3rd simplification was committed Jan 1st, 2017 #950
A final simplification was committed 3 days ago #998

This restore the code before the 1st simplification.

Please sign in to comment.