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

[NNUE] remove evalnn command

instead eval uses the evaluation according to the state of Use NNUE

No functional change.
This commit is contained in:
Joost VandeVondele 2020-07-27 20:14:25 +02:00
parent 7182c55e5c
commit 6349062d42
2 changed files with 41 additions and 30 deletions

View file

@ -909,21 +909,30 @@ Value Eval::evaluate(const Position& pos) {
/// trace() is like evaluate(), but instead of returning a value, it returns
/// a string (suitable for outputting to stdout) that contains the detailed
/// descriptions and values of each evaluation term. Useful for debugging.
/// Trace scores are from white's point of view
std::string Eval::trace(const Position& pos) {
if (pos.checkers())
return "Total evaluation: none (in check)";
return "Final evaluation: none (in check)";
std::stringstream ss;
ss << std::showpoint << std::noshowpos << std::fixed << std::setprecision(2);
Value v;
if (pos.use_nnue())
{
v = NNUE::evaluate(pos);
}
else
{
std::memset(scores, 0, sizeof(scores));
pos.this_thread()->contempt = SCORE_ZERO; // Reset any dynamic contempt
Value v = Evaluation<TRACE>(pos).value();
v = Evaluation<TRACE>(pos).value();
v = pos.side_to_move() == WHITE ? v : -v; // Trace scores are from white's point of view
std::stringstream ss;
ss << std::showpoint << std::noshowpos << std::fixed << std::setprecision(2)
<< " Term | White | Black | Total \n"
<< " | MG EG | MG EG | MG EG \n"
@ -944,6 +953,10 @@ std::string Eval::trace(const Position& pos) {
<< " ------------+-------------+-------------+------------\n"
<< " Total | " << Term(TOTAL);
}
v = pos.side_to_move() == WHITE ? v : -v;
ss << "\nFinal evaluation: " << to_cp(v) << " (white side)\n";
return ss.str();

View file

@ -290,8 +290,6 @@ void UCI::loop(int argc, char* argv[]) {
else if (token == "d") sync_cout << pos << sync_endl;
else if (token == "eval") sync_cout << Eval::trace(pos) << sync_endl;
else if (token == "compiler") sync_cout << compiler_info() << sync_endl;
else if (token == "evalnn") sync_cout << "NNUE evaluation: "
<< Eval::NNUE::compute_eval(pos) << sync_endl;
else
sync_cout << "Unknown command: " << cmd << sync_endl;