mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 18:17:02 +08:00
Simplify unstoppable pawns
Tested in no-regression mode and passed both STC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 17919 W: 3103 L: 2978 D: 11838 and LTC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 31460 W: 4414 L: 4308 D: 22738 bench: 7709279
This commit is contained in:
committed by
Marco Costalba
parent
73ca93f3c0
commit
66c93245e0
@@ -613,17 +613,14 @@ namespace {
|
|||||||
|
|
||||||
|
|
||||||
// evaluate_unstoppable_pawns() scores the most advanced among the passed and
|
// evaluate_unstoppable_pawns() scores the most advanced among the passed and
|
||||||
// candidate pawns. In case opponent has no pieces but pawns, this is somewhat
|
// candidate pawns. In case both players have no pieces but pawns, this is
|
||||||
// related to the possibility that pawns are unstoppable.
|
// somewhat related to the possibility that pawns are unstoppable.
|
||||||
|
|
||||||
Score evaluate_unstoppable_pawns(const Position& pos, Color us, const EvalInfo& ei) {
|
Score evaluate_unstoppable_pawns(Color us, const EvalInfo& ei) {
|
||||||
|
|
||||||
Bitboard b = ei.pi->passed_pawns(us) | ei.pi->candidate_pawns(us);
|
Bitboard b = ei.pi->passed_pawns(us) | ei.pi->candidate_pawns(us);
|
||||||
|
|
||||||
if (!b || pos.non_pawn_material(~us))
|
return b ? Unstoppable * int(relative_rank(us, frontmost_sq(us, b))) : SCORE_ZERO;
|
||||||
return SCORE_ZERO;
|
|
||||||
|
|
||||||
return Unstoppable * int(relative_rank(us, frontmost_sq(us, b)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -716,10 +713,10 @@ namespace {
|
|||||||
score += evaluate_passed_pawns<WHITE, Trace>(pos, ei)
|
score += evaluate_passed_pawns<WHITE, Trace>(pos, ei)
|
||||||
- evaluate_passed_pawns<BLACK, Trace>(pos, ei);
|
- evaluate_passed_pawns<BLACK, Trace>(pos, ei);
|
||||||
|
|
||||||
// If one side has only a king, score for potential unstoppable pawns
|
// If both sides have only pawns, score for potential unstoppable pawns
|
||||||
if (!pos.non_pawn_material(WHITE) || !pos.non_pawn_material(BLACK))
|
if (!pos.non_pawn_material(WHITE) && !pos.non_pawn_material(BLACK))
|
||||||
score += evaluate_unstoppable_pawns(pos, WHITE, ei)
|
score += evaluate_unstoppable_pawns(WHITE, ei)
|
||||||
- evaluate_unstoppable_pawns(pos, BLACK, ei);
|
- evaluate_unstoppable_pawns(BLACK, ei);
|
||||||
|
|
||||||
// Evaluate space for both sides, only in middlegame
|
// Evaluate space for both sides, only in middlegame
|
||||||
if (ei.mi->space_weight())
|
if (ei.mi->space_weight())
|
||||||
|
|||||||
Reference in New Issue
Block a user