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:
Marco Costalba
2011-02-26 14:09:58 +01:00
parent dd718d92a7
commit bd33766da0
3 changed files with 150 additions and 23 deletions

View File

@@ -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()