Skip to content

Commit 877313a

Browse files
lucasartzamar
authored andcommitted
Retire Search Log
No functional change Bench: 7461881
1 parent 8b8885a commit 877313a

File tree

4 files changed

+0
-106
lines changed

4 files changed

+0
-106
lines changed

src/notation.cpp

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
*/
1919

2020
#include <cassert>
21-
#include <iomanip>
2221
#include <sstream>
23-
#include <stack>
2422

2523
#include "movegen.h"
2624
#include "notation.h"
@@ -95,68 +93,3 @@ Move move_from_uci(const Position& pos, string& str) {
9593

9694
return MOVE_NONE;
9795
}
98-
99-
100-
/// pretty_pv() formats human-readable search information, typically to be
101-
/// appended to the search log file. It uses the two helpers below to pretty
102-
/// format the time and score respectively.
103-
104-
static string format(int64_t msecs) {
105-
106-
const int MSecMinute = 1000 * 60;
107-
const int MSecHour = 1000 * 60 * 60;
108-
109-
int64_t hours = msecs / MSecHour;
110-
int64_t minutes = (msecs % MSecHour) / MSecMinute;
111-
int64_t seconds = ((msecs % MSecHour) % MSecMinute) / 1000;
112-
113-
stringstream ss;
114-
115-
if (hours)
116-
ss << hours << ':';
117-
118-
ss << setfill('0') << setw(2) << minutes << ':' << setw(2) << seconds;
119-
120-
return ss.str();
121-
}
122-
123-
static string format(Value v) {
124-
125-
stringstream ss;
126-
127-
if (v >= VALUE_MATE_IN_MAX_PLY)
128-
ss << "#" << (VALUE_MATE - v + 1) / 2;
129-
130-
else if (v <= VALUE_MATED_IN_MAX_PLY)
131-
ss << "-#" << (VALUE_MATE + v) / 2;
132-
133-
else
134-
ss << setprecision(2) << fixed << showpos << double(v) / PawnValueEg;
135-
136-
return ss.str();
137-
}
138-
139-
string pretty_pv(const Position& pos, int depth, Value value, int64_t msecs, Move pv[]) {
140-
141-
const uint64_t K = 1000;
142-
const uint64_t M = 1000000;
143-
144-
stringstream ss;
145-
ss << setw(2) << depth << setw(8) << format(value) << setw(8) << format(msecs);
146-
147-
if (pos.nodes_searched() < M)
148-
ss << setw(8) << pos.nodes_searched() / 1 << " ";
149-
150-
else if (pos.nodes_searched() < K * M)
151-
ss << setw(7) << pos.nodes_searched() / K << "K ";
152-
153-
else
154-
ss << setw(7) << pos.nodes_searched() / M << "M ";
155-
156-
string str = ss.str();
157-
158-
for (Move *m = pv; *m != MOVE_NONE; m++)
159-
str += move_to_uci(*m, pos.is_chess960()) + ' ';
160-
161-
return str;
162-
}

src/notation.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class Position;
2929
std::string score_to_uci(Value v, Value alpha = -VALUE_INFINITE, Value beta = VALUE_INFINITE);
3030
Move move_from_uci(const Position& pos, std::string& str);
3131
const std::string move_to_uci(Move m, bool chess960);
32-
std::string pretty_pv(const Position& pos, int depth, Value score, int64_t msecs, Move pv[]);
3332

3433
inline char to_char(File f, bool tolower = true) {
3534
return char(f - FILE_A + (tolower ? 'a' : 'A'));

src/search.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include <algorithm>
2121
#include <cassert>
22-
#include <cfloat>
2322
#include <cmath>
2423
#include <cstring>
2524
#include <iostream>
@@ -202,18 +201,6 @@ void Search::think() {
202201
goto finalize;
203202
}
204203

205-
if (Options["Write Search Log"])
206-
{
207-
Log log(Options["Search Log Filename"]);
208-
log << "\nSearching: " << RootPos.fen()
209-
<< "\ninfinite: " << Limits.infinite
210-
<< " ponder: " << Limits.ponder
211-
<< " time: " << Limits.time[RootPos.side_to_move()]
212-
<< " increment: " << Limits.inc[RootPos.side_to_move()]
213-
<< " moves to go: " << Limits.movestogo
214-
<< "\n" << std::endl;
215-
}
216-
217204
// Reset the threads, still sleeping: will wake up at split time
218205
for (size_t i = 0; i < Threads.size(); ++i)
219206
Threads[i]->maxPly = 0;
@@ -225,18 +212,6 @@ void Search::think() {
225212

226213
Threads.timer->run = false; // Stop the timer
227214

228-
if (Options["Write Search Log"])
229-
{
230-
Time::point elapsed = Time::now() - SearchTime + 1;
231-
232-
Log log(Options["Search Log Filename"]);
233-
log << "Nodes: " << RootPos.nodes_searched()
234-
<< "\nNodes/second: " << RootPos.nodes_searched() * 1000 / elapsed
235-
<< "\nBest move: " << move_to_uci(RootMoves[0].pv[0], RootPos.is_chess960())
236-
<< "\nPonder move: " << move_to_uci(RootMoves[0].pv[1], RootPos.is_chess960())
237-
<< std::endl;
238-
}
239-
240215
finalize:
241216

242217
// When search is stopped this info is not printed
@@ -378,17 +353,6 @@ namespace {
378353
if (skill.candidates_size() && skill.time_to_pick(depth))
379354
skill.pick_move();
380355

381-
if (Options["Write Search Log"])
382-
{
383-
RootMove& rm = RootMoves[0];
384-
if (skill.best != MOVE_NONE)
385-
rm = *std::find(RootMoves.begin(), RootMoves.end(), skill.best);
386-
387-
Log log(Options["Search Log Filename"]);
388-
log << pretty_pv(pos, depth, rm.score, Time::now() - SearchTime, &rm.pv[0])
389-
<< std::endl;
390-
}
391-
392356
// Have we found a "mate in x"?
393357
if ( Limits.mate
394358
&& bestValue >= VALUE_MATE_IN_MAX_PLY

src/ucioption.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ bool CaseInsensitiveLess::operator() (const string& s1, const string& s2) const
5555
void init(OptionsMap& o) {
5656

5757
o["Write Debug Log"] << Option(false, on_logger);
58-
o["Write Search Log"] << Option(false);
59-
o["Search Log Filename"] << Option("SearchLog.txt");
6058
o["Contempt Factor"] << Option(0, -100, 100);
6159
o["Min Split Depth"] << Option(0, 0, 12, on_threads);
6260
o["Threads"] << Option(1, 1, MAX_THREADS, on_threads);

0 commit comments

Comments
 (0)