From: Marco Costalba Date: Wed, 25 May 2011 20:36:16 +0000 (+0100) Subject: Retire mateKiller X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=cff8877a1ae270d6f176d16dbcfd72a270e0600f;hp=8f51f09de7813ebc0f5f3efb9d0c142b884faeb3;ds=inline Retire mateKiller Practically useless: After 6456 games 1281 - 1293 - 3882 ELO +0 (+- 5.5) Signed-off-by: Marco Costalba --- diff --git a/src/movepick.cpp b/src/movepick.cpp index 793a90da..12fffdcc 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -56,8 +56,6 @@ bool MovePicker::isBadCapture() const { return phase == PH_BAD_CAPTURES; } MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h, SearchStack* ss, Value beta) : pos(p), H(h) { - int searchTT = ttm; - ttMoves[0].move = ttm; badCaptureThreshold = 0; badCaptures = moves + MAX_MOVES; @@ -65,13 +63,11 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h, if (p.in_check()) { - ttMoves[1].move = killers[0].move = killers[1].move = MOVE_NONE; + killers[0].move = killers[1].move = MOVE_NONE; phasePtr = EvasionTable; } else { - ttMoves[1].move = (ss->mateKiller == ttm) ? MOVE_NONE : ss->mateKiller; - searchTT |= ttMoves[1].move; killers[0].move = ss->killers[0]; killers[1].move = ss->killers[1]; @@ -83,15 +79,13 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h, phasePtr = MainSearchTable; } - phasePtr += int(!searchTT) - 1; + ttMove = (ttm && pos.move_is_pl(ttm) ? ttm : MOVE_NONE); + phasePtr += int(ttMove == MOVE_NONE) - 1; go_next_phase(); } MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h) : pos(p), H(h) { - int searchTT = ttm; - ttMoves[0].move = ttm; - ttMoves[1].move = MOVE_NONE; assert(d <= DEPTH_ZERO); @@ -107,10 +101,11 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h) // qsearch tree explosion due to a possible perpetual check or // similar rare cases when TT table is full. if (ttm != MOVE_NONE && !pos.move_is_capture(ttm) && !move_is_promotion(ttm)) - searchTT = ttMoves[0].move = MOVE_NONE; + ttm = MOVE_NONE; } - phasePtr += int(!searchTT) - 1; + ttMove = (ttm && pos.move_is_pl(ttm) ? ttm : MOVE_NONE); + phasePtr += int(ttMove == MOVE_NONE) - 1; go_next_phase(); } @@ -125,8 +120,7 @@ void MovePicker::go_next_phase() { switch (phase) { case PH_TT_MOVES: - curMove = ttMoves; - lastMove = curMove + 2; + lastMove = curMove + 1; return; case PH_GOOD_CAPTURES: @@ -268,16 +262,13 @@ Move MovePicker::get_next_move() { switch (phase) { case PH_TT_MOVES: - move = (curMove++)->move; - if ( move != MOVE_NONE - && pos.move_is_pl(move)) - return move; + curMove++; + return ttMove; break; case PH_GOOD_CAPTURES: move = pick_best(curMove++, lastMove).move; - if ( move != ttMoves[0].move - && move != ttMoves[1].move) + if (move != ttMove) { // Check for a non negative SEE now int seeValue = pos.see_sign(move); @@ -295,8 +286,7 @@ Move MovePicker::get_next_move() { move = (curMove++)->move; if ( move != MOVE_NONE && pos.move_is_pl(move) - && move != ttMoves[0].move - && move != ttMoves[1].move + && move != ttMove && !pos.move_is_capture(move)) return move; break; @@ -307,8 +297,7 @@ Move MovePicker::get_next_move() { insertion_sort(lastGoodNonCapture, lastMove); move = (curMove++)->move; - if ( move != ttMoves[0].move - && move != ttMoves[1].move + if ( move != ttMove && move != killers[0].move && move != killers[1].move) return move; @@ -321,13 +310,13 @@ Move MovePicker::get_next_move() { case PH_EVASIONS: case PH_QCAPTURES: move = pick_best(curMove++, lastMove).move; - if (move != ttMoves[0].move) + if (move != ttMove) return move; break; case PH_QCHECKS: move = (curMove++)->move; - if (move != ttMoves[0].move) + if (move != ttMove) return move; break; diff --git a/src/movepick.h b/src/movepick.h index fdbd834e..9bab6547 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -53,7 +53,8 @@ private: const Position& pos; const History& H; - MoveStack ttMoves[2], killers[2]; + Move ttMove; + MoveStack killers[2]; int badCaptureThreshold, phase; const uint8_t* phasePtr; MoveStack *curMove, *lastMove, *lastGoodNonCapture, *badCaptures; diff --git a/src/search.cpp b/src/search.cpp index ae62d312..6ade1b43 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -710,7 +710,7 @@ namespace { // Step 1. Initialize node and poll. Polling can abort search ss->currentMove = ss->bestMove = threatMove = (ss+1)->excludedMove = MOVE_NONE; (ss+1)->skipNullMove = false; (ss+1)->reduction = DEPTH_ZERO; - (ss+2)->killers[0] = (ss+2)->killers[1] = (ss+2)->mateKiller = MOVE_NONE; + (ss+2)->killers[0] = (ss+2)->killers[1] = MOVE_NONE; if (threadID == 0 && ++NodesSincePoll > NodesBetweenPolls) { @@ -1149,9 +1149,6 @@ split_point_start: // At split points actual search starts from here else if (SpNode) sp->is_betaCutoff = true; - if (value == value_mate_in(ss->ply + 1)) - ss->mateKiller = move; - ss->bestMove = move; if (SpNode) diff --git a/src/search.h b/src/search.h index b179c9c7..955056e1 100644 --- a/src/search.h +++ b/src/search.h @@ -36,7 +36,6 @@ struct SplitPoint; struct SearchStack { int ply; Move currentMove; - Move mateKiller; Move excludedMove; Move bestMove; Move killers[2];