mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
![]() Position is win also if strong side has a bishop and a knight (plus other material, otherwise KBNK would be triggered instead of KXK). This fixes a subtle bug where a search on position k7/8/8/8/8/P7/PB6/K7 b - - 6 1 Instead of returning a draw score, suddendly returns a big score. This happens because at one point in search we reach this position: 8/Pk6/8/8/8/4B3/P7/K7 w - - 3 8 Where white can promote. In case of rook promotion (and also in case of queen promotion) the resutling position gets a huge static eval that is above VALUE_KNOWN_WIN (from the point of view of white). So for rook promotion it is && futilityBase > -VALUE_KNOWN_WIN that prevents futility pruning in qsearch. (Removing this condition indeed lets the problem occur). Raising the static eval for K+B+N+X v K to a value higher than VALUE_KNOWN_WIN fixes this particular problem without having to introduce an extra futility pruning condition in qsearch. I just checked and it seems K+R v K, K+2B v K and even K+B+N v K already get a huge static eval. Why not K+B+N+P v K? I think this fix corrects an oversight. There is special code for KBNK, but KBNXK is handled by KXK, so the test for sufficient material should also test for B+N. bench: 8678654 |
||
---|---|---|
.. | ||
benchmark.cpp | ||
bitbase.cpp | ||
bitboard.cpp | ||
bitboard.h | ||
bitcount.h | ||
book.cpp | ||
book.h | ||
endgame.cpp | ||
endgame.h | ||
evaluate.cpp | ||
evaluate.h | ||
main.cpp | ||
Makefile | ||
material.cpp | ||
material.h | ||
misc.cpp | ||
misc.h | ||
movegen.cpp | ||
movegen.h | ||
movepick.cpp | ||
movepick.h | ||
notation.cpp | ||
notation.h | ||
pawns.cpp | ||
pawns.h | ||
platform.h | ||
position.cpp | ||
position.h | ||
psqtab.h | ||
rkiss.h | ||
search.cpp | ||
search.h | ||
thread.cpp | ||
thread.h | ||
timeman.cpp | ||
timeman.h | ||
tt.cpp | ||
tt.h | ||
types.h | ||
uci.cpp | ||
ucioption.cpp | ||
ucioption.h |