All Projects → mvanthoor → rustic

mvanthoor / rustic

Licence: GPL-3.0 license
Rustic is a chess engine. It is written from scratch, in the Rust programming language.

Programming Languages

rust
11053 projects
Makefile
30231 projects

Projects that are alternatives of or similar to rustic

stockfish-chess-web-gui
Responsive chess web GUI to play against the Stockfish 10 chess engine. Multiple web GUI implementations have also been included.
Stars: ✭ 21 (-69.12%)
Mutual labels:  chess-engine, chess
elephantfish
elephantfish: 一个只有124行的中国象棋引擎
Stars: ✭ 129 (+89.71%)
Mutual labels:  chess-engine, chess
liground
A free, open-source and modern Chess Variant Analysis GUI for the 21st century
Stars: ✭ 41 (-39.71%)
Mutual labels:  chess-engine, chess
ConvChess
Convolutional Neural Networks learns to play chess moves
Stars: ✭ 14 (-79.41%)
Mutual labels:  chess-engine, chess
Zerofish
An implementation of the AlphaZero algorithm for chess
Stars: ✭ 34 (-50%)
Mutual labels:  chess-engine, chess
magic-bits
A C++ header-only library for efficient move generation in Chess using "magic bitboards" technique
Stars: ✭ 26 (-61.76%)
Mutual labels:  chess-engine, chess
zahak
A UCI compatible chess AI in Go
Stars: ✭ 20 (-70.59%)
Mutual labels:  chess-engine, chess
bot-o-tron
Try out lichess' bot interface
Stars: ✭ 36 (-47.06%)
Mutual labels:  chess-engine, chess
Sunfish
Sunfish: a Python Chess Engine in 111 lines of code
Stars: ✭ 2,254 (+3214.71%)
Mutual labels:  chess-engine, chess
Walleye
A chess engine written from scratch in Rust ♞
Stars: ✭ 82 (+20.59%)
Mutual labels:  chess-engine, chess
Realtime-OpenCV-Chess
♔ Chess-playing with Open-CV [Human vs AI (Stockfish engine)]
Stars: ✭ 18 (-73.53%)
Mutual labels:  chess-engine, chess
Demolito
UCI Chess Engine
Stars: ✭ 41 (-39.71%)
Mutual labels:  chess-engine, chess
renpy-chess
A chess GUI built with Ren'Py, python-chess, and Stockfish. Version 2.0 of https://github.com/RuolinZheng08/renpy-chess-engine
Stars: ✭ 36 (-47.06%)
Mutual labels:  chess-engine, chess
littlewing
Chess engine written in Rust ♛
Stars: ✭ 27 (-60.29%)
Mutual labels:  chess-engine, chess
OpenChess
A cross-platform chess game.
Stars: ✭ 18 (-73.53%)
Mutual labels:  chess-engine, chess
Bit-Genie
UCI chess engine in C++
Stars: ✭ 19 (-72.06%)
Mutual labels:  chess-engine, chess
fastchess
Predicts the best chess move with 27.5% accuracy by a single matrix multiplication
Stars: ✭ 75 (+10.29%)
Mutual labels:  chess-engine, chess
uci
A thin wrapper on a uci chess engine
Stars: ✭ 33 (-51.47%)
Mutual labels:  chess-engine, chess
lila-tablebase
Tablebase server
Stars: ✭ 51 (-25%)
Mutual labels:  chess
Chess.jl
Julia chess programming library.
Stars: ✭ 91 (+33.82%)
Mutual labels:  chess

Rustic Banner

https://rustic-chess.org/

Rustic Chess Engine

Rustic is a chess engine written from scratch in the Rust programming language. It is not derived from any other engine, but it uses many concepts that have been well-known in chess programming for many decades; therefore, the engine still stands on the shoulders of the giants of the past.

User interface

The engine does not provide its own user interface. It uses the UCI and XBoard protocols to communicate with graphical user interfaces. (XBoard is not yet completely implemented at the time of writing. For now, use the engine in UCI mode, which is also the default.) It is recommended that you use a GUI to play games against the engine. Rustic is tested with these user interfaces:

There are many other user interfaces that will probably work just fine, but its obviously impossible to test all of them. If you have problems with a user interface, open an issue so I can see if it can be fixed. (Assuming the user interface is either free or open source, as I can't go and buy GUI's just for testing purposes.)

Features

The current feature-set for Rustic Alpha 3.0.0 is:

  • Engine:
    • Bitboard board representation
    • Fancy Magic bitboard move generator
    • Transposition Table
    • UCI-protocol
  • Search
    • Alpha/Beta search
    • Quiescence search
    • Check extension
    • PVS
  • Move ordering
    • TT Move priority
    • MVV-LVA
    • Killer moves
  • Evaluation
    • Material counting
    • Piece-Square Tables

(See changelog.md for more information.)

Included binaries, supported platforms

Each release contains several binaries; these are compiled for different types of CPU's. The following binaries are supplied:

  • bmi2: Intel Haswell (2013), AMD Zen 3 (2020)
  • popcnt: Intel Nehalem (2008), AMD Bulldozer (2011), AMD Zen 1 and 2 (2017)
  • old: Intel Core2 Duo (2006) and AMD CPU's between 2003 and 2011
  • ancient: For the very first 64-bit CPU's (2003)
  • i686: Intel Pentium II (1998) (Windows only), 32-bit
  • arm: Raspberry Pi 3 and 4 (not tested on RPi 1 and 2)

Windows still supports a 32-bit executable. Note that this executable is at 50% slower (half the speed) as compared to the 64-bit one and not as well tested. Many Linux-distributions have dropped support for 32-bit native Linux software, so no 32-bit executable for Linux is provided. The same is true for MacOS. The executable for the Raspberry Pi will be 32-bit as long as the 32-bit version of Raspbian OS is the default and 64-bit is experimental.

You can use the binary which runs fastest on your particular system for maximum playing strength. Start a terminal, and run each Rustic version:

$ ./<executable_name> -p7 -h512

This will run perft 7 from the starting position, using a 512 MB transposition table. Pick the version that runs perft 7 the fastest. If a binary crashes, your CPU does not support the required instructions to run it. Try a different binary.

If you wish to run Rustic on a system for which no binary is supplied, you can try to compile the engine yourself using the compilation tips below. Make sure to install at least Rust version 1.46.

Quick compiling tips

The engine includes a Makefile since Rustic Alpha 3.0.0, which makes building the engine easier. If you wish to build the engine yourself, you can find some quick tips below. These are meant for people who have some experience with setting up build environments, or have them installed already. If more information is required, see the file "build.md", or Rustic's documentation.

Build environment

  • Install Rust for your platform
  • Windows: Install MSYS2
    • Make sure you install the following parts:
      • CoreUtils
      • BinUtils
      • GCC
      • Make
  • MacOS:
    • Install HomeBrew
    • Install GNU Make
    • The command is "gmake" instead of "make", as MacOS includes its own (very old) version of "make".
  • Make sure you install the correct Rust target for your platform, using Rustup:
    • Linux:
      • stable-x86_64-unknown-linux-gnu
    • Windows:
      • stable-x86_64-pc-windows-gnu (This toolchain creates compiles that are compatible with the GNU GDB-debugger.)
      • stable-x86_64-pc-windows-msvc (This toolchain creates compiles that are compatible with Windows/Visual Studio's debugger. This will require the Microsoft Visual C++ Build Tools, because it uses the Microsoft Linker.)
  • Install Git for your platform.

Building Rustic

  • Start the terminal for your platform: MSYS2 (MinGW64 or MinGW32 version) for Windows, Terminal on Mac, and for Linux, your favorite terminal emulator.
  • Clone Rustic: "git clone https://github.com/mvanthoor/rustic.git"
  • Switch to the "rustic" folder.
  • Run "make" (Windows, Linux) or "gmake" (MacOS).
  • A ./bin folder should be created. The Makefile will build all versions of Rustic for the operating system and CPU you're running on.

Extra module

There is a module called "Extra", which copmiles some extra capabilities into the Rustic executable.

  • Command-line option -e: Rustic can run a perft suite containing 172 tests, to see if its move generator, make, and unmake are working as intended. This is mainly useful for developers.
  • Command-line option -w: Using this option, Rustic can perform Wizardry: it runs a function that generates magic numbers for use in a magic bitboard engine which has square A1 = 0, or LSB, and square H8 = 63. This is mainly useful if one wants to write their own chess engine, bus has no interest in writing a function to compute the magic numbers. (Though, doing so, will make understanding of magic bitboards much more complete.)

This module can be included by using the --features option of cargo:

cargo build --release --features "extra"

All command-line options

USAGE:
    rustic.exe [FLAGS] [OPTIONS]

FLAGS:
        --help        Prints help information
    -k, --kiwipete    Set up KiwiPete position (ignore --fen)
    -q, --quiet       No intermediate search stats updates
    -V, --version     Prints version information

OPTIONS:
    -c, --comm <comm>          Select communication protocol to use [default: uci]  [possible values: uci, xboard]
    -f, --fen <fen>            Set up the given position [default: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -
                               0 1]
    -h, --hash <hash>          Transposition Table size in MB [default: 32]
    -p, --perft <perft>        Run perft to the given depth [default: 0]
    -t, --threads <threads>    Number of CPU-threads to use [default: 1]

Please note that the -e (--epdtest) and -w (--wizardry) options are only available if the "extra" module is compiled into the engine.

Credits

More extensive credits can be found in "credits.md", or in Rustic's documentation.

Many people have assisted in one way or another, in the development of Rustic. They are listed below, in no particular order.

My girlfriend (for providing lots of support in more ways than she'd ever be able to realize), Richard Allbert, Terje Kirstihagen, Fabian von der Warth, H.G. Müller, Maksim Korzh, Rasmus Althoff, Martin Sedlák, Ronald de Man, Taimo, Sven Schüle, Thomas Jahn, Ed Schröder and Robert Hyatt (for still hanging around the chess programming community after 40 or 50 years).

All of these people (except my girlfiriend) can be found on the Talkchess.com forum.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].