1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Simplify away non-normal moves in SEE

credit goes to @mstembera for suggesting this approach.
SEE now deals with castling, promotion and en passant in a similar way.

passed STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 32902 W: 6079 L: 5979 D: 20844

passed LTC
LLR: 3.92 (-2.94,2.94) [-3.00,1.00]
Total: 110698 W: 14198 L: 14145 D: 82355

Bench: 5713905
This commit is contained in:
Joost VandeVondele 2017-08-25 15:15:26 +02:00 committed by Marco Costalba
parent a2b8f91cfa
commit bf485f4aff

View file

@ -993,10 +993,8 @@ bool Position::see_ge(Move m, Value threshold) const {
assert(is_ok(m));
// Castling moves are implemented as king capturing the rook so cannot be
// handled correctly. Simply assume the SEE value is VALUE_ZERO that is always
// correct unless in the rare case the rook ends up under attack.
if (type_of(m) == CASTLING)
// Only deal with normal moves, assume others pass a simple see
if (type_of(m) != NORMAL)
return VALUE_ZERO >= threshold;
Square from = from_sq(m), to = to_sq(m);
@ -1005,16 +1003,8 @@ bool Position::see_ge(Move m, Value threshold) const {
Value balance; // Values of the pieces taken by us minus opponent's ones
Bitboard occupied, stmAttackers;
if (type_of(m) == ENPASSANT)
{
occupied = SquareBB[to - pawn_push(~stm)]; // Remove the captured pawn
balance = PieceValue[MG][PAWN];
}
else
{
balance = PieceValue[MG][piece_on(to)];
occupied = 0;
}
balance = PieceValue[MG][piece_on(to)];
occupied = 0;
if (balance < threshold)
return false;