summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8f51f09)
Practically useless:
After 6456 games 1281 - 1293 - 3882 ELO +0 (+- 5.5)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h,
SearchStack* ss, Value beta) : pos(p), H(h) {
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;
badCaptureThreshold = 0;
badCaptures = moves + MAX_MOVES;
- ttMoves[1].move = killers[0].move = killers[1].move = MOVE_NONE;
+ killers[0].move = killers[1].move = MOVE_NONE;
phasePtr = EvasionTable;
}
else
{
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];
killers[0].move = ss->killers[0];
killers[1].move = ss->killers[1];
phasePtr = MainSearchTable;
}
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) {
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;
// 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))
// 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;
- phasePtr += int(!searchTT) - 1;
+ ttMove = (ttm && pos.move_is_pl(ttm) ? ttm : MOVE_NONE);
+ phasePtr += int(ttMove == MOVE_NONE) - 1;
switch (phase) {
case PH_TT_MOVES:
switch (phase) {
case PH_TT_MOVES:
- curMove = ttMoves;
- lastMove = curMove + 2;
+ lastMove = curMove + 1;
return;
case PH_GOOD_CAPTURES:
return;
case PH_GOOD_CAPTURES:
switch (phase) {
case PH_TT_MOVES:
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;
break;
case PH_GOOD_CAPTURES:
move = pick_best(curMove++, lastMove).move;
- if ( move != ttMoves[0].move
- && move != ttMoves[1].move)
{
// Check for a non negative SEE now
int seeValue = pos.see_sign(move);
{
// Check for a non negative SEE now
int seeValue = pos.see_sign(move);
move = (curMove++)->move;
if ( move != MOVE_NONE
&& pos.move_is_pl(move)
move = (curMove++)->move;
if ( move != MOVE_NONE
&& pos.move_is_pl(move)
- && move != ttMoves[0].move
- && move != ttMoves[1].move
&& !pos.move_is_capture(move))
return move;
break;
&& !pos.move_is_capture(move))
return move;
break;
insertion_sort<MoveStack>(lastGoodNonCapture, lastMove);
move = (curMove++)->move;
insertion_sort<MoveStack>(lastGoodNonCapture, lastMove);
move = (curMove++)->move;
- if ( move != ttMoves[0].move
- && move != ttMoves[1].move
&& move != killers[0].move
&& move != killers[1].move)
return move;
&& move != killers[0].move
&& move != killers[1].move)
return move;
case PH_EVASIONS:
case PH_QCAPTURES:
move = pick_best(curMove++, lastMove).move;
case PH_EVASIONS:
case PH_QCAPTURES:
move = pick_best(curMove++, lastMove).move;
- if (move != ttMoves[0].move)
return move;
break;
case PH_QCHECKS:
move = (curMove++)->move;
return move;
break;
case PH_QCHECKS:
move = (curMove++)->move;
- if (move != ttMoves[0].move)
const Position& pos;
const History& H;
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;
int badCaptureThreshold, phase;
const uint8_t* phasePtr;
MoveStack *curMove, *lastMove, *lastGoodNonCapture, *badCaptures;
// 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;
// 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)
{
if (threadID == 0 && ++NodesSincePoll > NodesBetweenPolls)
{
else if (SpNode)
sp->is_betaCutoff = true;
else if (SpNode)
sp->is_betaCutoff = true;
- if (value == value_mate_in(ss->ply + 1))
- ss->mateKiller = move;
-
ss->bestMove = move;
if (SpNode)
ss->bestMove = move;
if (SpNode)
struct SearchStack {
int ply;
Move currentMove;
struct SearchStack {
int ply;
Move currentMove;
Move excludedMove;
Move bestMove;
Move killers[2];
Move excludedMove;
Move bestMove;
Move killers[2];