]> git.sesse.net Git - stockfish/commitdiff
Small clean-up, Sept 2021
authorxoto10 <buylow001@gmail.com>
Thu, 27 May 2021 15:04:47 +0000 (16:04 +0100)
committerStéphane Nicolet <cassio@free.fr>
Thu, 7 Oct 2021 07:41:57 +0000 (09:41 +0200)
Closes https://github.com/official-stockfish/Stockfish/pull/3485

No functional change

AUTHORS
src/Makefile
src/evaluate.cpp
src/evaluate.h
src/movepick.h
src/nnue/evaluate_nnue.cpp
src/search.cpp

diff --git a/AUTHORS b/AUTHORS
index be35127a706fa8e76de3c68a5556e7203face98d..56725e98d684740a08bcbd97e29abc83fa383d50 100644 (file)
--- 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
index d92854bca193e71f83c1d457a832391f7addfcd5..fea597e76cb941eb8d79bc9135a497fecc82e60e 100644 (file)
@@ -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))
index 58dd0026fdd1e94006b062b4ec3bb97ba4a6dcd1..2195f9136fdcd0d92cafcee4195dd20878b1d39f 100644 (file)
@@ -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 != "<internal>")
             {
                 ifstream stream(directory + eval_file, ios::binary);
                 if (load_eval(eval_file, stream))
-                    eval_file_loaded = eval_file;
+                    currentEvalFileName = eval_file;
             }
 
             if (directory == "<internal>" && 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<NO_TRACE>(pos).value();
   else
   {
index d7b3e55f20e203b064e6957d304c8bea96659b01..e2cdb21019ac08c62a4571e12aba53a242a10e17 100644 (file)
@@ -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
index c76d49572b8af63f5c6bd8240e8bf909c0856ccd..2932d9a8a0df071da91263b99817db28977d7049 100644 (file)
@@ -89,8 +89,8 @@ enum StatsType { NoCaptures, Captures };
 typedef Stats<int16_t, 13365, COLOR_NB, int(SQUARE_NB) * int(SQUARE_NB)> 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<int16_t, 10692, MAX_LPH, int(SQUARE_NB) * int(SQUARE_NB)> LowPlyHistory;
 
index bfd6998793a4f005dfd3aa3ab658199f6b70d36b..7f5925a7c683b207ce7eb30ab7a6d1379856e65d 100644 (file)
@@ -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";
 
index ef691500e6425b651570b8c85fada80f4cf1c9ef..ac6b8608848afdf17aecd894236fbf79fc5d03d7 100644 (file)
@@ -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;