Giter VIP home page Giter VIP logo

avalanche's Introduction

Avalanche


Logo


Avalanche is the first and strongest UCI Chess Engine written in Zig

Strength

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

Official Blitz CCRL ELO (v2.1.0): 3399

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.

This is my second attempt at computer chess, after dropping development of my MiniShogi (五将棋) engine.

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 -Drelease-fast

Avalanche is only guaranteed to compile using Zig v0.10.x. Newer versions will not work as Avalanche still uses Stage1.

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

avalanche's People

Contributors

deecellar avatar snowballsh 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  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

avalanche's Issues

Avalanche v1.4.0 connection stalls

playing in CuteChess (v1.3.0-beta4) GUI the newest compiled Avalanche v1.4.0 has an error :

avalanche-v1 4 0-connection-stalls

here's the log file :
CuteChess-GUI-log.zip

White just played Qh8+ and Black has only one move, but its connection stalled .. the last move 24.Qh8+ isn't even displayed by CuteChess !?

[ i'm on Xubuntu 22.04 ]

can't compile on Linux

i get this error :

$ zig build -Drelease-fast 
/home/roelof/Compiled/Avalanche/build.zig:108:9: error: no field named 'use_stage1' in struct 'build.LibExeObjStep'
    exe.use_stage1 = true;
        ^~~~~~~~~~
/snap/zig/6170/lib/std/build/LibExeObjStep.zig:1:1: note: struct declared here
const builtin = @import("builtin");
^~~~~
referenced by:
    runBuild: /snap/zig/6170/lib/build_runner.zig:228:22
    usage__anon_5102: /snap/zig/6170/lib/build_runner.zig:238:13
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

is it easy to fix ?
i'm not familiar woth Zig ..

[ using Xubuntu 22.04 ]

Avalanche v1.4.0 connection stalls

playing in CuteChess (v1.3.0-beta4) GUI the newest compiled Avalanche v1.4.0 has an error :

avalanche-v1 4 0-connection-stalls

here's the log file : CuteChess-GUI-log.zip

White just played Qh8+ and Black has only one move, but its connection stalled .. the last move 24.Qh8+ isn't even displayed by CuteChess !?

[ i'm on Xubuntu 22.04 ]

It can't mate with K+R against the lone king.

Here is a game from my ongoing tournament:

[Event "Avalanche 0.2 64-bit - Apr 10"]
[Site "Szentendre"]
[Date "2022.04.11"]
[Round "14"]
[White "Anka 0.6.0 64-bit"]
[Black "Avalanche 0.2 64-bit"]
[Result "1/2-1/2"]
[ECO "A10"]
[Opening "English"]
[Time "11:47:51"]
[Variation "1...g6 2.g3"]
[TimeControl "120+1"]
[PlyCount "262"]

  1. c4 g6 2. g3 Bg7 3. Bg2 e6 4. e3 d5 5. d4 {+0.04/19 4} Nf6 {-0.21/13 4}
  2. Nf3 {+0.15/19 3} c5 {-0.22/12 4} 7. cxd5 {+0.10/15 4} exd5 {+0.03/12 4}
  3. O-O {-0.09/17 2} O-O {+0.07/12 3} 9. Re1 {-0.07/16 2} Ne4 {+0.10/12 3}
  4. Nc3 {-0.11/18 3} Nc6 {+0.13/13 4} 11. Nd2 {-0.07/19 3} cxd4 {+0.05/12
    3} 12. Ndxe4 {-0.04/18 2} dxe4 {+0.27/12 3} 13. exd4 {+0.02/18 2} Qxd4
    {+0.15/13 3} 14. Qxd4 {+0.14/18 2} Nxd4 {+0.38/13 6} 15. Bxe4 {-0.14/17 1}
    Bf5 {+0.30/14 5} 16. Bf4 {-0.09/19 3} Bxe4 {+0.30/13 5} 17. Rxe4 {-0.07/19
    2} b5 {+0.28/13 4} 18. Kg2 {+0.04/19 2} Rfd8 {+0.15/14 4} 19. a3 {-0.10/17
    3} a6 {+0.43/12 4} 20. Bg5 {-0.02/16 2} f6 {+0.13/13 4} 21. Bf4 {-0.13/20
    3} Kf7 {+0.41/13 4} 22. Bc7 {-0.15/19 3} Rd7 {+0.56/14 4} 23. Bb6 {-0.21/21
    3} f5 {+0.65/14 4} 24. Rh4 {-0.08/21 3} Nb3 {+0.42/13 3} 25. Re1 {0.00/18
    2} h5 {+0.50/13 3} 26. a4 {-0.38/17 1} Rb8 {+1.16/14 3} 27. a5 {-0.86/16 1}
    Rc8 {+1.29/14 3} 28. Na2 {-0.89/19 3} Bf6 {+1.18/12 3} 29. Rb4 {-0.84/21 2}
    Nd2 {+1.15/13 3} 30. Rd1 {-0.62/18 1} Rc6 {+1.14/13 3} 31. Be3 {-0.53/19 2}
    Rc2 {+0.82/15 2} 32. Rb3 {-0.44/23 2} Be7 {+0.59/15 2} 33. Nb4 {-0.26/23 2}
    Bxb4 {+0.56/15 2} 34. Rxb4 {-0.17/23 2} Kf6 {+0.53/13 2} 35. Rd4 {+0.07/23
    2} Rxd4 {+0.77/13 2} 36. Bxd4+ {+0.08/22 2} Ke6 {+0.67/12 2} 37. b4
    {+0.10/22 2} g5 {+0.65/13 2} 38. Be3 {+0.08/22 1} Ne4 {+0.04/14 2} 39. Rd8
    {+0.13/23 2} f4 {+0.04/14 2} 40. Bb6 {+0.13/21 2} Nd2 {+0.20/12 2} 41. gxf4
    {+0.81/21 1} gxf4 {-0.19/12 2} 42. Ra8 {+0.63/21 1} Kd5 {-0.51/12 2} 43.
    Rxa6 {+0.94/20 2} Kc4 {-0.71/12 2} 44. Bc5 {+1.11/20 2} f3+ {-0.22/12 1}
  5. Kg3 {+0.71/24 1} Ne4+ {-0.26/14 2} 46. Kxf3 {+0.66/24 1} Nxc5 {-0.44/13
    1} 47. bxc5 {+0.68/23 2} b4 {-0.26/11 1} 48. Ra8 {+1.03/19 2} Kb3 {-0.74/11
    1} 49. a6 {+1.21/17 2} Rxc5 {-0.47/12 1} 50. Kf4 {+1.10/18 2} Ra5 {+0.48/12
    1} 51. Ke3 {+0.53/17 1} Ka2 {+1.84/13 1} 52. Rc8 {-1.06/14 1} b3 {+2.50/12
    1} 53. Rb8 {-4.41/15 1} b2 {+2.39/12 1} 54. f4 {-4.38/23 2} b1=Q {+2.60/13
    1} 55. Rxb1 {-4.41/22 2} Kxb1 {+2.38/13 1} 56. h4 {-4.44/22 1} Kc1
    {+2.79/11 1} 57. Ke4 {-4.20/21 2} Rxa6 {+2.40/13 1} 58. Kf5 {-4.15/25 1}
    Kd2 {+2.81/13 1} 59. Kg5 {-4.24/24 1} Kd3 {+3.00/13 1} 60. Kxh5 {-3.80/24
    1} Ke4 {+2.87/13 1} 61. Kg5 {-3.78/24 1} Ra5+ {+2.28/12 1} 62. Kg4
    {-5.26/24 1} Ra8 {+2.23/12 1} 63. Kg5 {-5.49/22 1} Kd5 {+2.33/12 1} 64. h5
    {-5.72/23 1} Ke6 {+2.86/12 1} 65. h6 {-5.85/24 1} Kf7 {+2.93/11 1} 66. Kf5
    {-5.93/20 1} Ra5+ {+3.27/11 1} 67. Kg4 {-6.03/22 1} Kg6 {+3.29/12 1} 68.
    Kf3 {-6.15/23 1} Kxh6 {+3.65/10 1} 69. Ke4 {-6.43/21 1} Kg6 {+3.81/10 1}
  6. Kd4 {-6.68/23 1} Kf5 {+3.92/10 1} 71. Ke3 {-6.65/21 1} Ra4 {+3.93/10 1}
  7. Ke2 {-6.68/21 1} Ra2+ {+3.83/10 1} 73. Ke3 {-6.59/22 1} Ra3+ {+3.91/10
    1} 74. Kd4 {-6.59/22 1} Rg3 {+3.83/11 1} 75. Kc4 {-6.59/22 1} Re3 {+3.83/10
    1} 76. Kd5 {-6.59/21 1} Rb3 {+3.79/10 1} 77. Kc4 {-6.59/22 1} Rg3 {+3.85/10
    1} 78. Kd5 {-6.59/22 1} Rc3 {+3.84/10 1} 79. Kd4 {-6.59/22 1} Rh3 {+3.73/10
    1} 80. Kc4 {-6.59/22 1} Rf3 {+3.73/10 1} 81. Kb5 {-6.57/20 1} Rc3 {+3.91/10
    1} 82. Kb6 {-6.59/22 1} Kxf4 {+3.83/10 1} 83. Kb5 {-6.59/22 1} Kg3
    {+3.81/11 1} 84. Kb4 {-6.59/22 1} Rc2 {+3.77/11 1} 85. Kb3 {-6.60/23 1} Rc5
    {+3.73/11 1} 86. Kb4 {-6.60/23 1} Rd5 {+3.66/10 1} 87. Kc3 {-6.60/21 1} Rf5
    {+3.62/10 1} 88. Kc4 {-6.56/22 1} Rf3 {+3.73/9 1} 89. Kd5 {-6.55/20 1} Rf4
    {+3.80/10 1} 90. Ke5 {-6.56/21 1} Rb4 {+3.84/11 1} 91. Kf5 {-6.56/21 1} Kh3
    {+3.88/10 1} 92. Kg5 {-6.56/21 1} Ra4 {+3.82/11 1} 93. Kf5 {-6.56/22 1} Rd4
    {+3.83/10 1} 94. Kf6 {-6.55/22 1} Rd5 {+3.96/11 1} 95. Ke7 {-6.55/23 1} Kg4
    {+4.02/10 1} 96. Ke6 {-6.56/22 1} Rf5 {+4.07/10 1} 97. Kd7 {-6.57/22 1} Rf6
    {+3.97/10 1} 98. Ke7 {-6.64/21 1} Rg6 {+4.04/10 1} 99. Kf7 {-6.48/22 1} Rg5
    {+3.95/10 1} 100. Kf6 {-6.56/21 1} Rf5+ {+4.06/10 1} 101. Ke6 {-6.56/22 1}
    Ra5 {+4.00/10 1} 102. Kd6 {-6.57/21 1} Kf3 {+3.95/10 1} 103. Kc6 {-6.58/22
    1} Re5 {+3.96/10 1} 104. Kb6 {-6.54/20 0} Rg5 {+3.98/10 0} 105. Kc6
    {-6.57/21 0} Kg3 {+3.97/10 0} 106. Kb6 {-6.53/21 1} Rf5 {+3.94/9 1} 107.
    Kc6 {-6.64/21 1} Kf4 {+3.88/10 1} 108. Kd6 {-6.59/22 1} Rh5 {+3.95/10 1}
  8. Kc6 {-6.59/21 1} Kg4 {+3.95/10 1} 110. Kd7 {-6.56/21 0} Rb5 {+3.99/10
    1} 111. Kc6 {-6.57/22 1} Rg5 {+3.93/11 1} 112. Kb6 {-6.60/21 1} Kg3
    {+3.94/10 1} 113. Kc7 {-6.48/20 0} Rg6 {+3.98/10 0} 114. Kd7 {-6.55/21 1}
    Rf6 {+4.00/10 1} 115. Ke7 {-6.49/21 0} Rb6 {+3.96/11 1} 116. Kf7 {-6.59/22
    1} Kg4 {+3.95/10 1} 117. Ke7 {-6.55/20 1} Kf5 {+3.94/10 0} 118. Kd7
    {-6.47/20 0} Ke5 {+3.96/10 1} 119. Kc7 {-M8/26 1} Rd6 {+3.97/10 1} 120. Kb7
    {-M7/30 1} Rf6 {+3.99/10 1} 121. Kc7 {-M8/30 1} Kf4 {+3.98/10 1} 122. Kd7
    {-6.49/21 1} Kf3 {+4.04/10 1} 123. Ke7 {-6.44/19 1} Ra6 {+3.97/10 1} 124.
    Kf7 {0.00/18 0} Rc6 {+3.97/10 1} 125. Ke7 {0.00/35 1} Kg3 {+3.96/10 1} 126.
    Kd7 {0.00/61 1} Ra6 {+3.96/10 0} 127. Ke7 {0.00/71 1} Kh3 {+3.98/10 1} 128.
    Kd7 {0.00/80 1} Rf6 {+3.97/10 1} 129. Ke8 {0.00/92 1} Kh2 {0.00/16 1} 130.
    Ke7 {0.00/105 2} Rg6 {0.00/120 2} 131. Kf7 {0.00/128 2} Rg4 {0.00/61 1
    Arena Adjudication} 1/2-1/2

Avalanche v1.4.0 connection stalls

playing in CuteChess (v1.3.0-beta4) GUI the newest compiled Avalanche v1.4.0 has an error :

avalanche-v1 4 0-connection-stalls

White just played Qh8+ and Black has only one move, but its connection stalled .. the last move 24.Qh8+ isn't even displayed by CuteChess !?

[ i'm on Xubuntu 22.04 ]

Avalanche v1.4.0 connection stalls

playing in CuteChess (v1.3.0-beta4) GUI the newest compiled Avalanche v1.4.0 has an error :

avalanche-v1 4 0-connection-stalls

here's the log file : CuteChess-GUI-log.zip

White just played Qh8+ and Black has only one move, but its connection stalled .. the last move 24.Qh8+ isn't even displayed by CuteChess !?

[ i'm on Xubuntu 22.04 ]

v1.0.0 Two Knights Endgame

Currently NNK vs K is hardcoded as drawn, because although the K side can make a one-move blunder to get into mate, a depth-2 search is probably enough to avoid the blunder, there might be a better solution for it.

Responding to isready during a search

Hi, I'm using your engine as my regular sparring partner for Inanis - I really like it! One thing I've found: sometimes cutechess-cli prints a warning that Avalanche (1.1.0, latest version) is not responding to a ping, which is apparently because it doesn't respond "pong" when receiving "isready" command during a search. According to http://wbec-ridderkerk.nl/html/UCIProtocol.html:

  • isready
    this is used to synchronize the engine with the GUI. When the GUI has sent a command or
    multiple commands that can take some time to complete,
    this command can be used to wait for the engine to be ready again or
    to ping the engine to find out if it is still alive.
    E.g. this should be sent after setting the path to the tablebases as this can take some time.
    This command is also required once before the engine is asked to do any search
    to wait for the engine to finish initializing.
    This command must always be answered with "readyok" and can be sent also when the engine is calculating
    in which case the engine should also immediately answer with "readyok" without stopping the search.

That's almost exactly the same issue I had last time, it's very easy to omit by accident.

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.