1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 17:19:36 +00:00

Retire #ifdef SYZYGY macro

It just clutters the code for no
real reason.

No functional change.

Resolves #139
This commit is contained in:
Marco Costalba 2014-11-29 09:22:25 +01:00 committed by Joona Kiiski
parent fe07ae4cb4
commit 66f5cd3f9d
4 changed files with 4 additions and 29 deletions

View file

@ -40,7 +40,7 @@ PGOBENCH = ./$(EXE) bench 16 1 1 default time
### Object files ### Object files
OBJS = benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o \ OBJS = benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o \
material.o misc.o movegen.o movepick.o pawns.o position.o \ material.o misc.o movegen.o movepick.o pawns.o position.o \
search.o thread.o timeman.o tt.o uci.o ucioption.o search.o thread.o timeman.o tt.o uci.o ucioption.o syzygy/tbprobe.o
### ========================================================================== ### ==========================================================================
### Section 2. High-level Configuration ### Section 2. High-level Configuration
@ -75,12 +75,6 @@ bsfq = no
popcnt = no popcnt = no
sse = no sse = no
pext = no pext = no
syzygy = yes
ifeq ($(syzygy),yes)
OBJS += syzygy/tbprobe.o
CXXFLAGS += -DSYZYGY
endif
### 2.2 Architecture specific ### 2.2 Architecture specific

View file

@ -26,10 +26,7 @@
#include "thread.h" #include "thread.h"
#include "tt.h" #include "tt.h"
#include "uci.h" #include "uci.h"
#ifdef SYZYGY
#include "syzygy/tbprobe.h" #include "syzygy/tbprobe.h"
#endif
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
@ -43,10 +40,8 @@ int main(int argc, char* argv[]) {
Eval::init(); Eval::init();
Pawns::init(); Pawns::init();
Threads.init(); Threads.init();
TT.resize(Options["Hash"]);
#ifdef SYZYGY
Tablebases::init(Options["SyzygyPath"]); Tablebases::init(Options["SyzygyPath"]);
#endif TT.resize(Options["Hash"]);
UCI::loop(argc, argv); UCI::loop(argc, argv);

View file

@ -33,10 +33,7 @@
#include "thread.h" #include "thread.h"
#include "tt.h" #include "tt.h"
#include "uci.h" #include "uci.h"
#ifdef SYZYGY
#include "syzygy/tbprobe.h" #include "syzygy/tbprobe.h"
#endif
namespace Search { namespace Search {
@ -207,7 +204,6 @@ void Search::think() {
} }
else else
{ {
#ifdef SYZYGY
// Check Tablebases at root // Check Tablebases at root
int piecesCnt = RootPos.total_piece_count(); int piecesCnt = RootPos.total_piece_count();
TBCardinality = Options["SyzygyProbeLimit"]; TBCardinality = Options["SyzygyProbeLimit"];
@ -259,7 +255,6 @@ void Search::think() {
: TBScore; : TBScore;
} }
} }
#endif
for (size_t i = 0; i < Threads.size(); ++i) for (size_t i = 0; i < Threads.size(); ++i)
Threads[i]->maxPly = 0; Threads[i]->maxPly = 0;
@ -552,7 +547,6 @@ namespace {
return ttValue; return ttValue;
} }
#ifdef SYZYGY
// Step 4a. Tablebase probe // Step 4a. Tablebase probe
if ( !RootNode if ( !RootNode
&& pos.total_piece_count() <= TBCardinality && pos.total_piece_count() <= TBCardinality
@ -583,7 +577,6 @@ namespace {
return value; return value;
} }
} }
#endif
// Step 5. Evaluate the position statically and update parent's gain statistics // Step 5. Evaluate the position statically and update parent's gain statistics
if (inCheck) if (inCheck)

View file

@ -26,10 +26,7 @@
#include "thread.h" #include "thread.h"
#include "tt.h" #include "tt.h"
#include "uci.h" #include "uci.h"
#ifdef SYZYGY
#include "syzygy/tbprobe.h" #include "syzygy/tbprobe.h"
#endif
using std::string; using std::string;
@ -38,13 +35,11 @@ UCI::OptionsMap Options; // Global object
namespace UCI { namespace UCI {
/// 'On change' actions, triggered by an option's value change /// 'On change' actions, triggered by an option's value change
void on_clear_hash(const Option&) { TT.clear(); }
void on_hash_size(const Option& o) { TT.resize(o); }
void on_logger(const Option& o) { start_logger(o); } void on_logger(const Option& o) { start_logger(o); }
void on_threads(const Option&) { Threads.read_uci_options(); } void on_threads(const Option&) { Threads.read_uci_options(); }
void on_hash_size(const Option& o) { TT.resize(o); }
void on_clear_hash(const Option&) { TT.clear(); }
#ifdef SYZYGY
void on_tb_path(const Option& o) { Tablebases::init(o); } void on_tb_path(const Option& o) { Tablebases::init(o); }
#endif
/// Our case insensitive less() function as required by UCI protocol /// Our case insensitive less() function as required by UCI protocol
@ -72,12 +67,10 @@ void init(OptionsMap& o) {
o["Minimum Thinking Time"] << Option(20, 0, 5000); o["Minimum Thinking Time"] << Option(20, 0, 5000);
o["Slow Mover"] << Option(80, 10, 1000); o["Slow Mover"] << Option(80, 10, 1000);
o["UCI_Chess960"] << Option(false); o["UCI_Chess960"] << Option(false);
#ifdef SYZYGY
o["SyzygyPath"] << Option("<empty>", on_tb_path); o["SyzygyPath"] << Option("<empty>", on_tb_path);
o["SyzygyProbeDepth"] << Option(1, 1, 100); o["SyzygyProbeDepth"] << Option(1, 1, 100);
o["Syzygy50MoveRule"] << Option(true); o["Syzygy50MoveRule"] << Option(true);
o["SyzygyProbeLimit"] << Option(6, 0, 6); o["SyzygyProbeLimit"] << Option(6, 0, 6);
#endif
} }