Merge official-stockfish/master
authorFabian Fichter <ianfab@users.noreply.github.com>
Mon, 10 Aug 2020 20:54:39 +0000 (22:54 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Mon, 10 Aug 2020 20:54:39 +0000 (22:54 +0200)
bench: 4822192

1  2 
.travis.yml
src/evaluate.cpp
src/misc.cpp
src/movepick.cpp
src/pawns.cpp
src/search.cpp
src/thread.cpp

diff --cc .travis.yml
Simple merge
@@@ -93,9 -90,9 +93,9 @@@ namespace 
  
    // MobilityBonus[PieceType-2][attacked] contains bonuses for middle and end game,
    // indexed by piece type and number of attacked squares in the mobility area.
 -  constexpr Score MobilityBonus[][32] = {
 +  constexpr Score MobilityBonus[][4 * RANK_NB] = {
-     { S(-62,-81), S(-53,-56), S(-12,-30), S( -4,-14), S(  3,  8), S( 13, 15), // Knight
-       S( 22, 23), S( 28, 27), S( 33, 33) },
+     { S(-62,-81), S(-53,-56), S(-12,-31), S( -4,-16), S(  3,  5), S( 13, 11), // Knight
+       S( 22, 17), S( 28, 20), S( 33, 25) },
      { S(-48,-59), S(-20,-23), S( 16, -3), S( 26, 13), S( 38, 24), S( 51, 42), // Bishop
        S( 55, 54), S( 63, 57), S( 63, 65), S( 68, 73), S( 81, 78), S( 81, 86),
        S( 91, 88), S( 98, 97) },
      constexpr Direction Down = -Up;
  
      auto king_proximity = [&](Color c, Square s) {
 -      return std::min(distance(pos.square<KING>(c), s), 5);
 +      return pos.extinction_value() == VALUE_MATE ? 0 : pos.count<KING>(c) ? std::min(distance(pos.square<KING>(c), s), 5) : 5;
      };
  
-     Bitboard b, bb, squaresToQueen, unsafeSquares, candidatePassers, leverable;
+     Bitboard b, bb, squaresToQueen, unsafeSquares, blockedPassers, helpers;
      Score score = SCORE_ZERO;
  
      b = pe->passed_pawns(Us);
  
      // Compute the initiative bonus for the attacking side
      int complexity =   9 * pe->passed_count()
-                     + 11 * pos.count<PAWN>()
+                     + 12 * pos.count<PAWN>()
 +                    + 15 * pos.count<SOLDIER>()
                      +  9 * outflanking
                      + 21 * pawnsOnBothFlanks
                      + 24 * infiltration
diff --cc src/misc.cpp
Simple merge
@@@ -174,7 -169,7 +174,7 @@@ top
  
    case GOOD_CAPTURE:
        if (select<Best>([&](){
-                        return pos.see_ge(*cur, Value(-55 * cur->value / 1024 - 500 * (pos.captures_to_hand() && pos.gives_check(*cur)))) || pos.must_capture() ?
 -                       return pos.see_ge(*cur, Value(-69 * cur->value / 1024)) ?
++                       return pos.see_ge(*cur, Value(-69 * cur->value / 1024 - 500 * (pos.captures_to_hand() && pos.gives_check(*cur)))) || pos.must_capture() ?
                                // Move losing capture to endBadCaptures to be tried later
                                true : (*endBadCaptures++ = *cur, false); }))
            return *(cur - 1);
diff --cc src/pawns.cpp
@@@ -147,9 -145,16 +148,16 @@@ namespace 
          }
  
          else if (!neighbours)
+         {
 -            score -=   Isolated
 +            score -=   Isolated * (1 + 2 * pos.must_capture())
                       + WeakUnopposed * !opposed;
  
+             if (   (ourPawns & forward_file_bb(Them, s))
+                 && popcount(opposed) == 1
+                 && !(theirPawns & adjacent_files_bb(s)))
 -                score -= DoubledIsolated;
++                score -= DoubledIsolated * (1 + 2 * pos.must_capture());
+         }
          else if (backward)
              score -=   Backward
                       + WeakUnopposed * !opposed;
diff --cc src/search.cpp
Simple merge
diff --cc src/thread.cpp
@@@ -211,8 -211,7 +211,7 @@@ void ThreadPool::start_thinking(Positio
        th->nodes = th->tbHits = th->nmpMinPly = 0;
        th->rootDepth = th->completedDepth = 0;
        th->rootMoves = rootMoves;
 -      th->rootPos.set(pos.fen(), pos.is_chess960(), &setupStates->back(), th);
 +      th->rootPos.set(pos.variant(), pos.fen(), pos.is_chess960(), &setupStates->back(), th);
-       th->lowPlyHistory.fill(0);
    }
  
    setupStates->back() = tmp;