Skip to content

Commit 21ff092

Browse files
committed
bench covering both NNUE and classical, PGO, CI
Add additional options to the bench command classical, NNUE, mixed. requires the default net to be present, can be obtained with ``` make net ``` Default bench is mixed, further examples: ``` ./stockfish bench 16 1 13 default depth mixed ./stockfish bench 16 1 13 default depth classical ./stockfish bench 16 1 13 default depth NNUE ``` Requires the default net to be present, download automatically if needed for profile-build. PGO gives a nice speedup on fishtest, passed STC: LLR: 2.93 (-2.94,2.94) {-0.50,1.50} Total: 3360 W: 469 L: 343 D: 2548 Ptnml(0-2): 20, 246, 1030, 356, 28 https://tests.stockfishchess.org/tests/view/5f31b5499081672066537569 requires fishtest work, and travis work, before commit. Bench: 4290577
1 parent ab92c6d commit 21ff092

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ help:
564564
build: config-sanity
565565
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
566566

567-
profile-build: config-sanity objclean profileclean
567+
profile-build: config-sanity objclean profileclean net
568568
@echo ""
569569
@echo "Step 1/4. Building instrumented executable ..."
570570
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_make)

src/benchmark.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@ const vector<string> Defaults = {
9595
/// setup_bench() builds a list of UCI commands to be run by bench. There
9696
/// are five parameters: TT size in MB, number of search threads that
9797
/// should be used, the limit value spent for each position, a file name
98-
/// where to look for positions in FEN format and the type of the limit:
99-
/// depth, perft, nodes and movetime (in millisecs).
98+
/// where to look for positions in FEN format, the type of the limit:
99+
/// depth, perft, nodes and movetime (in millisecs), and evaluation type
100+
/// mixed (default), classical, NNUE.
100101
///
101102
/// bench -> search default positions up to depth 13
102103
/// bench 64 1 15 -> search default positions up to depth 15 (TT = 64MB)
@@ -115,6 +116,7 @@ vector<string> setup_bench(const Position& current, istream& is) {
115116
string limit = (is >> token) ? token : "13";
116117
string fenFile = (is >> token) ? token : "default";
117118
string limitType = (is >> token) ? token : "depth";
119+
string evalType = (is >> token) ? token : "mixed";
118120

119121
go = limitType == "eval" ? "eval" : "go " + limitType + " " + limit;
120122

@@ -146,13 +148,20 @@ vector<string> setup_bench(const Position& current, istream& is) {
146148
list.emplace_back("setoption name Hash value " + ttSize);
147149
list.emplace_back("ucinewgame");
148150

151+
size_t posCounter = 0;
152+
149153
for (const string& fen : fens)
150154
if (fen.find("setoption") != string::npos)
151155
list.emplace_back(fen);
152156
else
153157
{
158+
if (evalType == "classical" || (evalType == "mixed" && posCounter % 2 == 0))
159+
list.emplace_back("setoption name Use NNUE value false");
160+
else if (evalType == "NNUE" || (evalType == "mixed" && posCounter % 2 != 0))
161+
list.emplace_back("setoption name Use NNUE value true");
154162
list.emplace_back("position fen " + fen);
155163
list.emplace_back(go);
164+
++posCounter;
156165
}
157166

158167
return list;

0 commit comments

Comments
 (0)