Restrict mobility of pinned pieces

Passed both short TC:
LLR: 3.00 (-2.94,2.94) [-1.50,4.50]
Total: 54342 W: 10950 L: 10692 D: 32700

And long TC:
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 61976 W: 10654 L: 10251 D: 41071

This patch introduces a slowdown of 3.5 % !!!!!

bench: 7911558
This commit is contained in:
Gary Linscott
2013-11-07 13:59:11 -05:00
committed by Marco Costalba
parent ecd07e51d0
commit 13d1f0ae43
6 changed files with 19 additions and 12 deletions

View File

@@ -98,7 +98,7 @@ CheckInfo::CheckInfo(const Position& pos) {
Color them = ~pos.side_to_move();
ksq = pos.king_square(them);
pinned = pos.pinned_pieces();
pinned = pos.pinned_pieces(pos.side_to_move());
dcCandidates = pos.discovered_check_candidates();
checkSq[PAWN] = pos.attacks_from<PAWN>(ksq, them);
@@ -422,7 +422,7 @@ const string Position::pretty(Move move) const {
/// pieces, according to the call parameters. Pinned pieces protect our king,
/// discovery check pieces attack the enemy king.
Bitboard Position::hidden_checkers(Square ksq, Color c) const {
Bitboard Position::hidden_checkers(Square ksq, Color c, Color toMove) const {
Bitboard b, pinners, result = 0;
@@ -435,7 +435,7 @@ Bitboard Position::hidden_checkers(Square ksq, Color c) const {
b = between_bb(ksq, pop_lsb(&pinners)) & pieces();
if (!more_than_one(b))
result |= b & pieces(sideToMove);
result |= b & pieces(toMove);
}
return result;
}
@@ -477,7 +477,7 @@ Bitboard Position::attacks_from(Piece p, Square s, Bitboard occ) {
bool Position::legal(Move m, Bitboard pinned) const {
assert(is_ok(m));
assert(pinned == pinned_pieces());
assert(pinned == pinned_pieces(pos.side_to_move()));
Color us = sideToMove;
Square from = from_sq(m);