Instead of a passed pawn now we just require the pawn to
be in the opponent camp to be considered a dangerous
move. Added some renaming to reflect the change.
Passed both short TC test
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 10358 W: 2033 L: 1900 D: 6425
And long TC
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 21459 W: 3486 L: 3286 D: 14687
bench:
8322172
extern int SquareDistance[SQUARE_NB][SQUARE_NB];
const Bitboard DarkSquares = 0xAA55AA55AA55AA55ULL;
extern int SquareDistance[SQUARE_NB][SQUARE_NB];
const Bitboard DarkSquares = 0xAA55AA55AA55AA55ULL;
+const Bitboard TheirHalf[COLOR_NB] = { Rank5BB | Rank6BB | Rank7BB | Rank8BB,
+ Rank1BB | Rank2BB | Rank3BB | Rank4BB };
/// Overloads of bitwise operators between a Bitboard and a Square for testing
/// whether a given bit is set in a bitboard, and for setting and clearing bits.
/// Overloads of bitwise operators between a Bitboard and a Square for testing
/// whether a given bit is set in a bitboard, and for setting and clearing bits.
bool capture(Move m) const;
bool capture_or_promotion(Move m) const;
bool gives_check(Move m, const CheckInfo& ci) const;
bool capture(Move m) const;
bool capture_or_promotion(Move m) const;
bool gives_check(Move m, const CheckInfo& ci) const;
- bool passed_pawn_push(Move m) const;
+ bool advanced_pawn_push(Move m) const;
Piece moved_piece(Move m) const;
PieceType captured_piece_type() const;
Piece moved_piece(Move m) const;
PieceType captured_piece_type() const;
return !(pieces(~c, PAWN) & passed_pawn_mask(c, s));
}
return !(pieces(~c, PAWN) & passed_pawn_mask(c, s));
}
-inline bool Position::passed_pawn_push(Move m) const {
-
- return type_of(moved_piece(m)) == PAWN
- && pawn_passed(sideToMove, to_sq(m));
+inline bool Position::advanced_pawn_push(Move m) const {
+ return pieces(PAWN) & TheirHalf[sideToMove] & from_sq(m);
}
inline Key Position::key() const {
}
inline Key Position::key() const {
captureOrPromotion = pos.capture_or_promotion(move);
givesCheck = pos.gives_check(move, ci);
dangerous = givesCheck
captureOrPromotion = pos.capture_or_promotion(move);
givesCheck = pos.gives_check(move, ci);
dangerous = givesCheck
- || pos.passed_pawn_push(move)
+ || pos.advanced_pawn_push(move)
|| type_of(move) == CASTLING;
// Step 12. Extend checks
|| type_of(move) == CASTLING;
// Step 12. Extend checks
&& !InCheck
&& !givesCheck
&& move != ttMove
&& !InCheck
&& !givesCheck
&& move != ttMove
- && type_of(move) != PROMOTION
&& futilityBase > -VALUE_KNOWN_WIN
&& futilityBase > -VALUE_KNOWN_WIN
- && !pos.passed_pawn_push(move))
+ && !pos.advanced_pawn_push(move))
{
futilityValue = futilityBase
+ PieceValue[EG][pos.piece_on(to_sq(move))]
{
futilityValue = futilityBase
+ PieceValue[EG][pos.piece_on(to_sq(move))]