]> git.sesse.net Git - stockfish/commit
Use correct occupancy in connected_threat()
authorMarco Costalba <mcostalba@gmail.com>
Tue, 30 Oct 2012 19:21:22 +0000 (20:21 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 30 Oct 2012 19:27:07 +0000 (20:27 +0100)
commitfe1cbe26383085a44809d56493d29ce9c1815aa8
treebd3d8770f7e50dc6399522829d770a2c5078253d
parent4e31c39a6494499ba85db0e0014bbbaac9770b1d
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: 5323798
src/search.cpp