From: Fabian Fichter Date: Sat, 9 Feb 2019 23:44:47 +0000 (+0100) Subject: Merge official-stockfish/master X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=dd665716fb9635a09f55f29c69243c63aa52c3dc;p=fairystockfish.git Merge official-stockfish/master bench: 4915605 --- dd665716fb9635a09f55f29c69243c63aa52c3dc diff --cc src/evaluate.cpp index 50aa7ec,bbab9c5..53899e6 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@@ -648,20 -538,25 +648,26 @@@ namespace { Square s = pop_lsb(&b); score += ThreatByMinor[type_of(pos.piece_on(s))]; - if (type_of(pos.piece_on(s)) != PAWN) - score += ThreatByRank * (int)relative_rank(Them, s); ++ + if (type_of(pos.piece_on(s)) != PAWN && type_of(pos.piece_on(s)) != SHOGI_PAWN) + score += ThreatByRank * (int)relative_rank(Them, s, pos.max_rank()); + + else if (pos.blockers_for_king(Them) & s) - score += ThreatByRank * (int)relative_rank(Them, s) / 2; ++ score += ThreatByRank * (int)relative_rank(Them, s, pos.max_rank()) / 2; } - b = (pos.pieces(Them, QUEEN) | weak) & attackedBy[Us][ROOK]; + b = weak & attackedBy[Us][ROOK]; while (b) { Square s = pop_lsb(&b); score += ThreatByRook[type_of(pos.piece_on(s))]; - if (type_of(pos.piece_on(s)) != PAWN) - score += ThreatByRank * (int)relative_rank(Them, s); + if (type_of(pos.piece_on(s)) != PAWN && type_of(pos.piece_on(s)) != SHOGI_PAWN) + score += ThreatByRank * (int)relative_rank(Them, s, pos.max_rank()); + + else if (pos.blockers_for_king(Them) & s) - score += ThreatByRank * (int)relative_rank(Them, s) / 2; ++ score += ThreatByRank * (int)relative_rank(Them, s, pos.max_rank()) / 2; } - // Bonus for king attacks on pawns or pieces which are not pawn-defended if (weak & attackedBy[Us][KING]) score += ThreatByKing; diff --cc src/movepick.h index 89a78dd,141454a..63b5df5 --- a/src/movepick.h +++ b/src/movepick.h @@@ -85,7 -85,7 +85,7 @@@ enum StatsParams { NOT_USED = 0 } /// unsuccessful during the current search, and is used for reduction and move /// ordering decisions. It uses 2 tables (one for each color) indexed by /// the move's from and to squares, see chessprogramming.wikispaces.com/Butterfly+Boards - typedef Stats ButterflyHistory; -typedef Stats ButterflyHistory; ++typedef Stats ButterflyHistory; /// CounterMoveHistory stores counter moves indexed by [piece][to] of the previous /// move, see chessprogramming.wikispaces.com/Countermove+Heuristic diff --cc src/pawns.cpp index 8bb1b32,761d770..11820dc --- a/src/pawns.cpp +++ b/src/pawns.cpp @@@ -233,9 -206,9 +233,9 @@@ Value Entry::evaluate_shelter(const Pos constexpr Color Them = (Us == WHITE ? BLACK : WHITE); constexpr Direction Down = (Us == WHITE ? SOUTH : NORTH); - constexpr Bitboard BlockRanks = (Us == WHITE ? Rank1BB | Rank2BB : Rank8BB | Rank7BB); + Bitboard BlockRanks = rank_bb(relative_rank(Us, RANK_1, pos.max_rank())) | rank_bb(relative_rank(Us, RANK_2, pos.max_rank())); - Bitboard b = pos.pieces(PAWN, SHOGI_PAWN) & (forward_ranks_bb(Us, ksq) | rank_bb(ksq)); - Bitboard b = pos.pieces(PAWN) & ~forward_ranks_bb(Them, ksq); ++ Bitboard b = pos.pieces(PAWN, SHOGI_PAWN) & ~forward_ranks_bb(Them, ksq); Bitboard ourPawns = b & pos.pieces(Us); Bitboard theirPawns = b & pos.pieces(Them);