mirror of
https://github.com/sockspls/badfish
synced 2025-05-02 17:49:35 +00:00
Broader condition for dangerous pawn moves
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
This commit is contained in:
parent
2408243cf4
commit
69a14554ee
3 changed files with 7 additions and 8 deletions
|
@ -84,6 +84,8 @@ extern Bitboard PseudoAttacks[PIECE_TYPE_NB][SQUARE_NB];
|
||||||
extern int SquareDistance[SQUARE_NB][SQUARE_NB];
|
extern int SquareDistance[SQUARE_NB][SQUARE_NB];
|
||||||
|
|
||||||
const Bitboard DarkSquares = 0xAA55AA55AA55AA55ULL;
|
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
|
/// 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.
|
/// whether a given bit is set in a bitboard, and for setting and clearing bits.
|
||||||
|
|
|
@ -123,7 +123,7 @@ public:
|
||||||
bool capture(Move m) const;
|
bool capture(Move m) const;
|
||||||
bool capture_or_promotion(Move m) const;
|
bool capture_or_promotion(Move m) const;
|
||||||
bool gives_check(Move m, const CheckInfo& ci) 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;
|
Piece moved_piece(Move m) const;
|
||||||
PieceType captured_piece_type() const;
|
PieceType captured_piece_type() const;
|
||||||
|
|
||||||
|
@ -326,10 +326,8 @@ inline bool Position::pawn_passed(Color c, Square s) 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 {
|
inline bool Position::advanced_pawn_push(Move m) const {
|
||||||
|
return pieces(PAWN) & TheirHalf[sideToMove] & from_sq(m);
|
||||||
return type_of(moved_piece(m)) == PAWN
|
|
||||||
&& pawn_passed(sideToMove, to_sq(m));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Key Position::key() const {
|
inline Key Position::key() const {
|
||||||
|
|
|
@ -807,7 +807,7 @@ moves_loop: // When in check and at SpNode search starts from here
|
||||||
captureOrPromotion = pos.capture_or_promotion(move);
|
captureOrPromotion = pos.capture_or_promotion(move);
|
||||||
givesCheck = pos.gives_check(move, ci);
|
givesCheck = pos.gives_check(move, ci);
|
||||||
dangerous = givesCheck
|
dangerous = givesCheck
|
||||||
|| pos.passed_pawn_push(move)
|
|| pos.advanced_pawn_push(move)
|
||||||
|| type_of(move) == CASTLING;
|
|| type_of(move) == CASTLING;
|
||||||
|
|
||||||
// Step 12. Extend checks
|
// Step 12. Extend checks
|
||||||
|
@ -1207,9 +1207,8 @@ moves_loop: // When in check and at SpNode search starts from here
|
||||||
&& !InCheck
|
&& !InCheck
|
||||||
&& !givesCheck
|
&& !givesCheck
|
||||||
&& move != ttMove
|
&& 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
|
futilityValue = futilityBase
|
||||||
+ PieceValue[EG][pos.piece_on(to_sq(move))]
|
+ PieceValue[EG][pos.piece_on(to_sq(move))]
|
||||||
|
|
Loading…
Add table
Reference in a new issue