Skip to content

SnowballSH/Avalanche

Repository files navigation

Avalanche


Avalanche_3_0_0_1200x600


Avalanche is a strong UCI chess engine written in Zig.

June 2026 update: Avalanche now builds with Zig 0.16.0.

Strength

Latest (3.1.0 dev): estimated 3500

Official 40/15 CCRL ELO (v3.0.0): 3384

Official Blitz CCRL ELO (v3.0.0): 3420

Version 2.1.0 participated in TCEC Swiss 6.

About

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

Avalanche was one of the earliest adopters of the 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 Zig code I've ever written. Thank you!

License

MIT License.

Compile

zig build --release=fast

Avalanche now builds with Zig 0.16.0.

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

Older Zig 0.10.x is no longer required.

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

Neural Networks

All Neural Networks used by Avalanche are trained through self-play. There have been several generations of reinforcement learning, listed below by codenames:

  • Huangpujiang 黄浦江
    • 768x16 -> 1024 -> 8
    • Dual-perspective, mirrored input buckets basedon king position
    • First net with input buckets
    • Trained from scratch on the same 2 billion positions from Qinyuanchun
  • Molihua 茉莉花
    • 768 -> 1024x2 -> 8
    • Final iteration of "flat" net
    • Fine-tuned Qinyuanchun on 2 billion positions from Qinyuanchun
  • Qinyuanchun 沁园春
    • 768 -> 1024x2 -> 8
    • Trained from scratch on 2 billion positions from Shuang
  • Shuang 霜
    • 768 -> 768x2 -> 8
    • Trained from scratch on 1.3 billion positions from Jihan
  • Jihan 极寒
    • 768 -> 512x2 -> 8
    • Trained from scratch on 1 billion positions from Bingshan
  • Bingshan 冰山
    • 768 -> 512x2 -> 8
    • First net with output buckets
    • Trained from scratch on Xuebeng data
  • Xuebeng 雪崩
    • 768 -> 512x2 -> 1
    • Trained on 512 million positions from earlier nets
  • net008b, net007b
    • Basic attempts of RL on base net
  • base
    • 768 -> 128x2 -> 1
    • Trained on HCE labeling of a few thousands of TCEC games

Alternative Square Logos

Logo 2 Logo 3 Logo 4

About

UCI Chess Engine written in Zig.

Topics

Resources

License

Stars

109 stars

Watchers

2 watching

Forks

Packages

 
 
 

Contributors