From: Fabian Fichter Date: Sun, 16 Jun 2019 13:54:37 +0000 (+0200) Subject: Merge official-stockfish/master X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=45ebcb688b7be77be8e4aa4527e83ac3d1dccd67;p=fairystockfish.git Merge official-stockfish/master No functional change. --- 45ebcb688b7be77be8e4aa4527e83ac3d1dccd67 diff --cc Readme.md index 9059065,be32476..c952c42 --- a/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 index 55edc33,4f8c227..575cc03 --- a/src/endgame.cpp +++ b/src/endgame.cpp @@@ -101,30 -88,24 +101,30 @@@ namespace Endgames void init() { - add("KPK"); - add("KNNK"); - add("KBNK"); - add("KRKP"); - add("KRKB"); - add("KRKN"); - add("KQKP"); - add("KQKR"); - add("KNNKP"); - - // Fairy piece endgames - add("KNSK"); - add("KNFK"); - add("KNSFKR"); - add("KSFK"); - - add("KNPK"); - add("KNPKB"); - add("KRPKR"); - add("KRPKB"); - add("KBPKB"); - add("KBPKN"); - add("KBPPKB"); - add("KRPPKRP"); + add("KPK"); + add("KNNK"); + add("KBNK"); + add("KRKP"); + add("KRKB"); + add("KRKN"); + add("KQKP"); + add("KQKR"); + add("KNNKP"); + ++ // Fairy piece endgames ++ add("KNSK"); ++ add("KNFK"); ++ add("KNSFKR"); ++ add("KSFK"); ++ + add("KNPK"); + add("KNPKB"); + add("KRPKR"); + add("KRPKB"); + add("KBPKB"); + add("KBPKN"); + add("KBPPKB"); + add("KRPPKRP"); } } diff --cc src/evaluate.cpp index bdf4053,3ff1460..4865e96 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@@ -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/position.cpp index b8756cd,14121d4..7956b7a --- a/src/position.cpp +++ b/src/position.cpp @@@ -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 index e4314ab,0e10f44..82655bf --- a/src/search.cpp +++ b/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(pos).size())) { // Increase reduction if ttMove is a capture (~0 Elo) if (ttCapture) diff --cc src/tt.h index 78ca0fd,3a5ba5d..1877f1d --- a/src/tt.h +++ b/src/tt.h @@@ -37,10 -37,10 +37,10 @@@ 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);