Skip to content

Commit 9585f8e

Browse files
Stefano80mcostalba
authored andcommitted
Retire pawn span
Retire pawn span and replace with pawn count in evaluate_scale_factor. STC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 26482 W: 4929 L: 4818 D: 16735 LTC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 61938 W: 8400 L: 8335 D: 45203 Bench: 7662861
1 parent 7396c08 commit 9585f8e

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

src/evaluate.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,9 +758,9 @@ namespace {
758758
// Endings where weaker side can place his king in front of the opponent's
759759
// pawns are drawish.
760760
else if ( abs(eg) <= BishopValueEg
761-
&& ei.pi->pawn_span(strongSide) <= 1
761+
&& pos.count<PAWN>(strongSide) <= 2
762762
&& !pos.pawn_passed(~strongSide, pos.square<KING>(~strongSide)))
763-
sf = ei.pi->pawn_span(strongSide) ? ScaleFactor(51) : ScaleFactor(37);
763+
sf = ScaleFactor(37 + 7 * pos.count<PAWN>(strongSide));
764764
}
765765

766766
return sf;

src/pawns.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ namespace {
173173
}
174174

175175
b = e->semiopenFiles[Us] ^ 0xFF;
176-
e->pawnSpan[Us] = b ? int(msb(b) - lsb(b)) : 0;
177-
178176
return score;
179177
}
180178

src/pawns.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ struct Entry {
3737
Bitboard pawn_attacks(Color c) const { return pawnAttacks[c]; }
3838
Bitboard passed_pawns(Color c) const { return passedPawns[c]; }
3939
Bitboard pawn_attacks_span(Color c) const { return pawnAttacksSpan[c]; }
40-
int pawn_span(Color c) const { return pawnSpan[c]; }
4140
int pawn_asymmetry() const { return asymmetry; }
4241

4342
int semiopen_file(Color c, File f) const {
@@ -73,7 +72,6 @@ struct Entry {
7372
Score kingSafety[COLOR_NB];
7473
int castlingRights[COLOR_NB];
7574
int semiopenFiles[COLOR_NB];
76-
int pawnSpan[COLOR_NB];
7775
int pawnsOnSquares[COLOR_NB][COLOR_NB]; // [color][light/dark squares]
7876
int asymmetry;
7977
};

0 commit comments

Comments
 (0)