mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Fix the handling of opposite bishops in KXK endgame evaluation
The case of three or more bishops against a long king must look at all of the bishops and not just the first two in the piece lists. This patch makes sure that the position is treated as a win when there are bishops on opposite colors. This functional change is very small because bench remains the same. LLR: 2.95 (-2.94,2.94) [-4.00,0.00] Total: 24249 W: 4349 L: 4275 D: 15625 http://tests.stockfishchess.org/tests/view/598186530ebc5916ff64a218 Bench: 5608839
This commit is contained in:
parent
2783203428
commit
5837228aa0
1 changed files with 2 additions and 2 deletions
|
@ -135,8 +135,8 @@ Value Endgame<KXK>::operator()(const Position& pos) const {
|
||||||
if ( pos.count<QUEEN>(strongSide)
|
if ( pos.count<QUEEN>(strongSide)
|
||||||
|| pos.count<ROOK>(strongSide)
|
|| pos.count<ROOK>(strongSide)
|
||||||
||(pos.count<BISHOP>(strongSide) && pos.count<KNIGHT>(strongSide))
|
||(pos.count<BISHOP>(strongSide) && pos.count<KNIGHT>(strongSide))
|
||||||
||(pos.count<BISHOP>(strongSide) > 1 && opposite_colors(pos.squares<BISHOP>(strongSide)[0],
|
|| ( (pos.pieces(strongSide, BISHOP) & ~DarkSquares)
|
||||||
pos.squares<BISHOP>(strongSide)[1])))
|
&& (pos.pieces(strongSide, BISHOP) & DarkSquares)))
|
||||||
result = std::min(result + VALUE_KNOWN_WIN, VALUE_MATE_IN_MAX_PLY - 1);
|
result = std::min(result + VALUE_KNOWN_WIN, VALUE_MATE_IN_MAX_PLY - 1);
|
||||||
|
|
||||||
return strongSide == pos.side_to_move() ? result : -result;
|
return strongSide == pos.side_to_move() ? result : -result;
|
||||||
|
|
Loading…
Add table
Reference in a new issue