1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Display classic and NNUE evaluation in trace mode

show both the classical and NNUE evaluation,
as well as the Final evaluation.

closes https://github.com/official-stockfish/Stockfish/pull/3042

No functional change.
This commit is contained in:
MJZ1977 2020-08-21 10:57:34 +02:00 committed by Joost VandeVondele
parent e64b957274
commit cbcb05ca09

View file

@ -972,12 +972,6 @@ std::string Eval::trace(const Position& pos) {
Value v;
if (Eval::useNNUE)
{
v = NNUE::evaluate(pos);
}
else
{
std::memset(scores, 0, sizeof(scores));
pos.this_thread()->contempt = SCORE_ZERO; // Reset any dynamic contempt
@ -1003,11 +997,22 @@ std::string Eval::trace(const Position& pos) {
<< " Winnable | " << Term(WINNABLE)
<< " ------------+-------------+-------------+------------\n"
<< " Total | " << Term(TOTAL);
}
v = pos.side_to_move() == WHITE ? v : -v;
ss << "\nClassical evaluation: " << to_cp(v) << " (white side)\n";
if (Eval::useNNUE)
{
v = NNUE::evaluate(pos);
v = pos.side_to_move() == WHITE ? v : -v;
ss << "\nNNUE evaluation: " << to_cp(v) << " (white side)\n";
}
v = evaluate(pos);
v = pos.side_to_move() == WHITE ? v : -v;
ss << "\nFinal evaluation: " << to_cp(v) << " (white side)\n";
return ss.str();
}