-
Notifications
You must be signed in to change notification settings - Fork 8
TB_RESULTS
Andrew Grant edited this page Jul 16, 2024
·
2 revisions
unsigned TB_RESULT values are only returned from the tb_probe_root() function, which returns a move guaranteed to maintain the optimal WDL result. We must be able to confirm that the result is a valid one. We must be able to extract the WDL and/or DTZ values if we desire to convey a score to the UCI interface. We must be able to extract the encoded move and convert it to our own engine's format.
There are three special values for an unsigned TB_RESULT. Anything else implies a valid result.
TB_RESULT_FAILEDTB_RESULT_STALEMATETB_RESULT_CHECKMATE
The WDL and/or DTZ components of a result can be extracted with:
-
TB_RESULT_WDL(x)returns one of {TB_LOSS,TB_BLESSED_LOSS,TB_DRAW,TB_CURSED_WIN,TB_WIN} -
TB_RESULT_DTZ(x)returns the ply-distance until the next capture, mate, or pawn push
To help convert the move encoding, the following macros exist:
-
TB_RESULT_TO(x)returns anunsignedto-square -
TB_RESULT_FROM(x)returns anunsignedfrom-square -
TB_RESULT_IS_ENPASS(x)returns1if Enpassant, otherwise0 -
TB_RESULT_IS_QPROMO(x)returns1if a Queen Promotion, otherwise0 -
TB_RESULT_IS_RPROMO(x)returns1if a Rook Promotion, otherwise0 -
TB_RESULT_IS_BPROMO(x)returns1if a Knight Promotion, otherwise0 -
TB_RESULT_IS_NPROMO(x)returns1if a Bishop Promotion, otherwise0