Skip to content

Commit d58e836

Browse files
Vizvezdenecsnicolet
authored andcommitted
Remove advanced_pawn_push()
Continuation of work by @topologist: we now do futility pruning and movecount pruning in qsearch() for pawn pushes up to the 7th rank. So the condition to avoid the pruning is if the move is a promotion or not. This allows to get rid of the advanced_pawn_push() function in position.h alltogether. Passed STC https://tests.stockfishchess.org/tests/view/6048c5842433018de7a387e6 LLR: 2.93 (-2.94,2.94) {-1.25,0.25} Total: 34424 W: 3081 L: 3015 D: 28328 Ptnml(0-2): 110, 2442, 12052, 2488, 120 Passed LTC https://tests.stockfishchess.org/tests/view/6048f7d22433018de7a387f0 LLR: 2.94 (-2.94,2.94) {-0.75,0.25} Total: 142024 W: 5170 L: 5202 D: 131652 Ptnml(0-2): 50, 4678, 61613, 4596, 75 Closes #3390 Bench: 4339126
1 parent 830f597 commit d58e836

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

src/position.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ class Position {
128128
bool capture(Move m) const;
129129
bool capture_or_promotion(Move m) const;
130130
bool gives_check(Move m) const;
131-
bool advanced_pawn_push(Move m) const;
132131
Piece moved_piece(Move m) const;
133132
Piece captured_piece() const;
134133

@@ -310,11 +309,6 @@ inline bool Position::pawn_passed(Color c, Square s) const {
310309
return !(pieces(~c, PAWN) & passed_pawn_span(c, s));
311310
}
312311

313-
inline bool Position::advanced_pawn_push(Move m) const {
314-
return type_of(moved_piece(m)) == PAWN
315-
&& relative_rank(sideToMove, to_sq(m)) > RANK_6;
316-
}
317-
318312
inline int Position::pawns_on_same_color_squares(Color c, Square s) const {
319313
return popcount(pieces(c, PAWN) & ((DarkSquares & s) ? DarkSquares : ~DarkSquares));
320314
}

src/search.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,7 @@ namespace {
15791579
if ( bestValue > VALUE_TB_LOSS_IN_MAX_PLY
15801580
&& !givesCheck
15811581
&& futilityBase > -VALUE_KNOWN_WIN
1582-
&& !pos.advanced_pawn_push(move))
1582+
&& type_of(move) != PROMOTION)
15831583
{
15841584

15851585
if (moveCount > 2)

0 commit comments

Comments
 (0)