#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

#259 in Game dev

Download history 8/week @ 2024-10-12 2/week @ 2024-10-19 140/week @ 2024-10-26 131/week @ 2024-11-02 3/week @ 2024-11-09 3/week @ 2024-11-16 71/week @ 2024-11-30 177/week @ 2024-12-07 54/week @ 2024-12-14 17/week @ 2024-12-21 22/week @ 2024-12-28 41/week @ 2025-01-04 17/week @ 2025-01-11

63 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–28MB
~434K SLoC