Walleye is a chess engine written completely in rust.

Overview

Walleye

Walleye is a chess engine written completely in rust.

tests

Walleye is a UCI-compatible engine written using the classical alpha-beta style AI. It supports loading board positions from arbitrary FEN strings, Unicode pretty printing to the console, and UCI communication logs to help with debugging.

Originally this project was meant as a first introduction to rust and chess programming, but it got a bit carried away.

Example Usage

By default, the engine launches in UCI mode and expects to be loaded into a chess GUI. However, you can also run some commands from the terminal, such as -P to watch the engine play against itself.

demo

Type ./walleye --help for a complete list of commands.

Play Against It

The engine should be able to be loaded into any chess GUI that supports UCI, at this time though it has only been tested with Cute Chess. It is recommended you compile the engine with the --release option for the best performance.

Resources

Some resources I found helpful when creating this engine.

License

Walleye is under the MIT license.

Comments
  • Ideas

    Ideas

    Hi Mitchel,

    Nice job on the engine!

    Just starting to get familiar with the code. New to rust so it will take some time. So far it looks great!

    No specific issue. Is thier anything you need help on?

    On my initial review it does not appear that you support using any sort of opening book moves. I'm looking at another another github project that could act as a source to provide a set of opening book moves. See https://github.com/niklasf/chess-openings

    I have cloned and built Walleye.

    Cute chess does not seem to install as documented. But that issues will go to them.

    A few other ideas:

    • break out the fen functions from board
    • record moves
    • add AI to the engine
    question 
    opened by mcoolin 12
  • Losing most games on time

    Losing most games on time

    Hi Mitchel,

    Author of Rustic here :) ( https://github.com/mvanthoor/rustic )

    Your engine was mentioned on Talkchess.com, so I tried running a test against Rustic, version Alpha 1.1 (CCRL Blitz 1675). An often used time control for testing is 10s + 0.1s (so you can test 1000's of games without waiting a week). With this time control, WallEye 1.2.0 loses most games on time, often taking at least 5-6 seconds for the first move out of the opening book.

    Because the time controls don't yet work correctly, the engine is essentially un-testable.

    I hope you can spend some time fixing the time controls; I look forward to have another Rust engine in my testing pool.

    Kind regards, Marcel

    enhancement 
    opened by mvanthoor 11
  • no output in CuteChess (but plays ok)

    no output in CuteChess (but plays ok)

    while Walleye is calculating i see no pv line output in the CuteChess panel .. i have no troubles using Walleye on Linux, but it seems Walleye is simple ?

    enhancement 
    opened by tissatussa 9
  • Problems with running the engine

    Problems with running the engine

    For me it does not move at all under Arena. Under Cute Chess it does move but exceeds time soon. Both with traditional and Fischer clock.

    Here is a debug from Arena:

    2021-09-11 10:38:33,932-->1:quit 2021-09-11 10:38:34,3231-------------------Starting engine 1 Walleye 1.1.0 64-bit------------------- 2021-09-11 10:38:34,3231Configured Engine 1 Type: UCI 2021-09-11 10:38:34,3231Engine 1 dir: E:\Sakk\UCI-engines\Walleye 2021-09-11 10:38:34,3231Engine 1 commandline: E:\Sakk\UCI-engines\Walleye\Walleye_1.1.0-x64.exe 2021-09-11 10:38:34,4321Child Process Prio Adj: PID 1216 conhost.exe 2021-09-11 10:38:34,4321Engine 1 ProcessID: 7064 2021-09-11 10:38:34,4321Engine 1 Prio:32 ThreadPrio:0 2021-09-11 10:38:34,463-->1:uci 2021-09-11 10:38:34,463<--1:id name Walleye 2021-09-11 10:38:34,463<--1:id author Mitchel Paulin 2021-09-11 10:38:34,463<--1:uciok 2021-09-11 10:38:34,4631Child Process Prio Adj: PID 1216 conhost.exe 2021-09-11 10:38:34,463-->1:isready 2021-09-11 10:38:34,526<--1:readyok 2021-09-11 10:38:38,729**----------New game---2021-09-11 10:38:38,729 Szo ------------- 2021-09-11 10:38:38,729**Loading book: E:\Sakk\Arena2\Books\IM_4mvs.abk 2021-09-11 10:38:44,9621Start calc, move no: 1 2021-09-11 10:38:44,9621Main Book Move IM_4mvs.abk: c7c5 2021-09-11 10:38:45,9471Start calc, move no: 3 2021-09-11 10:38:45,947-->1:ucinewgame 2021-09-11 10:38:45,947-->1:isready 2021-09-11 10:38:50,056-->1:position startpos moves e2e4 c7c5 e4e5 2021-09-11 10:38:50,056-->1:go wtime 121484 btime 121000 winc 1000 binc 1000

    At this point I checked with Process Explorer and the engine was not even in memory.

    bug 
    opened by SzotsGabor 7
  • can not compile v1.4.0 on Linux

    can not compile v1.4.0 on Linux

    here is the terminal log :

    $ cargo build --release --verbose
           Fresh cfg-if v1.0.0
           Fresh lazy_static v1.4.0
           Fresh unicode-width v0.1.9
           Fresh bitflags v1.3.2
           Fresh vec_map v0.8.2
           Fresh ansi_term v0.11.0
           Fresh strsim v0.8.0
           Fresh textwrap v0.11.0
           Fresh libc v0.2.103
           Fresh log v0.4.14
           Fresh atty v0.2.14
           Fresh thread-id v3.3.0
           Fresh colored v2.0.0
           Fresh clap v2.33.3
           Fresh simple-logging v2.0.2
       Compiling walleye v1.4.0 (/home/tissatussa/Compiled/Walleye_v1.4.0)
         Running `rustc --crate-name walleye --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C codegen-units=1 -C metadata=c0314d45e350ab32 -C extra-filename=-c0314d45e350ab32 --out-dir /home/tissatussa/Compiled/Walleye_v1.4.0/target/release/deps -L dependency=/home/tissatussa/Compiled/Walleye_v1.4.0/target/release/deps --extern clap=/home/tissatussa/Compiled/Walleye_v1.4.0/target/release/deps/libclap-92b2ce1d83fefcb6.rlib --extern colored=/home/tissatussa/Compiled/Walleye_v1.4.0/target/release/deps/libcolored-af5d305c32b4ddbc.rlib --extern log=/home/tissatussa/Compiled/Walleye_v1.4.0/target/release/deps/liblog-f28a7c1eb8fddef7.rlib --extern simple_logging=/home/tissatussa/Compiled/Walleye_v1.4.0/target/release/deps/libsimple_logging-d9170c4c5c5a3ed5.rlib`
    error[E0277]: `[Option<(board::Point, board::Point)>; 100]` is not an iterator
       --> src/engine.rs:214:16
        |
    214 |     for mov in search_info.pv_moves {
        |                ^^^^^^^^^^^^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it
        |
        = help: the trait `Iterator` is not implemented for `[Option<(board::Point, board::Point)>; 100]`
        = note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
        = note: required because of the requirements on the impl of `IntoIterator` for `[Option<(board::Point, board::Point)>; 100]`
        = note: required by `into_iter`
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0277`.
    error: could not compile `walleye`
    
    Caused by:
      process didn't exit successfully: `rustc --crate-name walleye --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C codegen-units=1 -C metadata=c0314d45e350ab32 -C extra-filename=-c0314d45e350ab32 --out-dir /home/tissatussa/Compiled/Walleye_v1.4.0/target/release/deps -L dependency=/home/tissatussa/Compiled/Walleye_v1.4.0/target/release/deps --extern clap=/home/tissatussa/Compiled/Walleye_v1.4.0/target/release/deps/libclap-92b2ce1d83fefcb6.rlib --extern colored=/home/tissatussa/Compiled/Walleye_v1.4.0/target/release/deps/libcolored-af5d305c32b4ddbc.rlib --extern log=/home/tissatussa/Compiled/Walleye_v1.4.0/target/release/deps/liblog-f28a7c1eb8fddef7.rlib --extern simple_logging=/home/tissatussa/Compiled/Walleye_v1.4.0/target/release/deps/libsimple_logging-d9170c4c5c5a3ed5.rlib` (exit code: 1)
    
    bug 
    opened by tissatussa 4
  • [Question] What terminal do you use to produce

    [Question] What terminal do you use to produce

    Hey! I've started implementing a chess engine in Rust and I was looking at the others for debugging/interface infrastructure, so I found yours! I really liked how you print the board using colored: this looks really cool and I wanted to implement something similar to have easier time looking at the positions in the engine (right now I have basic ASCII printing a-la python-chess/shakmaty). My question is: what terminal/fonts do you use? Any advice to make the output look like the one on your demo? This is what I currently get from running Walleye in my terminal:

    Screenshot 2021-12-30 at 10 50 35 question 
    opened by kirillbobyrev 3
  • Walleye not running

    Walleye not running

    Heya! 😄

    I compile the app and ran it, but it gave no outputs (I think it should output some info and an readyok when you run it.

    I then passed through a isready command, and the application exited.

    It doesn't seem to comply with the UCI Protocol? Or is not functioning? Or I'm doing something wrong?

    Here's what I ran:

    image
    opened by chase-manning 1
  • 50 move rule does not seem to be implemented

    50 move rule does not seem to be implemented

    For the following command: 4k3/8/8/8/8/8/8/4K2R w - - 99 1 The engine should only play 1 move and then draw in accordance to the 50 move rule, but it keeps playing anyway. I've checked the code and it doesn't seem to have this rule implemented anywhere.

    enhancement 
    opened by Dopplerian 1
  • Drawing by 3-fold repitition in winning positions

    Drawing by 3-fold repitition in winning positions

    Right now the engine does not know about the draw by 3-fold repetition rule (or any rules about draws for that matter). This means the engine will happily repeat moves even if its in a winning position.

    Update the engine so, if the engine is in a winning position, it will not repeat moves.

    enhancement 
    opened by MitchelPaulin 1
  • Use types and structure for pieces and squares

    Use types and structure for pieces and squares

    This replaces the existing bitwise arithmetic with structures and many of the top-level board functions with type methods.

    There is no change to the chess logic here -- this is just a refactor.

    I won't be hurt if you don't want to merge this! The refactor was a nice way for me to understand the code, and IMHO makes it more "idiomatic".

    opened by djmitche 0
  • Walleye is not able to checkmate with king and rook and gets into a loop

    Walleye is not able to checkmate with king and rook and gets into a loop

    For the following input command: ./walleye -P -f '4k3/8/8/8/8/8/8/4K2R w - - 0 1' The engine is unable to checkmate and also gets into an infinite loop where the threefold repetition rule seems not to apply.

    enhancement 
    opened by Dopplerian 1
  • Bug when trying to checkmate

    Bug when trying to checkmate

    For the following input command: ./walleye -P -f '7k/4Q3/6K1/8/8/8/8/8 w - - 0 1' It first does a search to depth 99, which is unneeded since it is clearly a mate in 1, and then prints the same board over and over instead of terminating program execution.

    bug 
    opened by Dopplerian 1
Releases(1.6.0)
Owner
Mitchel Paulin
Mitchel Paulin
Pleco is a chess Engine & Library derived from Stockfish, written entirely in Rust

Pleco Pleco is a chess Engine & Library derived from Stockfish, written entirely in Rust. This project is split into two crates, pleco, which contains

Stephen Fleischman 225 Dec 18, 2022
A basic web assembly chess engine written in rust.

This library is a basic implementation of a chess min-max algorithm with alpha-beta pruning (Algorithm Info). It is designed to be compiled down to WebAssembly and used for web applications.

null 2 Nov 25, 2022
A Chess Engine written in Rust that runs natively and on the web!

About The Project chess-rs is a Chess Engine written from scratch in Rust that runs natively and on web! Live Demo: https://parthpant.github.io/chess-

Parth Pant 109 Apr 6, 2023
A Chess Engine written in Rust .

Kelp Kelp is a UCI compatible chess engine written in Rust Using standard chess algorithms. Kelp is work in progress. Currently, it can be used as a U

Gautam 5 Sep 3, 2023
A dependency-free chess engine library built to run anywhere.

♔chess-engine♚ A dependency-free chess engine library built to run anywhere. Demo | Docs | Contact Me Written in Rust ?? ?? Why write a Chess engine?

adam mcdaniel 355 Dec 26, 2022
Stockfish/ - UCI chess engine

Overview Stockfish is a free, powerful UCI chess engine derived from Glaurung 2.1. Stockfish is not a complete chess program and requires a UCI-compat

null 7.5k Jan 8, 2023
A rust chess implementation using a neural network scoring function built on huggingface/candle + rust + wasm

Rusty Chess What is it? Rusty Chess aims to be a high quality embeddable chess engine that runs entirely locally in the browser (no backend required).

Gareth 3 Nov 3, 2023
Yet another shape chess game in Rust.

shape_chesss_in_rust Yet another shape chess game in Rust. Why the implementation is so slow? The main reason is performance of Vector iteration is ve

Simon Lee 1 Apr 10, 2022
Chess implemented entirely in the Rust and TS type systems.

Type System Chess This repo contains chess implemented entirely in the (stable) Rust and Typescript type systems. Both languages feature turing comple

null 170 Jul 12, 2023
Opening randomizer for Chess

chess-randomizer chess-randomizer is a simple opening randomizer written in Rust using WASM and the Lichess API. To build the project, you need Rust a

null 1 Jan 31, 2022
Play jungle chess on the linux terminal.

Jungle-Chess This is my first project written in Rust. Happy for contributors and feedback! The code is dirty. Play Jungle Chess on an Emoji-Enabled L

Arne Winter 10 Aug 9, 2022
An (experimental) chess tactics trainer with spaced repetition

better-tactics A chess tactics trainer that with spaced repetition. New puzzles will be shown to you from the lichess puzzle db, according to your cal

Caitlin Wilks 6 Oct 6, 2023
Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.

vx_bevy A voxel engine prototype made using the Bevy game engine. Goals and features Very basic worldgen Animated chunk loading (ala cube world) Optim

Lucas Arriesse 125 Dec 31, 2022
A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music.

rustris A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music. (C) 2020 Ben Cantrick. This code is distri

Ben Cantrick 17 Aug 18, 2022
Rustcraft is a simple Minecraft engine written in rust using wgpu.

Rustcraft is a simple Minecraft engine written in rust using wgpu.

Raphael Van Hoffelen 110 Dec 22, 2022
A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

rg3d engine 5.4k Jan 4, 2023
A game of snake written in Rust using the Bevy game engine, targeting WebGL2

Snake using the Bevy Game Engine Prerequisites cargo install cargo-make Build and serve WASM version Set your local ip address in Makefile.toml (loca

Michael Dorst 0 Dec 26, 2021
My first Real-Time 3D Game Engine learning project written in Rust.

EyeEngine-Rust FOA, sry for my poor English. What is Eye Engine? Eye Engine is my first Real-Time 3D Game Engine learning project. There are two editi

F-seeeye 4 Jan 5, 2022
A simple Minecraft written in Rust with the Piston game engine

hematite A simple Minecraft written in Rust with the Piston game engine How To Open a World This method is only for personal use. Never distribute cop

PistonDevelopers 1.7k Dec 22, 2022