/Pikafish

UCI xiangqi engine

Primary LanguageC++GNU General Public License v3.0GPL-3.0

Pikafish

Pikafish

A free and strong UCI xiangqi engine.
Explore Pikafish docs »

Report bug · Open a discussion · Discord · Blog

Build License
Release Commits
Website Fishtest Discord

Overview

Pikafish is a free and strong UCI xiangqi engine derived from Stockfish that analyzes xiangqi positions and computes the optimal moves.

Pikafish does not include a graphical user interface (GUI) that is required to display a chessboard and to make it easy to input moves. These GUIs are developed independently from Pikafish and are available online. Read the documentation for your GUI of choice for information about how to use Pikafish with it.

See also the Pikafish documentation for further usage help.

Files

This distribution of Pikafish consists of the following files:

  • README.md, the file you are currently reading.

  • Copying.txt, a text file containing the GNU General Public License version 3.

  • AUTHORS, a text file with the list of authors for the official Pikafish project.

  • src, a subdirectory containing the full source code, including a Makefile that can be used to compile Pikafish on Unix-like systems.

  • a file with the .nnue extension, storing the neural network for the NNUE evaluation.

The UCI protocol

The Universal Chess Interface (UCI) is a standard text-based protocol used to communicate with a chess engine and is the recommended way to do so for typical graphical user interfaces (GUI) or chess tools. Pikafish implements the majority of its options.

Developers can see the default values for the UCI options available in Pikafish by typing ./pikafish uci in a terminal, but most users should typically use a xiangqi GUI to interact with Pikafish.

For more information on UCI or debug commands, see our documentation.

Compiling Pikafish

Pikafish has support for 32 or 64-bit CPUs, certain hardware instructions, big-endian machines such as Power PC, and other platforms.

On Unix-like systems, it should be easy to compile Pikafish directly from the source code with the included Makefile in the folder src. In general, it is recommended to run make help to see a list of make targets with corresponding descriptions.

cd src
make -j build ARCH=x86-64-modern

Detailed compilation instructions for all platforms can be found in our documentation.

Contributing

Donating hardware

Improving Pikafish requires a massive amount of testing. You can donate your hardware resources by installing the Fishtest Worker and viewing the current tests on Fishtest.

Improving the code

In the chessprogramming wiki, many techniques used in Pikafish are explained with a lot of background information. The section on Stockfish describes many features and techniques used by Stockfish. However, it is generic rather than focused on Stockfish's precise implementation.

The engine testing is done on Fishtest. If you want to help improve Pikafish, please read this guideline first, where the basics of Pikafish development are explained.

Discussions about Pikafish take place these days mainly in the Pikafish Discord server. This is also the best place to ask questions about the codebase and how to improve it.

Terms of use

GNU General Public License version 3

Pikafish is free and distributed under the GNU General Public License version 3 (GPL v3). Essentially, this means you are free to do almost exactly what you want with the program, including distributing it among your friends, making it available for download from your website, selling it (either by itself or as part of some bigger software package), or using it as the starting point for a software project of your own.

The only real limitation is that whenever you distribute Pikafish in some way, you MUST always include the license and the full source code (or a pointer to where the source code can be found) to generate the exact binary you are distributing. If you make any changes to the source code, these changes must also be made available under GPL v3.

NNUE-License

Any usage of the Pikafish weights constitutes agreement to this License.

The weight file (pikafish.nnue) released with the pikafish and the weight file further derived from the weight are:

  1. Only for legal use, any consequences caused by any use beyond the legal scope (e.g. online cheating) shall be borne by the user.
  2. No commercial use without permission.

The use of the nnue weights file for commercial purposes by the following individuals and organizations is permitted, in appreciation of their support:

  1. Just Xiangqi

The following individuals and organizations are prohibited from using the nnue weights file derived from this program due to their unfriendly actions, activities, and license violations:

  1. 鹏飞象棋
  2. 国圣象棋
  3. 飞风追云
  4. 枯叶
  5. 静香
  6. 老步
  7. 刀霸刘涛