mirror of
https://github.com/sockspls/badfish
synced 2025-07-12 12:09:14 +00:00
![]() Currently (after #5407), SF has the property that any PV line with a decisive
TB score contains the corresponding TB position, with a score that correctly
identifies the depth at which TB are entered. The PV line that follows might
not preserve the game outcome, but can easily be verified and extended based on
TB information. This patch provides this functionality, simply extending the PV
lines on output, this doesn't affect search.
Indeed, if DTZ tables are available, search based PV lines that correspond to
decisive TB scores are verified to preserve game outcome, truncating the line
as needed. Subsequently, such PV lines are extended with a game outcome
preserving line until mate, as a possible continuation. These lines are not
optimal mating lines, but are similar to what a user could produce on a website
like https://syzygy-tables.info/ clicking always the top ranked move, i.e.
minimizing or maximizing DTZ (with a simple tie-breaker for moves that have
identical DTZ), and are thus an just an illustration of how to game can be won.
A similar approach is already in established in
https://github.com/joergoster/Stockfish/tree/matefish2
This also contributes to addressing #5175 where SF can give an incorrect TB
win/loss for positions in TB with a movecounter that doesn't reflect optimal
play. While the full solution requires either TB generated differently, or a
search when ranking rootmoves, current SF will eventually find a draw in these
cases, in practice quite quickly, e.g.
`1kq5/q2r4/5K2/8/8/8/8/7Q w - - 96 1`
`8/8/6k1/3B4/3K4/4N3/8/8 w - - 54 106`
Gives the same results as master on an extended set of test positions from
|
||
---|---|---|
.. | ||
incbin | ||
nnue | ||
syzygy | ||
benchmark.cpp | ||
benchmark.h | ||
bitboard.cpp | ||
bitboard.h | ||
engine.cpp | ||
engine.h | ||
evaluate.cpp | ||
evaluate.h | ||
main.cpp | ||
Makefile | ||
memory.cpp | ||
memory.h | ||
misc.cpp | ||
misc.h | ||
movegen.cpp | ||
movegen.h | ||
movepick.cpp | ||
movepick.h | ||
numa.h | ||
perft.h | ||
position.cpp | ||
position.h | ||
score.cpp | ||
score.h | ||
search.cpp | ||
search.h | ||
thread.cpp | ||
thread.h | ||
thread_win32_osx.h | ||
timeman.cpp | ||
timeman.h | ||
tt.cpp | ||
tt.h | ||
tune.cpp | ||
tune.h | ||
types.h | ||
uci.cpp | ||
uci.h | ||
ucioption.cpp | ||
ucioption.h |