mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Retire mateKiller
Practically useless: After 6456 games 1281 - 1293 - 3882 ELO +0 (+- 5.5) Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
8f51f09de7
commit
cff8877a1a
4 changed files with 17 additions and 31 deletions
|
@ -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<MoveStack>(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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -36,7 +36,6 @@ struct SplitPoint;
|
|||
struct SearchStack {
|
||||
int ply;
|
||||
Move currentMove;
|
||||
Move mateKiller;
|
||||
Move excludedMove;
|
||||
Move bestMove;
|
||||
Move killers[2];
|
||||
|
|
Loading…
Add table
Reference in a new issue