mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Add evaluation tracing code
This patch is based on Justin Blanchard's original work and allows to breakdown evaluation in its sub terms and show to the user. Tracing code has zero speed impact when not used. Note that tracing code is not thread-safe, but this should not be a problem given the typical usage scenario. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -65,7 +65,6 @@ bool execute_uci_command(const string& cmd) {
|
||||
|
||||
static Position pos(StartPositionFEN, false, 0); // The root position
|
||||
UCIParser up(cmd);
|
||||
Value dummy;
|
||||
string token;
|
||||
|
||||
up >> token; // operator>>() skips any whitespace
|
||||
@@ -98,9 +97,7 @@ bool execute_uci_command(const string& cmd) {
|
||||
pos.print();
|
||||
|
||||
else if (token == "eval")
|
||||
cout << "Incremental mg: " << mg_value(pos.value())
|
||||
<< "\nIncremental eg: " << eg_value(pos.value())
|
||||
<< "\nFull eval: " << evaluate(pos, dummy) << endl;
|
||||
cout << trace_evaluate(pos) << endl;
|
||||
|
||||
else if (token == "key")
|
||||
cout << "key: " << hex << pos.get_key()
|
||||
|
||||
Reference in New Issue
Block a user