Coder Social home page Coder Social logo

heiaha / weiawaga Goto Github PK

View Code? Open in Web Editor NEW
40.0 5.0 0.0 3.62 MB

A UCI chess engine written in Rust.

License: GNU General Public License v2.0

Rust 100.00%
chess-engine chess uci chess-ai uci-chess-engine alpha-beta-pruning rust negamax nnue ai

weiawaga's People

Contributors

heiaha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

weiawaga's Issues

faulty Hash option

i just compiled the newest source code into a valid Linux binary and it works in CuteChess.

however, in the CuteChess settings i see that the Hash value can not be set, it can only be reset to its default value (512 Mb).
it seems you did not properly define the Hash option :

UciOptionMap({'Hash': Option(name='Hash', type='spin', default=512, min=None, max=None, var=[])})

'min' and 'max' are None, which gives this error : the up / down counter form element does not work .. please correct this.

small NNUE weight ?

hi, congratulations with the new NNUE version 4.0.0 ! I successfully compiled it and its file size is 2.1 Mb .. your previous version (without NNUE and without any version number) was 1.9 Mb, so the NNUE weight file is rather small .. not 20 Mb like most NNUE i find !?

i see no UCI option to disable the NNUE evaluation .. does the strength of Weiawaga fully depend on NN now ?

Open to contributions?

Hi,

I was wondering if you were open to contributions or preferred to keep Weiawaga as a 100% personal project? There are a few areas for which I think I could propose small PRs that could be valuable. For example:

  • General Rusty improvements, I understand Weiawaga was ported from Java and that must have been quite the task. A few examples could be getting rid of all the #[inline(always)] (LLVM will always inline within a crate, and quite often outside) or the unsafes (if you're willing to accept a dependency, lazy_static could work).
  • Performance. While move generation seems quite good, there's likely more to squeeze. In particular those for loops in the NNUE implementation could, I think, benefit from auto-vectorization by using iterators. It would allow LLVM to do its thing and generate SIMD code without making the code any uglier.
  • Chess strength. I didn't notice the use of any tablebases and that could help the endgame quite a bit. I noticed Weiawaga had relatively few draws when competing against other engines.

Either way, congratulations on Weiawaga! You did an awesome job implementing quite a few state-of-art chess engine features while keeping the code clean and concise.

small NNUE weight in v5.0.0 ?

[ this issue is related to issue #5 ]

I successfully compiled your new v5.0.0 !
In issue #5 you wrote that v4.0.0 was not a NNUE version .. but v5.0.0 is, so i wonder why my compiled binary is only 2.1 Mb, just like v4.0.0 .. the new v5.0.0 runs fine in CuteChess though.

NOTES :
I compiled (on Linux, Xubuntu 21.10) by cargo build --release , because i think that's the default method for Rust code .. you could mention this in the README. I often view such readme.md file in Okular, but then it does not display properly : the HTML-like codes are visible as-is .. to solve this, i discovered such readme.md file should have an empty first line !? (or is Okular buggy? I wonder..)

compilation failed - on Linux

i tried this, but i get an error :

$ cargo build --release
    Updating crates.io index
   Compiling libc v0.2.109
   Compiling cfg-if v1.0.0
   Compiling ppv-lite86 v0.2.15
   Compiling getrandom v0.2.3
   Compiling rand_core v0.6.3
   Compiling rand_chacha v0.3.1
   Compiling rand v0.8.4
   Compiling Weiawaga v3.0.0 (/home/tissatussa/Compiled/Weiawaga)
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:1:1
  |
1 | #![feature(step_trait)]
  | ^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:2:1
  |
2 | #![feature(destructuring_assignment)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::evaluation::score::*`
 --> src/evaluation/e_constants.rs:2:5
  |
2 | use crate::evaluation::score::*;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `std::mem`
 --> src/texel/tuner.rs:3:5
  |
3 | use std::mem;
  |     ^^^^^^^^

warning: unused import: `crate::types::move_list::MoveList`
  --> src/texel/tuner.rs:10:5
   |
10 | use crate::types::move_list::MoveList;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `File`
 --> src/texel/parameter.rs:1:15
  |
1 | use std::fs::{File, OpenOptions};
  |               ^^^^

warning: unused imports: `BufReader`, `BufWriter`
 --> src/texel/parameter.rs:2:15
  |
2 | use std::io::{BufReader, BufWriter, Write};
  |               ^^^^^^^^^  ^^^^^^^^^

warning: unused import: `crate::texel::tuner::Tuner`
  --> src/main.rs:15:5
   |
15 | use crate::texel::tuner::Tuner;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0554`.
warning: `Weiawaga` (bin "Weiawaga") generated 6 warnings
error: could not compile `Weiawaga` due to 2 previous errors; 6 warnings emitted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.