From f21a66f70dce4e9d72031a13d25ac530bbafc830 Mon Sep 17 00:00:00 2001 From: xoto10 Date: Thu, 27 May 2021 16:04:47 +0100 Subject: [PATCH] Small clean-up, Sept 2021 Closes https://github.com/official-stockfish/Stockfish/pull/3485 No functional change --- AUTHORS | 1 + src/Makefile | 6 +++--- src/evaluate.cpp | 12 ++++++------ src/evaluate.h | 2 +- src/movepick.h | 4 ++-- src/nnue/evaluate_nnue.cpp | 2 +- src/search.cpp | 3 +-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/AUTHORS b/AUTHORS index be35127a..56725e98 100644 --- a/AUTHORS +++ b/AUTHORS @@ -21,6 +21,7 @@ Alexander Kure Alexander Pagel (Lolligerhans) Alfredo Menezes (lonfom169) Ali AlZhrani (Cooffe) +Andrei Vetrov (proukornew) Andrew Grant (AndyGrant) Andrey Neporada (nepal) Andy Duplain diff --git a/src/Makefile b/src/Makefile index d92854bc..fea597e7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -88,7 +88,7 @@ endif # at the end of the line for flag values. # # Example of use for these flags: -# make build ARCH=x86-64-avx512 debug=on sanitize="address undefined" +# make build ARCH=x86-64-avx512 debug=yes sanitize="address undefined" ### 2.1. General and architecture defaults @@ -517,7 +517,7 @@ ifeq ($(bits),64) CXXFLAGS += -DIS_64BIT endif -### 3.5 prefetch +### 3.5 prefetch and popcount ifeq ($(prefetch),yes) ifeq ($(sse),yes) CXXFLAGS += -msse @@ -526,7 +526,6 @@ else CXXFLAGS += -DNO_PREFETCH endif -### 3.6 popcnt ifeq ($(popcnt),yes) ifeq ($(arch),$(filter $(arch),ppc64 armv7 armv8 arm64)) CXXFLAGS += -DUSE_POPCNT @@ -537,6 +536,7 @@ ifeq ($(popcnt),yes) endif endif +### 3.6 SIMD architectures ifeq ($(avx2),yes) CXXFLAGS += -DUSE_AVX2 ifeq ($(comp),$(filter $(comp),gcc clang mingw)) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 58dd0026..2195f913 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -61,7 +61,7 @@ namespace Stockfish { namespace Eval { bool useNNUE; - string eval_file_loaded = "None"; + string currentEvalFileName = "None"; /// NNUE::init() tries to load a NNUE network at startup time, or when the engine /// receives a UCI command "setoption name EvalFile value nn-[a-z0-9]{12}.nnue" @@ -90,13 +90,13 @@ namespace Eval { #endif for (string directory : dirs) - if (eval_file_loaded != eval_file) + if (currentEvalFileName != eval_file) { if (directory != "") { ifstream stream(directory + eval_file, ios::binary); if (load_eval(eval_file, stream)) - eval_file_loaded = eval_file; + currentEvalFileName = eval_file; } if (directory == "" && eval_file == EvalFileDefaultName) @@ -111,7 +111,7 @@ namespace Eval { istream stream(&buffer); if (load_eval(eval_file, stream)) - eval_file_loaded = eval_file; + currentEvalFileName = eval_file; } } } @@ -123,7 +123,7 @@ namespace Eval { if (eval_file.empty()) eval_file = EvalFileDefaultName; - if (useNNUE && eval_file_loaded != eval_file) + if (useNNUE && currentEvalFileName != eval_file) { string msg1 = "If the UCI option \"Use NNUE\" is set to true, network evaluation parameters compatible with the engine must be available."; @@ -1081,7 +1081,7 @@ Value Eval::evaluate(const Position& pos) { Value v; - if (!Eval::useNNUE) + if (!useNNUE) v = Evaluation(pos).value(); else { diff --git a/src/evaluate.h b/src/evaluate.h index d7b3e55f..e2cdb210 100644 --- a/src/evaluate.h +++ b/src/evaluate.h @@ -34,7 +34,7 @@ namespace Eval { Value evaluate(const Position& pos); extern bool useNNUE; - extern std::string eval_file_loaded; + extern std::string currentEvalFileName; // The default net name MUST follow the format nn-[SHA256 first 12 digits].nnue // for the build process (profile-build and fishtest) to work. Do not change the diff --git a/src/movepick.h b/src/movepick.h index c76d4957..2932d9a8 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -89,8 +89,8 @@ enum StatsType { NoCaptures, Captures }; typedef Stats ButterflyHistory; /// At higher depths LowPlyHistory records successful quiet moves near the root -/// and quiet moves which are/were in the PV (ttPv). It is cleared with each new -/// search and filled during iterative deepening. +/// and quiet moves which are/were in the PV (ttPv). LowPlyHistory is populated during +/// iterative deepening and at each new search the data is shifted down by 2 plies constexpr int MAX_LPH = 4; typedef Stats LowPlyHistory; diff --git a/src/nnue/evaluate_nnue.cpp b/src/nnue/evaluate_nnue.cpp index bfd69987..7f5925a7 100644 --- a/src/nnue/evaluate_nnue.cpp +++ b/src/nnue/evaluate_nnue.cpp @@ -396,7 +396,7 @@ namespace Stockfish::Eval::NNUE { actualFilename = filename.value(); else { - if (eval_file_loaded != EvalFileDefaultName) + if (currentEvalFileName != EvalFileDefaultName) { msg = "Failed to export a net. A non-embedded net can only be saved if the filename is specified"; diff --git a/src/search.cpp b/src/search.cpp index ef691500..ac6b8608 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -790,7 +790,6 @@ namespace { else { // In case of null move search use previous static eval with a different sign - // and addition of two tempos if ((ss-1)->currentMove != MOVE_NULL) ss->staticEval = eval = evaluate(pos); else @@ -1187,6 +1186,7 @@ moves_loop: // When in check, search starts here { Depth r = reduction(improving, depth, moveCount, rangeReduction > 2); + // Decrease reduction if on the PV (~1 Elo) if (PvNode) r--; @@ -1499,7 +1499,6 @@ moves_loop: // When in check, search starts here } else // In case of null move search use previous static eval with a different sign - // and addition of two tempos ss->staticEval = bestValue = (ss-1)->currentMove != MOVE_NULL ? evaluate(pos) : -(ss-1)->staticEval; -- 2.39.2