#chess-engine #chess #move-generation #engine #gui #library #performance-testing

bin+lib chess-oxide

A chess engine library written in Rust, with a GUI bin to play against it

7 releases

0.3.2 Nov 1, 2024
0.3.1 Nov 1, 2024
0.2.3 Aug 21, 2024
0.1.0 Jan 7, 2023

#206 in Game dev

Download history 154/week @ 2024-08-19 2/week @ 2024-09-02 9/week @ 2024-09-23 3/week @ 2024-10-07 9/week @ 2024-10-14 227/week @ 2024-10-28 47/week @ 2024-11-04 3/week @ 2024-11-18 113/week @ 2024-12-02

119 downloads per month
Used in perft

MPL-2.0 and GPL-3.0-only…

1.5MB
7.5K SLoC

Rust 6K SLoC // 0.1% comments Slint 1K SLoC // 0.0% comments

Chess Oxide

A chess engine written in Rust.

Features

  • Move Generation: Efficient move generation for all pieces using a mailbox system.
  • Position Representation: Uses a 64-square array for position representation.
  • Board Representation: Data and functions required to run a chess game.
  • Zobrist Hashing: Implements Zobrist hashing for fast position comparison.
  • Perft Testing: Performance testing for move generation.
  • Error Handling: Error handling for user facing functions.
  • GUI Integration: Basic GUI for visualizing the board and moves using Slint.
  • FEN/PGN Implementations: Implementation of FEN and PGN standards for import/export of board states.
  • Engine: Implemented using a negamax algorithm implementing alpha/beta pruning.
  • Transposition Table: Implementation of a Transposition Table to use with engine.
  • Engine Debug Feature: Enabling 'debug_engine_logging' feature gives detailed breakdown of the nodes searched in engine.
  • Logging: Library uses 'log' crate and frontends use 'env_logger'.

Installation

To build and run the project, ensure you have Rust installed. Clone the repository and run:

cargo build [--bin] [--release]

Usage

To run the chess engine with the GUI:

cargo run --bin chess-gui [--release]

To run the basic performance test:

cargo run --bin chess-perft [--release]

Example using environment variable RUST_LOG for env_logger configuration:

RUST_LOG=debug cargo run --bin chess-gui --release

License

This project is licensed under the MPL-2.0 License.

Dependencies

~14–27MB
~413K SLoC