diff --git a/include/config.h b/include/config.h index 00629fe7..0c774012 100644 --- a/include/config.h +++ b/include/config.h @@ -82,23 +82,6 @@ //#define TRANSPOSITION_TABLE_DEBUG #endif -//WIP -//#define HOSTORY_HEURISTIC - -#ifdef HOSTORY_HEURISTIC -#define HOSTORY_HEURISTIC_ACTION_MOVE_ONLY -//#define HOSTORY_HEURISTIC_SCORE_HIGH_WHEN_DEEPER -#endif - -#ifdef HOSTORY_HEURISTIC -//#define COMPARE_SCORE_ONLY -//#define COMPARE_RATING_PREFERRED -#define COMPARE_SCORE_PREFERRED -#else -//#define COMPARE_RATING_1ST_VALUE_2ND -//#define COMPARE_VALUE_1ST_RATING_2ND -#endif // HOSTORY_HEURISTIC - //#define DISABLE_PREFETCH // WIP, Debugging only diff --git a/src/movepick.cpp b/src/movepick.cpp index 1b9aa729..0cbfd331 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -45,9 +45,7 @@ void partial_insertion_sort(ExtMove *begin, ExtMove *end, int limit) MovePicker::MovePicker(Position &p) : pos(p) { -#ifdef HOSTORY_HEURISTIC - clearHistoryScore(); -#endif + } /// MovePicker::score() assigns a numerical value to each move in a list, used @@ -181,58 +179,3 @@ Move MovePicker::next_move() return *moves; } - -#ifdef HOSTORY_HEURISTIC -Score MovePicker::getHistoryScore(Move move) -{ - Score ret = 0; - - if (move < 0) { -#ifndef HOSTORY_HEURISTIC_ACTION_MOVE_ONLY - ret = placeHistory[-move]; -#endif - } else if (move & 0x7f00) { - ret = moveHistory[move]; - } else { -#ifndef HOSTORY_HEURISTIC_ACTION_MOVE_ONLY - ret = placeHistory[move]; -#endif - } - - return ret; -} - -void MovePicker::setHistoryScore(Move move, Depth depth) -{ - if (move == MOVE_NONE) { - return; - } - -#ifdef HOSTORY_HEURISTIC_SCORE_HIGH_WHEN_DEEPER - Score score = 1 << (32 - depth); -#else - Score score = 1 << depth; -#endif - - if (move < 0) { -#ifndef HOSTORY_HEURISTIC_ACTION_MOVE_ONLY - placeHistory[-move] += score; -#endif - } else if (move & 0x7f00) { - moveHistory[move] += score; - } else { -#ifndef HOSTORY_HEURISTIC_ACTION_MOVE_ONLY - moveHistory[move] += score; -#endif - } -} - -void MovePicker::clearHistoryScore() -{ -#ifndef HOSTORY_HEURISTIC_ACTION_MOVE_ONLY - memset(placeHistory, 0, sizeof(placeHistory)); - memset(removeHistory, 0, sizeof(removeHistory)); -#endif - memset(moveHistory, 0, sizeof(moveHistory)); -} -#endif // HOSTORY_HEURISTIC diff --git a/src/movepick.h b/src/movepick.h index 3e9fece3..009bfa02 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -151,17 +151,6 @@ public: { return moveCount; } - -#ifdef HOSTORY_HEURISTIC - // TODO: Fix size - Score placeHistory[64]; - Score removeHistory[64]; - Score moveHistory[10240]; - - Score getHistoryScore(Move move); - void setHistoryScore(Move move, Depth depth); - void clearHistoryScore(); -#endif // HOSTORY_HEURISTIC }; #endif // #ifndef MOVEPICK_H_INCLUDED diff --git a/src/search.cpp b/src/search.cpp index eed9c411..d0ec859c 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -414,10 +414,6 @@ Value search(Position *pos, Sanmill::Stack &ss, Depth depth, Depth ori ); #endif /* TRANSPOSITION_TABLE_ENABLE */ -#ifdef HOSTORY_HEURISTIC - movePicker->setHistoryScore(bestMove, depth); -#endif - assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE); return bestValue; diff --git a/src/thread.cpp b/src/thread.cpp index 93e87088..d96a2230 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -67,9 +67,6 @@ Thread::~Thread() assert(!searching); exit = true; -#ifdef HOSTORY_HEURISTIC - clearHistoryScore(); -#endif // HOSTORY_HEURISTIC start_searching(); stdThread.join(); } @@ -85,8 +82,6 @@ void Thread::clear() void Thread::start_searching() { - clearHistoryScore(); - std::lock_guard lk(mutex); searching = true; cv.notify_one(); // Wake up the thread in idle_loop() @@ -538,11 +533,7 @@ string Thread::nextMove() root->children[i]->move, UCI::move(root->children[i]->move).c_str(); root->children[i]->value, -#ifdef HOSTORY_HEURISTIC - root->children[i]->score, -#else 0, -#endif charSelect); moveIndex++; diff --git a/src/thread.h b/src/thread.h index 3ab6824e..4bbd5dfe 100644 --- a/src/thread.h +++ b/src/thread.h @@ -87,13 +87,6 @@ public: void analyze(Color c); - void clearHistoryScore() - { -#ifdef HOSTORY_HEURISTIC - movePicker->clearHistoryScore(); -#endif - } - #ifdef TIME_STAT TimePoint sortTime{ 0 }; #endif