Blackmarlin is a chess engine fully written in Rust.

Overview

Blackmarlin

WIP UCI Chess Engine

Blackmarlin is a chess engine fully written in Rust.

Make sure to compile the chess engine with cargo build --release or run it with cargo run --release in order to get the maximum strength out of the engine. If build fails, remove the jem option and try again.

Blackmarlin doesn't come with a built-in GUI. The recommended way of playing against the engine is to compile it locally and use it along with a Chess GUI that supports the UCI protocol.

Blackmarlin also includes an optional Neural Network as a replacement for hand crafted evaluation. In order to enable this feature, add "nnue" to the feature flags: cargo build --release --features 'nnue'

Using the neural network results in much stronger play.

The repository used for NN training is NNUE Marlin

Comments
  • 2 problems

    2 problems

    Dear Doruk,

    When running the exe you provide it shows only two UCI options, Hash and Threads. How can I switch on/off the NNUE? Oh, just read that it can't be deactivated.

    And using your recommendation cargo build --release --features "nnue jem" I get the error message "none of the selected packages contains these features: jem".

    When trying to compile it simply with cargo build --release I get some warnings and also the error message "error[E0432]: unresolved import crate::bm::nnue --> src\bm\uci.rs:13:16"

    How shall I proceed?

    Gabor Szots member of the CCRL testing group

    opened by SzotsGabor 7
  • Compiling

    Compiling

    Using the recommended command line (cargo build --release --features 'nnue') I get this error message:

    error: none of the selected packages contains these features: 'nnue', did you mean: nnue?

    I can successfully compile it with the simple cargo build --release but I am not sure the NNUE is included in the exe. Also, I get many warnings (mostly about unused variables).

    opened by SzotsGabor 3
  • compiling v6.0 fails on Linux

    compiling v6.0 fails on Linux

    normally i'm able to compile rust code, but your source gives me errors :

    $ make
    EVALFILE=./nn/default.bin cargo +stable rustc --release -- -C target-cpu=native --emit link=BlackMarlin
       Compiling cozy-chess-types v0.1.4
       Compiling blackmarlin v0.1.0 (/home/roelof/Compiled/blackmarlin)
       Compiling text_io v0.1.10
       Compiling arrayvec v0.7.2
       Compiling cozy-chess v0.2.2
    error: values of the type `[[i16; 544108393]; 1936876918]` are too big for the current architecture
    
    error: could not compile `blackmarlin` due to previous error
    make: *** [makefile:11: rule] Error 101
    

    NOTE: your asset v3 works for me! (v4 didn't, the others i didn't try .. eg. which asset binary is avx2?)

    I'm on Xubuntu 21.10

    opened by tissatussa 2
  • compile warning on Linux and versioning

    compile warning on Linux and versioning

    hi,

    i see that you update the main code regularly .. compiling it on Linux succeeds, but i get this warning :

    ~/Compiled/blackmarlin$ make
    EVALFILE=./nn/default.bin cargo rustc --release -- -C target-cpu=native --emit link=BlackMarlin
       Compiling cozy-chess-types v0.1.4
       Compiling blackmarlin v0.1.0 (/home/roelof/Compiled/blackmarlin)
       Compiling arrayvec v0.7.2
       Compiling text_io v0.1.10
       Compiling cozy-chess v0.2.2
    warning: unused import: `crate::bm::bm_util::h_table`
     --> src/bm/bm_search/search.rs:8:5
      |
    8 | use crate::bm::bm_util::h_table;
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = note: `#[warn(unused_imports)]` on by default
    
    warning: `blackmarlin` (bin "blackmarlin") generated 1 warning
        Finished release [optimized] target(s) in 25.14s
    

    the compiled binary is 28.8 Mb and shows v6.0 .. all other recent versions also show v6.0 .. it seems you don't use a development version, you just update "main" .. could it be handy to sub-version your next releases ? Eg. v6.0.1 etc.

    [ i'm on Xubuntu 22.04 ]

    opened by tissatussa 1
  • Bump regex from 1.5.4 to 1.5.5

    Bump regex from 1.5.4 to 1.5.5

    ⚠️ Dependabot is rebasing this PR ⚠️

    Rebasing might not happen immediately, so don't worry if this takes some time.

    Note: if you make any changes to this PR yourself, they will take precedence over the rebase.


    Bumps regex from 1.5.4 to 1.5.5.

    Changelog

    Sourced from regex's changelog.

    1.5.5 (2022-03-08)

    This releases fixes a security bug in the regex compiler. This bug permits a vector for a denial-of-service attack in cases where the regex being compiled is untrusted. There are no known problems where the regex is itself trusted, including in cases of untrusted haystacks.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Build fails on windows

    Build fails on windows

    Hello

    I just git cloned the repo and then tried running the command in the readme: cargo build --release --features nnue. Doing this I get the error:

    error: none of the selected packages contains these features: nnue
    

    So seeing instead I tried running without the flag, i.e. just cargo build --release but then I get the error:

    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', build.rs:8:39
    

    So it looks like there is no network file, and that's what is going wrong.

    opened by WannesMalfait 1
  • embedded NN with v5.0 ?

    embedded NN with v5.0 ?

    i succesfully compiled your source on Linux .. i used git clone to get the source files and after compiling the UCI info states v5.0 ?! The file is 4.5 Mb -- what about the NN ? Normally i see NNUE files of 20 Mb ..

    opened by tissatussa 1
  • Compilation of 3.0 dev (r446) warning(s)

    Compilation of 3.0 dev (r446) warning(s)

    While compiling 3.0dev a few times the last week recently it has this warning which looks a bit worrying? (the other warnings are there since always AFAIK - mosty about unused imports/macros/variables)

    The binary itself compiles fine.

    warning: unreachable statement
       --> src\bm\bm_eval\evaluator.rs:384:9
        |
    377 |               return Evaluation::new(self.nnue.feed_forward(board, 0) * turn + NNUE_TEMPO);
        |               ---------------------------------------------------------------------------- any code following this expression is unreachable
    ...
    384 | /         let eval = self.evaluate_psqt(board, Piece::Pawn)
    385 | |             + self.evaluate_psqt(board, Piece::Knight)
    386 | |             + self.evaluate_psqt(board, Piece::Bishop)
    387 | |             + self.evaluate_psqt(board, Piece::Rook)
    ...   |
    391 | |             + self.evaluate_bishops(board)
    392 | |             + self.evaluate_threats(board);
        | |___________________________________________^ unreachable statement
        |
        = note: `#[warn(unreachable_code)]` on by default
    
    opened by rwbc 1
  • Compiling error for old hardware

    Compiling error for old hardware

    Hi Doruk,

    I tried compiling the current BlackMarlin version and I get an error which still wasn't there at least in mid February. BTW thanks for still releasing no popcnt binaries. I just want to test sometimes if I can get some nps more with my ssse3 or sse4.1 native instructions w/o popcount, or creating dev versions for me.

    Is there a way to avoid that error?

    Guenther

    Guenther Simon@CAPPUCCINO MINGW64 ~/blackmarlin
    $ make
    EVALFILE=./nn/default.bin cargo rustc --release -- -C target-cpu=native --emit link=BlackMarlin.exe
       Compiling cozy-chess-types v0.1.4
       Compiling blackmarlin v0.1.0 (C:\msys64\home\Guenther Simon\blackmarlin)
       Compiling arrayvec v0.7.1
       Compiling text_io v0.1.9
       Compiling cozy-chess v0.2.1
    error: values of the type `[[i16; 544108393]; 1936876918]` are too big for the current architecture
    
    error: could not compile `blackmarlin` due to previous error
    make: *** [makefile:11: rule] Error 101
    
    opened by rwbc 10
Releases(7.0)
Owner
null
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
A simple space shooter game. Runs in the terminal using characters-based UI. Fully written in Rust, using the "ruscii" library.

Thrust - a terminal shooter game Originally created as a project for the "Missing Semester" course at JKU Linz (338.006). The game is entirely written

Mathias Wöß 3 Jan 16, 2023
A simple implementation of Conway's Game of Life using Fully homomorphic Encryption

Game of life using Fully homomorphic encryption A simple implementation of Conway's Game of Life built using Zama's concrete-boolean library. Build Ju

Florent Michel 4 Oct 3, 2022
Safe, fully-featured bindings to the Tracy profiler

Complete Rust bindings for the Tracy profiler. Getting Started Just add the following to your Cargo.toml: [dependencies.tracy] package = "tracy_full"

Shaye Garg 12 May 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