Merge official-stockfish/master
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 9 Feb 2019 23:26:41 +0000 (00:26 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 9 Feb 2019 23:26:41 +0000 (00:26 +0100)
bench: 4691733

1  2 
src/evaluate.cpp
src/movepick.h
src/search.cpp
src/thread.cpp

@@@ -160,12 -154,6 +160,9 @@@ namespace 
    // PassedDanger[Rank] contains a term to weight the passed score
    constexpr int PassedDanger[RANK_NB] = { 0, 0, 0, 3, 7, 11, 20 };
  
 +  // KingProximity contains a penalty according to distance from king
 +  constexpr Score KingProximity = S(2, 2);
 +
-   // KingProtector[knight/bishop] contains a penalty according to distance from king
-   constexpr Score KingProtector[] = { S(5, 6), S(6, 5) };
    // Assorted bonuses and penalties
    constexpr Score BishopPawns        = S(  3,  7);
    constexpr Score CloseEnemies       = S(  6,  0);
                  score += MinorBehindPawn;
  
              // Penalty if the piece is far from the king
 +            if (pos.count<KING>(Us))
-             score -= KingProtector[Pt == BISHOP] * distance(s, pos.square<KING>(Us));
+             score -= KingProtector * distance(s, pos.square<KING>(Us));
  
              if (Pt == BISHOP)
              {
diff --cc src/movepick.h
Simple merge
diff --cc src/search.cpp
@@@ -1009,13 -983,11 +1009,11 @@@ moves_loop: // When in check, search st
        {
            Depth r = reduction<PvNode>(improving, depth, moveCount);
  
 -          if (captureOrPromotion) // (~5 Elo)
 +          if (captureOrPromotion || (pos.must_capture() && MoveList<CAPTURES>(pos).size())) // (~5 Elo)
            {
-               // Increase reduction by comparing opponent's stat score
-               if ((ss-1)->statScore >= 0)
-                   r += ONE_PLY;
-               r -= r ? ONE_PLY : DEPTH_ZERO;
+               // Decrease reduction by comparing opponent's stat score
+               if ((ss-1)->statScore < 0)
+                   r -= ONE_PLY;
            }
            else
            {
diff --cc src/thread.cpp
Simple merge