From: Fabian Fichter Date: Sat, 13 Apr 2019 16:09:25 +0000 (+0200) Subject: Merge branch 'master' of https://github.com/official-stockfish/Stockfish X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=1981cf81ae86026b3df44f869728ab15b0d6a9af;p=fairystockfish.git Merge branch 'master' of https://github.com/official-stockfish/Stockfish bench: 2706246 --- 1981cf81ae86026b3df44f869728ab15b0d6a9af diff --cc src/pawns.cpp index 32cddcd,b034f47..0aa8027 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@@ -89,6 -89,7 +89,7 @@@ namespace assert(pos.piece_on(s) == make_piece(Us, PAWN)); File f = file_of(s); - Rank r = relative_rank(Us, s); ++ Rank r = relative_rank(Us, s, pos.max_rank()); e->semiopenFiles[Us] &= ~(1 << f); e->pawnAttacksSpan[Us] |= pawn_attack_span(Us, s); @@@ -96,12 -97,12 +97,12 @@@ // Flag the pawn opposed = theirPawns & forward_file_bb(Us, s); stoppers = theirPawns & passed_pawn_span(Us, s); - lever = theirPawns & PawnAttacks[Us][s]; - leverPush = theirPawns & PawnAttacks[Us][s + Up]; - doubled = ourPawns & (s - Up); + lever = theirPawns & PseudoAttacks[Us][PAWN][s]; + leverPush = relative_rank(Them, s, pos.max_rank()) > RANK_1 ? theirPawns & PseudoAttacks[Us][PAWN][s + Up] : 0; - doubled = relative_rank(Us, s, pos.max_rank()) > RANK_1 ? ourPawns & (s - Up) : 0; ++ doubled = r > RANK_1 ? ourPawns & (s - Up) : 0; neighbours = ourPawns & adjacent_files_bb(f); phalanx = neighbours & rank_bb(s); - support = relative_rank(Us, s, pos.max_rank()) > RANK_1 ? neighbours & rank_bb(s - Up) : 0; - support = neighbours & rank_bb(s - Up); ++ support = r > RANK_1 ? neighbours & rank_bb(s - Up) : 0; // A pawn is backward when it is behind all pawns of the same color // on the adjacent files and cannot be safely advanced. @@@ -118,9 -118,7 +119,9 @@@ && popcount(phalanx) >= popcount(leverPush)) e->passedPawns[Us] |= s; - else if (stoppers == square_bb(s + Up) && r >= RANK_5) + else if ( relative_rank(Them, s, pos.max_rank()) > RANK_1 + && stoppers == square_bb(s + Up) - && relative_rank(Us, s, pos.max_rank()) >= RANK_5) ++ && r >= RANK_5) { b = shift(support) & ~theirPawns; while (b)