Closes https://github.com/official-stockfish/Stockfish/pull/3485
No functional change
Alexander Pagel (Lolligerhans)
Alfredo Menezes (lonfom169)
Ali AlZhrani (Cooffe)
Alexander Pagel (Lolligerhans)
Alfredo Menezes (lonfom169)
Ali AlZhrani (Cooffe)
+Andrei Vetrov (proukornew)
Andrew Grant (AndyGrant)
Andrey Neporada (nepal)
Andy Duplain
Andrew Grant (AndyGrant)
Andrey Neporada (nepal)
Andy Duplain
# at the end of the line for flag values.
#
# Example of use for these flags:
# 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
### 2.1. General and architecture defaults
CXXFLAGS += -DIS_64BIT
endif
CXXFLAGS += -DIS_64BIT
endif
+### 3.5 prefetch and popcount
ifeq ($(prefetch),yes)
ifeq ($(sse),yes)
CXXFLAGS += -msse
ifeq ($(prefetch),yes)
ifeq ($(sse),yes)
CXXFLAGS += -msse
CXXFLAGS += -DNO_PREFETCH
endif
CXXFLAGS += -DNO_PREFETCH
endif
ifeq ($(popcnt),yes)
ifeq ($(arch),$(filter $(arch),ppc64 armv7 armv8 arm64))
CXXFLAGS += -DUSE_POPCNT
ifeq ($(popcnt),yes)
ifeq ($(arch),$(filter $(arch),ppc64 armv7 armv8 arm64))
CXXFLAGS += -DUSE_POPCNT
+### 3.6 SIMD architectures
ifeq ($(avx2),yes)
CXXFLAGS += -DUSE_AVX2
ifeq ($(comp),$(filter $(comp),gcc clang mingw))
ifeq ($(avx2),yes)
CXXFLAGS += -DUSE_AVX2
ifeq ($(comp),$(filter $(comp),gcc clang mingw))
namespace Eval {
bool useNNUE;
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"
/// 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"
#endif
for (string directory : dirs)
#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))
{
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)
}
if (directory == "<internal>" && eval_file == EvalFileDefaultName)
istream stream(&buffer);
if (load_eval(eval_file, stream))
istream stream(&buffer);
if (load_eval(eval_file, stream))
- eval_file_loaded = eval_file;
+ currentEvalFileName = eval_file;
if (eval_file.empty())
eval_file = EvalFileDefaultName;
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.";
{
string msg1 = "If the UCI option \"Use NNUE\" is set to true, network evaluation parameters compatible with the engine must be available.";
v = Evaluation<NO_TRACE>(pos).value();
else
{
v = Evaluation<NO_TRACE>(pos).value();
else
{
Value evaluate(const Position& pos);
extern bool useNNUE;
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
// 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
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
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;
constexpr int MAX_LPH = 4;
typedef Stats<int16_t, 10692, MAX_LPH, int(SQUARE_NB) * int(SQUARE_NB)> LowPlyHistory;
actualFilename = filename.value();
else
{
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";
{
msg = "Failed to export a net. A non-embedded net can only be saved if the filename is specified";
else
{
// In case of null move search use previous static eval with a different sign
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
if ((ss-1)->currentMove != MOVE_NULL)
ss->staticEval = eval = evaluate(pos);
else
{
Depth r = reduction(improving, depth, moveCount, rangeReduction > 2);
{
Depth r = reduction(improving, depth, moveCount, rangeReduction > 2);
+ // Decrease reduction if on the PV (~1 Elo)
}
else
// In case of null move search use previous static eval with a different sign
}
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;
ss->staticEval = bestValue =
(ss-1)->currentMove != MOVE_NULL ? evaluate(pos)
: -(ss-1)->staticEval;