Merge official-stockfish/master
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 18 Jul 2020 13:47:07 +0000 (15:47 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 18 Jul 2020 13:47:07 +0000 (15:47 +0200)
bench: 4507590

1  2 
src/endgame.cpp
src/endgame.h
src/evaluate.cpp
src/pawns.cpp
src/search.cpp

diff --cc src/endgame.cpp
@@@ -86,16 -79,7 +86,15 @@@ namespace Endgames 
      add<KQKR>("KQKR");
      add<KNNKP>("KNNKP");
  
 +    // Fairy piece endgames
 +    add<KNSK>("KNSK");
 +    add<KNFK>("KNFK");
 +    add<KNSFKR>("KNSFKR");
 +    add<KSFK>("KSFK");
 +    add<KSFKF>("KSFKF");
 +    add<KRKS>("KRKS");
 +
      add<KNPK>("KNPK");
-     add<KNPKB>("KNPKB");
      add<KRPKR>("KRPKR");
      add<KRPKB>("KRPKB");
      add<KBPKB>("KBPKB");
diff --cc src/endgame.h
Simple merge
@@@ -1058,13 -707,11 +1059,12 @@@ namespace 
      bool pawnsOnBothFlanks =   (pos.pieces(PAWN) & QueenSide)
                              && (pos.pieces(PAWN) & KingSide);
  
-     bool almostUnwinnable =   !pe->passed_count()
-                            &&  outflanking < 0
+     bool almostUnwinnable =   outflanking < 0
 +                           && pos.stalemate_value() == VALUE_DRAW
                             && !pawnsOnBothFlanks;
  
 -    bool infiltration = rank_of(pos.square<KING>(WHITE)) > RANK_4
 -                     || rank_of(pos.square<KING>(BLACK)) < RANK_5;
 +    bool infiltration =   (pos.count<KING>(WHITE) && rank_of(pos.square<KING>(WHITE)) > RANK_4)
 +                       || (pos.count<KING>(BLACK) && rank_of(pos.square<KING>(BLACK)) < RANK_5);
  
      // Compute the initiative bonus for the attacking side
      int complexity =   9 * pe->passed_count()
diff --cc src/pawns.cpp
@@@ -125,9 -124,11 +125,11 @@@ namespace 
                  || (   stoppers == blocked && r >= RANK_5
                      && (shift<Up>(support) & ~(theirPawns | doubleAttackThem)));
  
+         passed &= !(forward_file_bb(Us, s) & ourPawns);
          // Passed pawns will be properly scored later in evaluation when we have
          // full attack info.
 -        if (passed)
 +        if (passed && is_ok(s + Up) && (r < pos.promotion_rank() || !pos.mandatory_pawn_promotion()))
              e->passedPawns[Us] |= s;
  
          // Score this pawn
diff --cc src/search.cpp
@@@ -463,7 -433,7 +463,7 @@@ void Thread::search() 
            if (rootDepth >= 4)
            {
                Value previousScore = rootMoves[pvIdx].previousScore;
-               delta = Value(21 * (1 + rootPos.captures_to_hand()) + abs(previousScore) / 256);
 -              delta = Value(21);
++              delta = Value(21 * (1 + rootPos.captures_to_hand()));
                alpha = std::max(previousScore - delta,-VALUE_INFINITE);
                beta  = std::min(previousScore + delta, VALUE_INFINITE);