From: disservin Date: Mon, 23 Jan 2023 18:32:26 +0000 (+0100) Subject: Fixed UCI TB win values X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=def296670dbde6cfad446a735f37f25cfe9df6a2 Fixed UCI TB win values This patch results in search values for a TB win/loss to be reported in a way that does not change with normalization, i.e. will be consistent over time. A value of 200.00 pawns is now reported upon entering a TB won position. Values smaller than 200.00 relate to the distance in plies from the root to the probed position position, with 1 cp being 1 ply distance. closes https://github.com/official-stockfish/Stockfish/pull/4353 No functional change --- diff --git a/src/uci.cpp b/src/uci.cpp index 30c1fa0c..2afd2de7 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -314,8 +314,13 @@ string UCI::value(Value v) { stringstream ss; - if (abs(v) < VALUE_MATE_IN_MAX_PLY) + if (abs(v) < VALUE_TB_WIN_IN_MAX_PLY) ss << "cp " << v * 100 / NormalizeToPawnValue; + else if (abs(v) < VALUE_MATE_IN_MAX_PLY) + { + const int ply = VALUE_MATE_IN_MAX_PLY - 1 - std::abs(v); // recompute ss->ply + ss << "cp " << (v > 0 ? 20000 - ply : -20000 + ply); + } else ss << "mate " << (v > 0 ? VALUE_MATE - v + 1 : -VALUE_MATE - v) / 2;