Merge official-stockfish/master
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 16 Jun 2019 13:54:37 +0000 (15:54 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 16 Jun 2019 13:54:37 +0000 (15:54 +0200)
No functional change.

1  2 
Readme.md
src/endgame.cpp
src/endgame.h
src/evaluate.cpp
src/main.cpp
src/position.cpp
src/search.cpp
src/tt.cpp
src/tt.h
src/types.h

diff --cc Readme.md
+++ b/Readme.md
@@@ -1,46 -1,8 +1,49 @@@
 -## Overview
 +## Fairy-Stockfish
 +
 +[![Build Status](https://travis-ci.org/ianfab/Fairy-Stockfish.svg?branch=master)](https://travis-ci.org/ianfab/Fairy-Stockfish)
 +[![Build Status](https://ci.appveyor.com/api/projects/status/github/ianfab/Fairy-Stockfish?branch=master&svg=true)](https://ci.appveyor.com/project/ianfab/Fairy-Stockfish/branch/master)
 +
 +Fairy-Stockfish is a Stockfish fork designed for the support of (fairy) chess variants and to make the addition/configuration of new variants as simple and flexible as possible. The goal of the project is to create an engine supporting a large variety of chess-like games, equipped with the powerful search of Stockfish. It is complementary to Stockfish forks more specialized for certain chess variants, such as [multi-variant Stockfish](https://github.com/ddugovic/Stockfish), [Seirawan-Stockfish](https://github.com/ianfab/Seirawan-Stockfish), [Makruk-Stockfish](https://github.com/ianfab/Makruk-Stockfish), etc., supporting more variants with the tradeoff of slightly lower performance.
 +
 +Besides chess, the currently supported games are:
 +
 +**Regional and historical games**
 +- [Shatranj](https://en.wikipedia.org/wiki/Shatranj), [Courier](https://en.wikipedia.org/wiki/Courier_chess)
 +- [Makruk](https://en.wikipedia.org/wiki/Makruk), [ASEAN](http://hgm.nubati.net/rules/ASEAN.html), Ai-Wok
 +- [Sittuyin](https://en.wikipedia.org/wiki/Sittuyin)
 +- [Shatar](https://en.wikipedia.org/wiki/Shatar), [Jeson Mor](https://en.wikipedia.org/wiki/Jeson_Mor)
 +- [Shogi](https://en.wikipedia.org/wiki/Shogi)
 +
 +**Chess variants**
 +- [Capablanca](https://en.wikipedia.org/wiki/Capablanca_Chess), [Janus](https://en.wikipedia.org/wiki/Janus_Chess), [Modern](https://en.wikipedia.org/wiki/Modern_Chess_(chess_variant)), [Chancellor](https://en.wikipedia.org/wiki/Chancellor_Chess), [Embassy](https://en.wikipedia.org/wiki/Embassy_Chess), [Capablanca random chess](https://en.wikipedia.org/wiki/Capablanca_Random_Chess)
 +- [Chess960](https://en.wikipedia.org/wiki/Chess960), [Placement/Pre-Chess](https://www.chessvariants.com/link/placement-chess)
 +- [Crazyhouse](https://en.wikipedia.org/wiki/Crazyhouse), [Loop](https://en.wikipedia.org/wiki/Crazyhouse#Variations), [Chessgi](https://en.wikipedia.org/wiki/Crazyhouse#Variations), [Pocket Knight](http://www.chessvariants.com/other.dir/pocket.html)
 +- [Amazon](https://en.wikipedia.org/wiki/Amazon_(chess)), [Chigorin](https://en.wikipedia.org/wiki/Chigorin_Chess), [Almost chess](https://en.wikipedia.org/wiki/Almost_Chess), [Hoppel-Poppel](http://www.chessvariants.com/diffmove.dir/hoppel-poppel.html)
 +- [Antichess](https://lichess.org/variant/antichess), [Giveaway](http://www.chessvariants.com/diffobjective.dir/giveaway.old.html), [Losers](https://www.chessclub.com/help/Wild17), [Codrus](http://www.binnewirtz.com/Schlagschach1.htm)
 +- [Extinction](https://en.wikipedia.org/wiki/Extinction_chess), [Kinglet](https://en.wikipedia.org/wiki/V._R._Parton#Kinglet_Chess)
 +- [King of the Hill](https://en.wikipedia.org/wiki/King_of_the_Hill_(chess)), [Racing Kings](https://en.wikipedia.org/wiki/V._R._Parton#Racing_Kings)
 +- [Three-check](https://en.wikipedia.org/wiki/Three-check_chess), Five-check
 +- [Los Alamos](https://en.wikipedia.org/wiki/Los_Alamos_chess)
 +- [Horde](https://en.wikipedia.org/wiki/Dunsany%27s_Chess#Horde_Chess)
 +
 +**Shogi variants**
 +- [Minishogi](https://en.wikipedia.org/wiki/Minishogi), [EuroShogi](https://en.wikipedia.org/wiki/EuroShogi), [Judkins shogi](https://en.wikipedia.org/wiki/Judkins_shogi)
 +- [Kyoto shogi](https://en.wikipedia.org/wiki/Kyoto_shogi), [Microshogi](https://en.wikipedia.org/wiki/Micro_shogi)
 +- [Dobutsu shogi](https://en.wikipedia.org/wiki/Dōbutsu_shōgi), [Goro goro shogi](https://en.wikipedia.org/wiki/D%C5%8Dbutsu_sh%C5%8Dgi#Variation)
 +
 +**Related games**
 +- [Breakthrough](https://en.wikipedia.org/wiki/Breakthrough_(board_game))
 +- [Clobber](https://en.wikipedia.org/wiki/Clobber)
 +- [Connect4](https://en.wikipedia.org/wiki/Connect_Four), [Tic-Tac-Toe](https://en.wikipedia.org/wiki/Tic-tac-toe)
 +
 +See the [Fairy-Stockfish Wiki](https://github.com/ianfab/Fairy-Stockfish/wiki) for more info.
 +
 +## Stockfish
 +### Overview
  
+ [![Build Status](https://travis-ci.org/official-stockfish/Stockfish.svg?branch=master)](https://travis-ci.org/official-stockfish/Stockfish)
+ [![Build Status](https://ci.appveyor.com/api/projects/status/github/official-stockfish/Stockfish?branch=master&svg=true)](https://ci.appveyor.com/project/mcostalba/stockfish/branch/master)
  [Stockfish](https://stockfishchess.org) is a free, powerful UCI chess engine
  derived from Glaurung 2.1. It is not a complete chess program and requires a
  UCI-compatible GUI (e.g. XBoard with PolyGlot, Scid, Cute Chess, eboard, Arena,
diff --cc src/endgame.cpp
@@@ -101,30 -88,24 +101,30 @@@ namespace Endgames 
  
    void init() {
  
-       add<KPK>("KPK");
-       add<KNNK>("KNNK");
-       add<KBNK>("KBNK");
-       add<KRKP>("KRKP");
-       add<KRKB>("KRKB");
-       add<KRKN>("KRKN");
-       add<KQKP>("KQKP");
-       add<KQKR>("KQKR");
-       add<KNNKP>("KNNKP");
-       // Fairy piece endgames
-       add<KNSK>("KNSK");
-       add<KNFK>("KNFK");
-       add<KNSFKR>("KNSFKR");
-       add<KSFK>("KSFK");
-       add<KNPK>("KNPK");
-       add<KNPKB>("KNPKB");
-       add<KRPKR>("KRPKR");
-       add<KRPKB>("KRPKB");
-       add<KBPKB>("KBPKB");
-       add<KBPKN>("KBPKN");
-       add<KBPPKB>("KBPPKB");
-       add<KRPPKRP>("KRPPKRP");
+     add<KPK>("KPK");
+     add<KNNK>("KNNK");
+     add<KBNK>("KBNK");
+     add<KRKP>("KRKP");
+     add<KRKB>("KRKB");
+     add<KRKN>("KRKN");
+     add<KQKP>("KQKP");
+     add<KQKR>("KQKR");
+     add<KNNKP>("KNNKP");
++    // Fairy piece endgames
++    add<KNSK>("KNSK");
++    add<KNFK>("KNFK");
++    add<KNSFKR>("KNSFKR");
++    add<KSFK>("KSFK");
++
+     add<KNPK>("KNPK");
+     add<KNPKB>("KNPKB");
+     add<KRPKR>("KRPKR");
+     add<KRPKB>("KRPKB");
+     add<KBPKB>("KBPKB");
+     add<KBPKN>("KBPKN");
+     add<KBPPKB>("KBPPKB");
+     add<KRPPKRP>("KRPPKRP");
    }
  }
  
diff --cc src/endgame.h
Simple merge
@@@ -1042,7 -800,7 +1040,7 @@@ namespace 
  
      // Early exit if score is high
      Value v = (mg_value(score) + eg_value(score)) / 2;
-     if (abs(v) > (LazyThreshold + pos.non_pawn_material() / 64) && Options["UCI_Variant"] == "chess")
 -    if (abs(v) > LazyThreshold + pos.non_pawn_material() / 64)
++    if (abs(v) > LazyThreshold + pos.non_pawn_material() / 64 && Options["UCI_Variant"] == "chess")
         return pos.side_to_move() == WHITE ? v : -v;
  
      // Main evaluation begins here
diff --cc src/main.cpp
Simple merge
@@@ -657,19 -488,10 +657,19 @@@ Bitboard Position::slider_blockers(Bitb
    Bitboard blockers = 0;
    pinners = 0;
  
 +  if (s == SQ_NONE || !sliders)
 +      return blockers;
 +
    // Snipers are sliders that attack 's' when a piece and other snipers are removed
 -  Bitboard snipers = (  (PseudoAttacks[  ROOK][s] & pieces(QUEEN, ROOK))
 -                      | (PseudoAttacks[BISHOP][s] & pieces(QUEEN, BISHOP))) & sliders;
 +  Bitboard snipers = 0;
 +
 +  for (PieceType pt : piece_types())
 +  {
 +      Bitboard b = sliders & (PseudoAttacks[~c][pt][s] ^ LeaperAttacks[~c][pt][s]) & pieces(c, pt);
 +      if (b)
 +          snipers |= b & ~attacks_from(~c, pt, s);
 +  }
-   Bitboard occupancy = pieces() & ~snipers;
+   Bitboard occupancy = pieces() ^ snipers;
  
    while (snipers)
    {
diff --cc src/search.cpp
@@@ -1050,10 -1019,11 +1046,11 @@@ moves_loop: // When in check, search st
            // Decrease reduction if opponent's move count is high (~10 Elo)
            if ((ss-1)->moveCount > 15)
                r -= ONE_PLY;
            // Decrease reduction if move has been singularly extended
-           r -= singularExtensionLMRmultiplier * ONE_PLY;
+           r -= singularLMR * ONE_PLY;
  
 -          if (!captureOrPromotion)
 +          if (!captureOrPromotion && !(pos.must_capture() && MoveList<CAPTURES>(pos).size()))
            {
                // Increase reduction if ttMove is a capture (~0 Elo)
                if (ttCapture)
diff --cc src/tt.cpp
Simple merge
diff --cc src/tt.h
+++ b/src/tt.h
  
  struct TTEntry {
  
 -  Move  move()  const { return (Move )move16; }
 +  Move  move()  const { return (Move )move32; }
    Value value() const { return (Value)value16; }
    Value eval()  const { return (Value)eval16; }
-   Depth depth() const { return (Depth)(depth8 * int(ONE_PLY)) + DEPTH_NONE; }
+   Depth depth() const { return (Depth)(depth8 * int(ONE_PLY)) + DEPTH_OFFSET; }
    bool is_pv() const { return (bool)(genBound8 & 0x4); }
    Bound bound() const { return (Bound)(genBound8 & 0x3); }
    void save(Key k, Value v, bool pv, Bound b, Depth d, Move m, Value ev);
diff --cc src/types.h
Simple merge