Skip to content

Commit

Permalink
Revert all the SEE stuff
Browse files Browse the repository at this point in the history
The speed up seems to introduce some
functionality change.

Revert to original master for now.

bench: 4769737
  • Loading branch information
mcostalba committed Jul 20, 2013
1 parent 7b0b463 commit 2ed56f4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/position.cpp
Expand Up @@ -79,8 +79,6 @@ PieceType min_attacker(const Bitboard* bb, const Square& to, const Bitboard& stm
if (Pt == ROOK || Pt == QUEEN)
attackers |= attacks_bb<ROOK>(to, occupied) & (bb[ROOK] | bb[QUEEN]);

attackers &= occupied; // Remove the just found attacker

return (PieceType)Pt;
}
return min_attacker<Pt+1>(bb, to, stmAttackers, occupied, attackers);
Expand Down Expand Up @@ -1197,21 +1195,25 @@ int Position::see(Move m, int asymmThreshold) const {
do {
assert(slIndex < 32);

if (captured == KING) // Stop before processing a king capture
{
swapList[slIndex++] = QueenValueMg * 16;
break;
}

// Add the new entry to the swap list
swapList[slIndex] = -swapList[slIndex - 1] + PieceValue[MG][captured];
slIndex++;

// Locate and remove the next least valuable attacker
captured = min_attacker<PAWN>(byTypeBB, to, stmAttackers, occupied, attackers);
attackers &= occupied; // Remove the just found attacker
stm = ~stm;
stmAttackers = attackers & pieces(stm);

if (captured == KING)
{
// Stop before processing a king capture
if (stmAttackers)
swapList[slIndex++] = QueenValueMg * 16;

break;
}

} while (stmAttackers);

// If we are doing asymmetric SEE evaluation and the same side does the first
Expand Down

0 comments on commit 2ed56f4

Please sign in to comment.