Skip to content

SnowballSH/Avalanche

Repository files navigation

Avalanche


Logo


NOTE: Avalanche is currently being migrated to Zig 0.16.0, after four years of hiatus.

Avalanche is the first UCI Chess Engine written in Zig.

Strength

Official 40/15 CCRL ELO (v2.1.0): 3346

Official Blitz CCRL ELO (v2.1.0): 3400

Version 2.1.0 participated in TCEC Swiss 6.

About

Avalanche is the first and strongest chess engine written in the Zig programming language, proving Zig's ability to succeed in real-world, competitive applications.

Avalanche v1.4.0 was the sole winner of the 102nd CCRL Amateur Series Tournament (Division 5), having a score of 29.5/44. See Tournament Page.

Avalanche uses the new NNUE (Efficiently Updatable Neural Network) technology for its evaluation.

This project isn't possible without the help of the Zig community, since this is the first and only Zig code I've ever written. Thank you!

License

Good Old MIT License. In short, feel free to use this program anywhere, but please credit this repository somewhere in your project :)

Compile

zig build --release=fast

Avalanche now builds with Zig 0.16.0. The engine was ported from the original Zig 0.10.x / Stage1 codebase to the modern compiler and standard library; the ported build is functionally identical to the 0.10.x version (the fixed benchmark produces the exact same node count) and is roughly 25% faster thanks to explicit SIMD in the NNUE evaluation. See MIGRATION.md for the full set of breaking changes, the performance work, and the verification data.

zig build --release=fast      # optimized build -> zig-out/bin/Avalanche
zig build                     # debug build
zig build test                # unit tests
./zig-out/bin/Avalanche bench # fixed-position benchmark -> "33745282 nodes <nps> nps"

Older Zig 0.10.x is no longer required (but a pinned 0.10.1 toolchain is kept in zig-macos-aarch64-0.10.1/ for reference benchmarking).

Avalanche also has a lichess account (though not often played): https://lichess.org/@/IceBurnEngine

Usage

Avalanche follows the UCI protocol and is not a full chess application. You should use Avalanche with a UCI-compatible GUI interface. If you need to use the CLI, make sure to send \n at the end of your input (^\n on windows command prompt).

Past Versions

Credits

Originality Status

  • General
    • This is the first released chess engine written in the Zig Programming Language. Although there are Zig libraries for chess, Avalanche is completely stand-alone and does not use any external libraries.
  • Move Generator
    • Algorithm is inspired by Surge, but code is 100% hand-written in Zig.
  • Search
    • Avalanche has a simple Search written 100% by myself, but is probably a subset of many other engines. Some ideas are borrowed from other chess engines as in comments. However many ideas and parameters are tuned manually and automatically using my own scripts.
  • Evaluation
  • UCI Interface/Communication code
    • 100% original

Alternative Square Logos

Logo 2 Logo 3 Logo 4

About

UCI Chess Engine written in Zig.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages