Use correct occupancy in connected_threat()
When checking if a move defends the threatened piece we correctly remove from the occupancy bitboard the moved piece. This patch removes from the occupancy also the threatening piece so to consider the cases of moves that defend the threatened piece x-raying through the threat move. As example in this position: r3k2r/p1ppqp2/Bn4p1/3p1n2/4P1N1/5Q1P/PPP2P1P/R3K2R w KQkq - 1 10 The threat black move is dxe4. With this patch we include (and so don't prune) white's Bb7 that would be pruned otherwise. The number of affected position is very low, around 1% of cases, so we don't expect ELO changes, neverthless this is the logical and natural thing to do. Patch suggested by Hongzhicheng. new bench: 5323798sf_3_base
parent
4e31c39a64
commit
fe1cbe2638
|
@ -1426,8 +1426,8 @@ split_point_start: // At split points actual search starts from here
|
||||||
&& ( PieceValue[MG][pos.piece_on(tfrom)] >= PieceValue[MG][pos.piece_on(tto)]
|
&& ( PieceValue[MG][pos.piece_on(tfrom)] >= PieceValue[MG][pos.piece_on(tto)]
|
||||||
|| type_of(pos.piece_on(tfrom)) == KING))
|
|| type_of(pos.piece_on(tfrom)) == KING))
|
||||||
{
|
{
|
||||||
// Update occupancy as if the piece is moving
|
// Update occupancy as if the piece and the threat are moving
|
||||||
Bitboard occ = pos.pieces() ^ mfrom ^ mto;
|
Bitboard occ = pos.pieces() ^ mfrom ^ mto ^ tfrom;
|
||||||
Piece piece = pos.piece_on(mfrom);
|
Piece piece = pos.piece_on(mfrom);
|
||||||
|
|
||||||
// The moved piece attacks the square 'tto' ?
|
// The moved piece attacks the square 'tto' ?
|
||||||
|
|
Loading…
Reference in New Issue