Giter VIP home page Giter VIP logo

queensgambit / crazyara Goto Github PK

View Code? Open in Web Editor NEW
230.0 19.0 41.0 62.6 MB

A Deep Learning UCI-Chess Variant Engine written in C++ & Python :parrot:

Home Page: https://lichess.org/@/CrazyAra

License: GNU General Public License v3.0

Python 48.05% Jupyter Notebook 51.92% Shell 0.04%
python crazyhouse chess-engine deep-learning artificial-intelligence convolutional-neural-network mcts alphazero mxnet gluon

crazyara's People

Contributors

atlanticbot avatar bingobongomann avatar bluemlj avatar chooga avatar codacy-badger avatar magehrke avatar matuiss2 avatar mlanher avatar noelben avatar queensgambit avatar rainrat 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crazyara's Issues

CrazyAra not finding engine file

Good morning,

I was trying to set up CrazyAra (0.8) in the latest Cuteches GUI (1.2) but every time I try it, I got the "no response to ping" issue (https://gyazo.com/2052c36524cc40d286f93d4264cfd9df).

If I manually execute CrazyAra.exe, everything seems fine (https://gyazo.com/3953caf74e1271388a53f87ad1ad6e68), executing UCI command, everything seems fine as well (https://gyazo.com/2d06c3cbc1d436e9272073a5a6ae64e1).

But when trying to execute isready, seems like somehow models and parameters aren't found (https://gyazo.com/d3ef071af42a1096a28a2748a6443882). Readyok is not printed, so I assume the error is here.

I'm running on Windows 10, i7-9750h + RTX2080.

I haven't moved model files. Only extracted the zip as it is in the 0.8.0 release. (https://gyazo.com/fc224abdf5aed5879264a87faac9cabf) (https://gyazo.com/8e116afd5b7484af1c1b14358d2e52a2)

Thanks for the support.

Best regards

CrazyAra on XUbuntu 1804

I tried to run CrazyAra but it crashed from command line like this:

tamas@tami:~/bin/CrazyAra_0.4.0$ python3 crazyara.py 
                                  _                                           
                   _..           /   ._   _.  _        /\   ._   _.           
                 .' _ `\         \_  |   (_|  /_  \/  /--\  |   (_|           
                /  /e)-,\                         /                           
               /  |  ,_ |                    __    __    __    __             
              /   '-(-.)/          bw     8 /__////__////__////__////         
            .'--.   \  `                 7 ////__////__////__////__/          
           /    `\   |                  6 /__////__////__////__////           
         /`       |  / /`\.-.          5 ////__////__////__////__/            
       .'        ;  /  \_/__/         4 /__////__////__////__////             
     .'`-'_     /_.'))).-` \         3 ////__////__////__////__/              
    / -'_.'---;`'-))).-'`\_/        2 /__////__////__////__////        
   (__.'/   /` .'`                 1 ////__////__////__////__/                
    (_.'/ /` /`                       a  b  c  d  e  f  g  h                  
      _|.' /`                                                                 
jgs.-` __.'|  Developers: Johannes Czech, Moritz Willig, Alena Beyer          
    .-'||  |  Source-Code: QueensGambit/CrazyAra (GPLv3-License)              
       \_`/   Inspiration: A0-paper by Silver, Hubert, Schrittwieser et al.  
              ASCII-Art: Joan G. Stark, Chappell, Burton                      
uci
id name CrazyAra 0.4.0
id author Johannes Czech, Moritz Willig, Alena Beyer
option name UCI_Variant type combo default crazyhouse var crazyhouse
option name context type combo default cpu var cpu var gpu
option name use_raw_network type check default false
option name threads type spin default 8 min 1 max 4096
option name batch_size type spin default 8 min 1 max 4096
option name neural_net_services type spin default 1 min 1 max 10
option name playouts_empty_pockets type spin default 8192 min 56 max 8192
option name playouts_filled_pockets type spin default 8192 min 56 max 8192
option name centi_cpuct type spin default 250 min 1 max 500
option name centi_dirichlet_epsilon type spin default 25 min 0 max 100
option name centi_dirichlet_alpha type spin default 20 min 0 max 100
option name max_search_depth type spin default 40 min 1 max 100
option name centi_temperature type spin default 7 min 0 max 100
option name temperature_moves type spin default 4 min 0 max 99999
option name opening_guard_moves type spin default 7 min 0 max 99999
option name centi_clip_quantil type spin default 0 min 0 max 100
option name virtual_loss type spin default 3 min 0 max 10
option name centi_q_value_weight type spin default 70 min 0 max 100
option name threshold_time_for_raw_net_ms type spin default 100 min 1 max 300000
option name move_overhead_ms type spin default 300 min 0 max 60000
option name moves_left type spin default 40 min 10 max 320
option name extend_time_on_bad_position type check default true
option name max_move_num_to_reduce_movetime type spin default 4 min 0 max 120
option name check_mate_in_one type check default false
option name use_pruning type check default true
option name use_oscillating_cpuct type check default false
option name use_time_management type check default true
option name verbose type check default false
uciok
isready
Érvénytelen utasítás
tamas@tami:~/bin/CrazyAra_0.4.0

Then I'v read install on wiki :)
I successfully installed mxnet, but it doesn't seem to work.

tamas@tami:~/bin/CrazyAra_0.4.0$ pip3 list | grep mxnet
mxnet                        1.4.1              
tamas@tami:~/bin/CrazyAra_0.4.0$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mxnet import nd
Érvénytelen utasítás
tamas@tami:~/bin/CrazyAra_0.4.0

Here "Érvénytelen utasítás" = invalid command.
Any idea?

Can we integrate CrazyAra in our own chess engine or use via Python code/CLI ?

I am creating my own chess engine using c#/unity and wanted to use CrazyAra as a neural network opponent AI as the ultimate difficulty compared to standard pre-programmed AI I have created (also to evaluate how good or bad my AI is).

To do that and use/integrate CrazyAra, I wanted to use it on my server via Python as a remote AI and access it by sending and receiving moves from my engine via a API I will create.
So basically what I want to do is, be able to access and use CrazyAra either via CLI or via Python code so I can pass it my moves (I can do both/either of algebraic or coordinate notation), CrazyAra processes it and outputs me its move made by the board and I send it back as output to my chess engine via the Python API and perform that move locally.

So basically, my engine is running locally, CrazyAra is running remotely in linux server and being accessed by Python or CLI to provide input moves and get output moves.

I read about the command line interface in documentation but couldn't figure how to directly pass it just moves made and get out put of moves made by Crazy.
Being able to do this via Python would be even better.

Additionally, is it possible to contribute the games/moves data to make CrazyAra even more stronger ?

Not able to execute ClassicAra 0.9.5.post0

Hello,

Issue: I am not able to execute the new https://github.com/QueensGambit/CrazyAra/releases/tag/0.9.5.post0.

Symptom: When executing Multiara.exe, I get the error The code execution cannot proceed because interference_engine.dll was not found. Reinstalling the program may fix this problem.

image

My Installation folder: C:\Arena\Engines\ClassicAra

[.] [..]
inference_engine_legacy.dll inference_engine_lp_transformations.dll
inference_engine_onnx_reader.dll inference_engine_preproc.dll
inference_engine_transformations.dll Intel_Software_Development_Products.txt
libhwloc-5.dll libprotobuf.dll
MKLDNNPlugin.dll [model]
MultiAra.exe multiara_logo_high.png
MultiDevicePlugin.dll myriadPlugin.dll
myriad_compile.exe myriad_perfcheck.exe
ngraph.dll ngraphd.dll
onnx_importer.dll onnx_importerd.dll
onnx_proto.dll OpenVino_EULA.txt
openvino_redist.txt
22 archivos 74.688.971 bytes
3 dirs 88.729.923.584 bytes libres

Thank you.

Regards,
Arturo Ochoa.

ClassicAra fails at winning five piece end-game with table bases

Example game:

[Event "Test"]
[Site "DESKTOP-K5TPRSK"]
[Date "2022.09.20"]
[Round "2"]
[White "ClassicAra 0.9.5 CUDNN FP16"]
[Black "Devre 4.0NN x64 1CPU"]
[Result "1/2-1/2"]
[BlackElo "2200"]
[Time "17:27:17"]
[WhiteElo "2200"]
[TimeControl "40/480:40/480:40/480"]
[Termination "normal"]
[PlyCount "247"]
[WhiteType "program"]
[BlackType "program"]
 
1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Qc7 6. Be3 a6 7. Bd3 b5 8.
Nxc6 dxc6 9. a4 {+0.77/31 15} Rb8 {-0.89/20 28} 10. O-O {+0.90/35 15} Nf6
{-0.84/22 15} 11. f4 {+1.05/38 15} e5 {-0.76/21 20} 12. axb5 {+1.03/32 15}
axb5 {-0.80/22 11} 13. Ra7 {+1.40/31 15} Rb7 {-0.48/22 8} 14. fxe5
{+1.41/29 0} Rxa7 {-0.70/22 28} 15. exf6 {+1.87/32 15} Ra5 {-1.66/20 18}
16. e5 {+1.73/37 15} Be6 {-1.63/21 11} 17. Qf3 {+1.85/29 15} b4 {-1.86/21
25} 18. Ne4 {+1.73/29 15} gxf6 {-1.68/18 7} 19. Qf2 {+1.85/29 15} Kd7
{-2.05/22 25} 20. Kh1 {+2.02/27 0} Kc8 {-1.61/21 25} 21. Bb6 {+2.54/41 16}
Qxe5 {-2.09/27 17} 22. Bxa5 {+2.59/34 10} Qxa5 {-2.21/26 23} 23. Qxf6
{+2.64/33 1} Rg8 {-1.96/23 12} 24. b3 {+2.70/31 0} Kb8 {-2.20/22 2} 25. Bc4
{+2.75/29 0} Rg6 {-2.26/21 4} 26. Qd4 {+2.63/28 19} Bxc4 {-2.03/22 10} 27.
bxc4 {+2.66/23 13} Re6 {-2.20/22 5} 28. h3 {+2.69/21 0} f5 {-2.13/23 16}
29. Nf2 {+2.83/19 1} c5 {-2.36/23 13} 30. Qd5 {+3.88/25 24} Qa6 {-2.48/23
24} 31. Nd3 {+3.97/22 23} Qc6 {-2.46/23 6} 32. Qxf5 {+4.03/29 18} Be7
{-3.02/21 5} 33. Qf7 {+4.07/27 0} Bd8 {-3.10/20 7} 34. Nxc5 {+4.28/21 27}
Rg6 {-3.28/24 16} 35. Qf2 {+4.41/19 2} Rf6 {-2.96/27 20} 36. Qg3+ {+4.90/17
7} Qd6 {-3.23/29 21} 37. Qxd6+ {+5.19/23 39} Rxd6 {-3.28/28 6} 38. Nd3
{+5.25/18 21} Kc8 {-3.40/29 15} 39. Nxb4 {+5.29/17 47} Rd4 {-3.58/27 6} 40.
Nc6 {+5.62/21 46} Rxc4 {-4.06/29 8} 41. Nxd8 {+5.61/19 0} Kxd8 {-4.20/28 8}
42. Rf2 {+5.70/17 0} Ke7 {-3.45/23 6} 43. Kg1 {+5.78/15 0} Ke6 {-3.14/28
23} 44. Kf1 {+5.65/16 13} Ke5 {-3.06/28 23} 45. Ke1 {+5.53/16 13} Rc3
{-3.26/25 12} 46. Kd2 {+5.20/17 13} Rg3 {-3.34/26 22} 47. Re2+ {+5.14/17
11} Kd4 {-2.96/25 9} 48. Ke1 {+5.21/17 13} h5 {-3.11/26 22} 49. Kf2
{+5.04/15 13} Rc3 {-2.96/27 14} 50. Kg1 {+5.01/16 3} Rc8 {-2.66/25 10} 51.
Kh2 {+5.09/21 13} h4 {-2.83/29 20} 52. g3 {+5.38/28 13} hxg3+ {-3.46/30 13}
53. Kxg3 {+5.45/25 11} Rg8+ {-3.45/28 4} 54. Kf4 {+5.51/23 0} Rf8+
{-3.70/30 20} 55. Kg5 {+5.57/24 12} Rg8+ {-3.62/29 8} 56. Kf6 {+5.66/23 6}
Rf8+ {-3.65/27 8} 57. Kg7 {+5.60/22 9} Rf4 {-3.80/29 19} 58. Kg6 {+5.91/20
7} Rh4 {-4.02/29 14} 59. Rh2 {+5.95/23 14} Ke3 {-4.19/28 14} 60. Kg5
{+5.89/23 14} Rc4 {-4.22/27 5} 61. h4 {+5.77/19 10} Rc5+ {-4.56/26 18} 62.
Kg6 {+5.69/18 15} Rc6+ {-4.54/28 13} 63. Kf5 {+5.89/19 15} Rc5+ {-4.44/29
16} 64. Ke6 {+6.00/20 12} Rh5 {-4.64/22 3} 65. c4 {+6.00/21 5} Ke4
{-4.52/23 5} 66. Kf6 {+6.31/25 5} Kf4 {-5.06/27 13} 67. Kg6 {+6.06/22 16}
Rc5 {-5.20/26 16} 68. h5 {+6.11/24 16} Rc6+ {-5.06/25 10} 69. Kf7 {+6.13/22
0} Kg3 {-5.64/24 6} 70. Rh1 {+6.88/13 18} Rxc4 {-4.96/26 15} 71. h6
{+99.99/20 18} Kg2 {-6.14/21 13} 72. h7 {+99.99/21 7} Rf4+ {-4.96/25 13}
73. Ke6 {+99.99/15 19} Kxh1 {-4.96/27 7} 74. h8=Q+ {+99.99/14 18} Kg2
{-4.96/27 11} 75. Ke5 {+99.99/13 18} Rf3 {-5.19/21 6} 76. Ke4 {+99.99/13
18} Rf1 {-5.38/19 9} 77. Qg7+ {+99.99/19 18} Kh3 {-5.40/20 6} 78. Ke3
{+99.99/23 18} Kh4 {-5.50/20 2} 79. Ke2 {+99.99/16 18} Rf5 {-4.96/28 4} 80.
Qg6 {+99.99/16 17} Ra5 {-4.96/17 1} 81. Kf3 {+99.99/17 12} Ra3+ {-5.08/28
16} 82. Kf4 {+99.99/18 12} Ra4+ {-4.96/23 15} 83. Ke3 {+99.99/17 5} Ra3+
{-5.08/26 20} 84. Kd2 {+99.99/17 6} Ra5 {-5.08/25 22} 85. Kc3 {+99.99/13
12} Ra3+ {-5.31/23 21} 86. Kb4 {+99.99/19 12} Rf3 {-5.31/21 13} 87. Kc4
{+99.99/16 12} Rg3 {-5.31/24 9} 88. Qh6+ {+99.99/21 12} Kg4 {-5.31/25 20}
89. Kd4 {+99.99/22 12} Kf5 {-5.31/25 17} 90. Qh5+ {+99.99/19 12} Kf4
{-5.31/24 20} 91. Qe5+ {+99.99/17 12} Kf3 {-5.31/24 19} 92. Qe4+ {+99.99/14
12} Kf2 {-5.31/26 19} 93. Qf4+ {+99.99/14 12} Rf3 {-5.31/21 17} 94. Qh2+
{+99.99/20 12} Kf1 {-5.31/22 17} 95. Ke4 {+99.99/18 12} Rc3 {-7.71/20 9}
96. Qh1+ {+99.99/12 10} Ke2 {-5.31/23 17} 97. Qg2+ {+99.99/16 12} Kd1
{-5.31/23 3} 98. Kd4 {+99.99/13 12} Ra3 {-5.50/23 9} 99. Kc4 {+99.99/15 9}
Ke1 {-5.31/22 16} 100. Qb2 {+99.99/15 12} Rg3 {-5.50/20 4} 101. Kd4
{+99.99/17 12} Kd1 {-6.41/22 14} 102. Qb1+ {+99.99/12 10} Kd2 {-5.50/23 15}
103. Qa2+ {+99.99/12 12} Ke1 {-6.41/20 11} 104. Ke4 {+99.99/14 12} Kd1
{-6.41/21 3} 105. Qb1+ {+99.99/14 10} Kd2 {-5.31/16 1} 106. Qb2+ {+99.99/13
12} Kd1 {-6.41/22 15} 107. Kf4 {+99.99/11 12} Rh3 {-5.52/19 13} 108. Kg4
{+99.99/14 12} Re3 {-1.52/19 13} 109. Qd4+ {+99.99/14 12} Ke2 {-1.52/21 11}
110. Kf4 {+99.99/15 12} Rd3 {-1.52/20 3} 111. Qc4 {+99.99/18 12} Kd2
{-1.52/19 3} 112. Ke4 {+99.99/16 12} Rh3 {-1.52/19 3} 113. Qf7 {+99.99/17
9} Re3+ {-1.52/17 8} 114. Kd4 {+99.99/16 13} Rd3+ {0.00/25 8} 115. Kc4
{+99.99/16 13} Rc3+ {0.00/31 10} 116. Kb4 {+99.99/15 12} Rd3 {0.00/35 9}
117. Qf4+ {+99.99/14 10} Re3 {0.00/35 1} 118. Kc4 {+99.99/13 13} Ke2
{0.00/39 10} 119. Qh4 {+99.99/15 11} Kd1 {0.00/31 1} 120. Kb4 {+99.99/9 13}
Rd3 {0.00/46 8} 121. Qh8 {+99.99/7 11} Re3 {0.00/58 22} 122. Kc4 {+99.99/5
11} Kd2 {0.00/61 22} 123. Qh6 {+99.99/3 12} Ke2 {0.00/33 14} 124. Kd4
{0.00/1 12 50-Züge-Regel} 1/2-1/2

Reported by Werner.

Classic Ara 0.9.9 threads use

Hi,

I'd like to know if it is possible to use the engine with only one thread. I tested it in standard chess against other engine, but it uses at least 6 threads. The GUI is Winboard, all engines are set to 1 thread, 64 mb of hash, under Windows 10, 64 bits, CPU only.

Best,
Carlos

Classic Ara stops working after a few moves and needs re-opening in Chessbase 16

Hi Johannes!
First of all, fantastic work with Classic Ara so far! It is a really interesting engine to analyse and spar with, and I hope it soon enters the TCEC Premier Division!

I am facing an issue when I use it on Chessbase 16 - after making a few moves, Classic Ara stops functioning i.e. it doesn't show any lines. However, when I stop the engine, unload it and reload it, it works fine. What is causing this issue and how do I fix this?

Another thing I wanted to ask was this - does Classic Ara support the Multi-PV functionality? Does it not lose strength with it like Leela and Komodo MCTS?

Thank you for your time!
magicianofriga

illegal move ClassicAra-0.8.4

[Event "?"]
[Site "?"]
[Date "2021.04.10"]
[Round "12"]
[White "ClassicAra_pre_pull47"]
[Black "ClassicAra_084"]
[Result "1-0"]
[ECO "A47"]
[GameDuration "00:00:07"]
[GameEndTime "2021-04-10T17:36:43.795 Pacific Daylight Time"]
[GameStartTime "2021-04-10T17:36:36.352 Pacific Daylight Time"]
[Opening "Queen's Indian defense"]
[PlyCount "111"]
[Termination "illegal move"]
[TimeControl "5+0.01"]

1. d4 {book} Nf6 {book} 2. Nf3 {book} b6 {book} 3. c4 {book} Bb7 {book}
4. g3 {book} Bxf3 {book} 5. exf3 {book} e6 {book} 6. Bg2 {book} d5 {book}
7. O-O {book} Be7 {book} 8. f4 {book} c6 {book} 9. f5 {+1.66/13 0.070s}
exf5 {-1.50/20 0.13s} 10. cxd5 {+1.60/18 0.070s} cxd5 {-1.33/23 0.13s}
11. Qa4+ {+1.56/17 0.073s} Qd7 {-1.51/21 0.13s} 12. Qxd7+ {+1.78/19 0.076s}
Kxd7 {-1.64/19 0.13s} 13. Nc3 {+1.70/16 0.076s} Nc6 {-1.66/20 0.13s}
14. Nxd5 {+1.69/14 0.078s} Rac8 {-1.54/20 0.13s} 15. Rd1 {+1.91/16 0.080s}
Nxd5 {-1.57/19 0.13s} 16. Bxd5 {+1.71/14 0.082s} Bf6 {-1.66/30 0.13s}
17. Be3 {+1.67/16 0.083s} Ke7 {-1.57/22 0.13s} 18. Rac1 {+1.94/13 0.087s}
Nb4 {-1.41/21 0.13s} 19. Bb3 {+1.65/22 0.089s} Rxc1 {-1.23/19 0.13s}
20. Rxc1 {+1.32/18 0.090s} Rd8 {-1.26/16 0.14s} 21. Rc7+ {+1.23/16 0.094s}
Rd7 {-1.05/15 0.14s} 22. Rxd7+ {+1.27/17 0.096s} Kxd7 {-1.37/19 0.14s}
23. Bxf7 {+1.35/19 0.098s} Nc2 {-1.41/16 0.14s} 24. Bg8 {+1.41/17 0.10s}
h6 {-1.29/18 0.14s} 25. Bd2 {+1.63/16 0.10s} Nxd4 {-1.59/16 0.14s}
26. Kg2 {+1.83/14 0.11s} Nc6 {-1.66/15 0.14s} 27. b3 {+1.86/14 0.11s}
Kd6 {-1.71/13 0.14s} 28. Bh7 {+1.95/11 0.12s} Ne7 {-1.77/16 0.15s}
29. h4 {+1.95/14 0.12s} g5 {-1.42/14 0.15s} 30. Kf3 {+1.72/12 0.13s}
Ke5 {-1.20/17 0.15s} 31. hxg5 {+1.37/11 0.046s} hxg5 {-1.09/11 0.071s}
32. Ke2 {+1.35/9 0.043s} Ke6 {-1.21/15 0.068s} 33. Kd3 {+1.15/11 0.041s}
b5 {-1.03/13 0.065s} 34. f3 {+1.39/10 0.039s} Nc6 {-0.83/9 0.061s}
35. Bg8+ {+0.79/8 0.039s} Kd6 {-0.75/7 0.059s} 36. Bh7 {+0.90/6 0.037s}
Ke6 {-0.82/5 0.056s} 37. Ke2 {+1.19/10 0.036s} Nd4+ {-1.26/11 0.054s}
38. Kf2 {+1.29/14 0.034s} Nc6 {-0.93/16 0.052s} 39. Bg8+ {+0.90/10 0.032s}
Kd6 {-0.87/7 0.050s} 40. Bf7 {+1.03/8 0.031s} a5 {-0.91/12 0.049s}
41. Bg6 {+1.68/11 0.030s} Ne7 {-0.93/15 0.046s} 42. Bh7 {+1.26/10 0.029s}
a4 {-1.12/13 0.044s} 43. bxa4 {+1.22/11 0.029s} bxa4 {-1.48/14 0.042s}
44. Ke2 {+1.89/12 0.028s} Kc5 {-1.17/14 0.041s} 45. Kd3 {+1.45/10 0.026s}
Kb5 {-0.83/11 0.040s} 46. g4 {+1.24/9 0.026s} f4 {-0.56/13 0.039s}
47. Be4 {+0.91/10 0.025s} Kc5 {-0.68/12 0.036s} 48. Ba5 {+0.74/10 0.024s}
Nd5 {-0.31/16 0.035s} 49. Bxd5 {+0.86/12 0.023s} Kxd5 {-1.05/10 0.033s}
50. Bb4 {+1.29/9 0.023s} Bd8 {-0.91/8 0.032s} 51. Bf8 {+1.13/7 0.022s}
Bf6 {-0.81/6 0.031s} 52. Bb4 {+0.60/5 0.023s} Bd8 {-0.50/4 0.030s}
53. Bf8 {+0.40/3 0.021s} Bf6 {-0.38/2 0.030s} 54. Ba3 {+0.81/14 0.020s}
Bd8 {-0.50/11 0.028s} 55. Bb4 {+0.87/13 0.020s} Bf6 {-0.64/13 0.027s}
56. Bf8 {+0.79/14 0.019s, Black makes an illegal move: d8f6} 1-0

Wrong replay memory inclusion in fileio.py

In _include_data_from_replay_memory in fileio.py the goal is to include random files from the most recent replay memory given by fraction_for_selection. For this, we get the filenames with os.listdir and as the code comment suggests, after inverting, the most recent files should be on top. However, os.listdir returns files in arbitrary order (see https://docs.python.org/3/library/os.html#os.listdir). I think the confusion comes from listdir being ordered by date on windows, but on my linux machine it definitely is not.

file_names = os.listdir(self.train_dir_archive)
# invert ordering (most recent files are on top)
file_names = file_names[::-1]

I'd suggest explicitly sorting via os.path.getmtime:
file_names.sort(key=lambda x:os.path.getmtime(os.path.join(self.train_dir_archive,x)))

Training the engine to play custom variants

Is there a process for training this engine to play custom variants not included in the Python-chess module, or in Stockfish's supported variants? I'm looking to write a variant where the only rule modification is one can capture one's own pieces, which doesn't exist in either yet. Assuming that Board is programmed correctly, could I train an engine around it?

CrazyAra delays printing results even when node limit has been reached

Not a huge issue, but CrazyAra prints the result of the analysis after the end of the movetime, even when the analysis node limit has been reached. If there is a gap in time, the engine stops analyzing until the movetime limit has been reached, only then it prints out the result. Also had trouble getting go node working, seems that the engine only accept a movetime.

compilation on windows

Hi,
when trying to build with windows now, I get weird path error for finding logger.cpp. I am using cmake 3.20.0-rc3 for windows.

CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
-- BLAZE_PATH set to: C:\Users\Masterkni6\CrazyAra\vcpkg\packages\blaze_x86-windows\include
-- Found blaze
-- Enabled TensorRT support
-- TensorRT path: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2
-- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2 (found version "11.2")
-- CUDA path: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2
CMake Error at CMakeLists.txt:344 (add_executable):
  Syntax error in cmake code when parsing string

    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2/samples/common/logger.cpp

  Invalid escape sequence \P


-- Configuring incomplete, errors occurred!

How to use two GPU

Is there a command for using 2x GPUs.

For Lc0 i use following syntax for RTX cards: (backend=cudnn-fp16,gpu=0),(backend=cudnn-fp16,gpu=1)

Crash for ClassicAra 0.9.5 with Int8 Inference

The ClassicAra 0.9.5 appears to crash when trying to use INT8 inference.
The issue seems to be related to the new ClassicAra model because INT8 still seems to work for CrazyAra 0.9.5.

$ ./ClassicAra
setoption name Precision value int8
info string Updated option Precision to int8
isready
info string onnx file: model/ClassicAra/chess/model-1.19414-0.585-0513-v3.0-bsize-1.onnx
info string no engine file found
info string Building TensorRT engine...
info string This may take a few minutes...
info string run INT8 quantization calibration
The given version '0.3.72' was unexpected and could not be handled

Thanks to Werner Schüle for reporting it.

cuDNN library not fully used on Windows

The library cudnn_cnn_infer64_8.dll is not used on Windows, but libcudnn_cnn_infer.so.8 is used on Linux.
This seems to make a visible NPS difference.

e.g. Ubuntu 18.04:

GPU: RTX 2070 OC

isready
info string onnx file: model/chess/model-1.23453-0.572-0537-bsize-1.onnx
info string deserialize engine: model/chess/model-bsize1-fp16-0.trt
info string inputDims: (1, 39, 8, 8)
info string valueOutputDims: (1, 1)
info string policyOutputDims: (1, 4864)
info string No auxiliary outputs detected.
info string onnx file: model/chess/model-1.23453-0.572-0537-bsize-16.onnx
info string deserialize engine: model/chess/model-bsize16-fp16-0.trt
info string onnx file: model/chess/model-1.23453-0.572-0537-bsize-16.onnx
info string deserialize engine: model/chess/model-bsize16-fp16-0.trt
info string inputDims: (16, 39, 8, 8)
info string valueOutputDims: (16, 1)
info string policyOutputDims: (16, 4864)
info string No auxiliary outputs detected.
readyok
go infinite
info string create new tree
info string run mcts search
info depth 17 seldepth 28 multipv 1 score cp 47 nodes 18522 nps 18485 tbhits 0 time 1002 pv d2d4 g8f6 c2c4 e7e6 g1f3 b7b6 g2g3 c8a6 b2b3 f8b4 c1d2 b4e7 f1g2 c7c6 d2c3 d7d5 b1d2
info depth 19 seldepth 31 multipv 1 score cp 47 nodes 38347 nps 19154 tbhits 0 time 2002 pv d2d4 g8f6 c2c4 e7e6 g1f3 b7b6 g2g3 c8a6 b2b3 f8b4 c1d2 b4e7 f1g2 c7c6 d2c3 d7d5 b1d2 b8d7 e1g1
info depth 19 seldepth 37 multipv 1 score cp 47 nodes 57007 nps 18990 tbhits 0 time 3002 pv d2d4 g8f6 c2c4 e7e6 g1f3 b7b6 g2g3 c8a6 b2b3 f8b4 c1d2 b4e7 f1g2 c7c6 d2c3 d7d5 b1d2 b8d7 e1g1

GPU-Utility: 91%

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.27.04    Driver Version: 460.27.04    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce RTX 207...  Off  | 00000000:01:00.0 Off |                  N/A |
|  0%   48C    P2   152W / 215W |    677MiB /  7982MiB |     91%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 108...  Off  | 00000000:0B:00.0  On |                  N/A |
|  0%   54C    P2    56W / 250W |    441MiB / 11177MiB |      3%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

e.g. Windows 10:

GPU: RTX 2070 OC

isready
info string onnx file: model/chess/model-1.23453-0.572-0537-bsize-1.onnx
info string deserialize engine: model/chess/model-bsize1-fp16-0.trt
info string inputDims: (1, 39, 8, 8)
info string valueOutputDims: (1, 1)
info string policyOutputDims: (1, 4864)
info string No auxiliary outputs detected.
info string onnx file: model/chess/model-1.23453-0.572-0537-bsize-16.onnx
info string deserialize engine: model/chess/model-bsize16-fp16-0.trt
info string onnx file: model/chess/model-1.23453-0.572-0537-bsize-16.onnx
info string deserialize engine: model/chess/model-bsize16-fp16-0.trt
info string inputDims: (16, 39, 8, 8)
info string valueOutputDims: (16, 1)
info string policyOutputDims: (16, 4864)
info string No auxiliary outputs detected.
readyok
go infinite
info string create new tree
info string run mcts search
info depth 17 seldepth 28 multipv 1 score cp 47 nodes 16500 nps 16369 tbhits 0 time 1008 pv d2d4 g8f6 c2c4 e7e6 g1f3 b7b6 g2g3 c8a6 b2b3 f8b4 c1d2 b4e7 f1g2 c7c6 d2c3 d7d5 b1d2
info depth 19 seldepth 31 multipv 1 score cp 47 nodes 33367 nps 16584 tbhits 0 time 2012 pv d2d4 g8f6 c2c4 e7e6 g1f3 b7b6 g2g3 c8a6 b2b3 f8b4 c1d2 b4e7 f1g2 c7c6 d2c3 d7d5 b1d2 b8d7 e1g1
info depth 19 seldepth 33 multipv 1 score cp 47 nodes 50400 nps 16617 tbhits 0 time 3033 pv d2d4 g8f6 c2c4 e7e6 g1f3 b7b6 g2g3 c8a6 b2b3 f8b4 c1d2 b4e7 f1g2 c7c6 d2c3 d7d5 b1d2 b8d7 e1g1

GPU-Utility: 85%

C:\Windows\System32\DriverStore\FileRepository\nv_dispui.inf_amd64_c1f8f32cc9af9677>nvidia-smi
Fri Apr  9 17:37:37 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 461.33       Driver Version: 461.33       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce RTX 207... WDDM  | 00000000:01:00.0 Off |                  N/A |
| 29%   59C    P2   141W / 215W |    845MiB /  8192MiB |     85%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 108... WDDM  | 00000000:0B:00.0  On |                  N/A |
|  0%   38C    P8    17W / 250W |    692MiB / 11264MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

About the transformer.

Hi Johannes Czech!

I notice that your team uses the transformer in the training pipe. I am curious about current result.

I tried to do the same thing on the 9x9 go game too. My result showed the transformer was not good at go game if we did not any special normalizing or encoding for inputs features. Or just I did not give it enough training data. I have no ideal....?

It is very helpful to me if you could share some current result. Thanks a lot!

Trouble running binaries on Ubuntu because of libomp.so

I'm trying to run the compiled Linux binaries on Ubuntu 19.04. I've had a few errors about missing shared object files that I've all been able to resolve, but now I'm stuck on this one:

error while loading shared libraries: libomp.so: cannot open shared object file: No such file or directory

I can't figure out where to get that shared object file from, though. My best bet was installing libomp-dev but that didn't change anything, and there's no package such as libomp. Search engines are not yielding any other useful results about it... what should I install to have libomp.so?

Why doesn't CrazyAra play only-moves instantly?

I've been experimenting with CrazyAra recently and one thing I noticed is that it often takes a decent chunk of time contemplating a position when there is only one move available. For example, with the time control "20 moves in 10 minutes" via CuteChess, CrazyAra took 25 seconds in this position on my computer:

Screen Shot 2021-01-12 at 1 56 52 PM

I'm wondering why it takes so long to consider this position, and if there'd be a performance improvement to just immediately execute only-moves without thinking and to then think about the position on your opponent's time to save time and prevent your opponent from thinking on your time.

blaze/Math.h not found

Trying to build CrazyAra in ubuntu and followed the steps to install blaze dependencies but make cant find it during installation

masterkni6@masterkni6-X570-AORUS-ELITE:~/CrazyAra/engine/build$ cmake -DCMAKE_BUILD_TYPE=Release ..
- The CXX compiler identification is GNU 5.5.0
- Check for working CXX compiler: /home/linuxbrew/.linuxbrew/bin/c++
- Check for working CXX compiler: /home/linuxbrew/.linuxbrew/bin/c++ -- works
- Detecting CXX compiler ABI info
- Detecting CXX compiler ABI info - done
- Detecting CXX compile features
- Detecting CXX compile features - done
- BLAZE_PATH not set
- Found blaze
- Looking for C++ include pthread.h
- Looking for C++ include pthread.h - found
- Performing Test CMAKE_HAVE_LIBC_PTHREAD
- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
- Looking for pthread_create in pthreads
- Looking for pthread_create in pthreads - not found
- Looking for pthread_create in pthread
- Looking for pthread_create in pthread - found
- Found Threads: TRUE  
- Enabled TensorRT support
- TensorRT path: /home/masterkni6/Downloads/TensorRT-7.2.3.4
- Found CUDA: /usr/local/cuda (found version "11.2") 
- CUDA path: 
- Configuring done
- Generating done
- Build files have been written to: /home/masterkni6/CrazyAra/engine/build
masterkni6@masterkni6-X570-AORUS-ELITE:~/CrazyAra/engine/build$ make
make[1]: Entering directory '/home/masterkni6/CrazyAra/engine/build'
make[2]: Entering directory '/home/masterkni6/CrazyAra/engine/build'
Scanning dependencies of target ClassicAra
make[2]: Leaving directory '/home/masterkni6/CrazyAra/engine/build'
make[2]: Entering directory '/home/masterkni6/CrazyAra/engine/build'
[  1%] Building CXX object CMakeFiles/ClassicAra.dir/src/agents/agent.cpp.o
In file included from /home/masterkni6/CrazyAra/engine/src/agents/agent.h:31:0,
                 from /home/masterkni6/CrazyAra/engine/src/agents/agent.cpp:29:
/home/masterkni6/CrazyAra/engine/src/agents/../stateobj.h:33:24: fatal error: blaze/Math.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/ClassicAra.dir/build.make:63: CMakeFiles/ClassicAra.dir/src/agents/agent.cpp.o] Error 1
make[2]: Leaving directory '/home/masterkni6/CrazyAra/engine/build'
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/ClassicAra.dir/all] Error 2
make[1]: Leaving directory '/home/masterkni6/CrazyAra/engine/build'
make: *** [Makefile:84: all] Error 2

CrazyAra_ClassicAra_0.9.0 Losses on Time

See attached PGN file with 4 time loss games.
Time control 0:10+1.0, so 1 second increment
GPU is 2080ti
cutechess-cli command:
cutechess-cli -each tc=0:10+1.0 restart=on -engine conf=CrazyAra_ClassicAra_0.9.0 -engine conf=SF7 -games 12000 -wait 1000 -ratinginterval 10 -tb E:/syzygy;E:/syzygy-7 -tbpieces 7 -openings file=D:/Cutechess-cli/book_3moves_cp25-49_13580pos.pgn start=1 -repeat -concurrency 1 -pgnout CrazyAra_ClassicAra_0.9.0_v_SF7.pgn fi

CrazyAra_ClassicAra_0.9.0_v_SF7.zip

At signs @ in PV string flagged as illegal

D:\Cutechess-cli>cutechess-cli -each tc=0:10+1.0 restart=on -engine conf=CrazyAra.exe_0.8.0 -engine conf=SF11 -games 12000 -wait 1000 -ratinginterval 10 -tb E:/syzygy;E:/syzygy-7 -tbpieces 7 -openings file=D:/Cutechess-cli/book_3moves_cp25-49_13580pos.pgn start=1 -repeat -concurrency 1 -pgnout CrazyAra.exe_0.8.0_v_128x10-SF11.pgn min fi
Started game 1 of 12000 (CrazyAra.exe_0.8.0 vs SF11)
Warning: Illegal PV move P@g4 from CrazyAra.exe_0.8.0 (0)
Warning: PV: Bg5 Bb4+ Nbd2 dxc4 Rc1 b5 a4 h6 Bxf6 Qxf6 e3 P@g4
Warning: Illegal PV move B@d5 from CrazyAra.exe_0.8.0 (0)
Warning: PV: e3 Nc6 Nbd2 Ne4 Bxe7 Qxe7 Be2 Nxd2 Nxd2 dxc4 O-O B@d5
Warning: Illegal PV move B@f5 from CrazyAra.exe_0.8.0 (0)
Warning: PV: Bxf6 Bxf6 Nbd2 Nc6 Be2 O-O O-O B@f5
Warning: Illegal PV move B@f5 from CrazyAra.exe_0.8.0 (0)
Warning: PV: Nbd2 Nc6 Be2 O-O O-O B@f5
Warning: Illegal PV move B@f5 from CrazyAra.exe_0.8.0 (0)
Warning: PV: Be2 Nc6 O-O B@f5
Warning: Illegal PV move N@h5 from CrazyAra.exe_0.8.0 (0)
Warning: PV: N@h5
Finished game 1 (CrazyAra.exe_0.8.0 vs SF11): 0-1 {White makes an illegal move: N@h5}

Could not install Classic Ara on Both Linux and Windows

Hi,
I am a chess player and analyst. Recently I tried installing Classic Ara on my Ubuntu 20.04 LTS. It already has CUDA 11.1 and CUDNN 8.1 for an RTX 2070 Super Graphics Card (Processor is an older I7 4th gen). I downloaded the Tensor RT version and tried to run isready by going to the directory, opening the terminal and typing ./ClassicAra. I get the following output:

info string onnx file: model/chess/model-1.23453-0.572-0537-bsize-1.onnx
info string no engine file found
info string Building TensorRT engine...
info string This may take a few minutes...
terminate called after throwing an instance of 'pwgen::PwgenException'
what(): Driver error:
Aborted (core dumped)

Then, I tried it on my laptop which has Chessbase 16 and CUDA 11.1 installed. The laptop also has a CUDA supported G-card (GTX 1660TI). I tried to create the engine from Chessbase 16 and open it, but it gives an error message and doesn't start.

I then tried running the .exe file. I opened it by double clicking it and then typing isready. This command worked, but when I tried benchmark 3000 it closed unexpectedly without any output. Can you please help me with installing this on my PC? Also, a kind request - please try to give detailed installation instructions on the GitHub page like the Stockfish and Leela repositories.

Congratulations on your TCEC entry! Your engine plays fantastic games! Looking forward to its further progress!
Best regards,
magicianofriga.

korean chess??

I actively ask you to develop Korean chess engine rules.
Korean chess is very popular in Korea. And it is not yet known worldwide. Only Fairy Stockfish can use the Korean chess engine. If you develop Korean chess, I can test the rules of Korean chess and your engine. I currently have a master qualification.
Korean chess is similar to Chinese chess.

ClassicAra does not load using the current model.

Executable: ClassicAra.exe 0.9.5

Error: ClassicAra does not load using the current model.

Used Models
C:\Arena\Engines\ClassicAra\model\ClassicAra\chess>dir
El volumen de la unidad C no tiene etiqueta.
El número de serie del volumen es: 2A49-5FC0

Directorio de C:\Arena\Engines\ClassicAra\model\ClassicAra\chess

01/09/2021 10:26 p. m.

.
01/09/2021 10:26 p. m. ..
01/09/2021 10:26 p. m. 17.170.482 model-1.19414-0.585-0513-v3.0-bsize-1.onnx
01/09/2021 10:26 p. m. 17.170.482 model-1.19414-0.585-0513-v3.0-bsize-16.onnx
01/09/2021 10:26 p. m. 17.170.482 model-1.19414-0.585-0513-v3.0-bsize-8.onnx
01/09/2021 10:26 p. m. 17.136.741 model-1.19414-0.585-v3.0-0513.params
01/09/2021 10:26 p. m. 83.627 model-1.19414-0.585-v3.0-symbol.json

01/09/2021 10:26 p. m. 743 model_7_wdlp_head_7_epochs.txt

Execution:
:\Arena\Engines\ClassicAra>ClassicAra.exe

                              _
               _..           /   ._   _.  _        /\   ._   _.
             .' _ `\         \_  |   (_|  /_  \/  /--\  |   (_|
            /  /e)-,\                         /
           /  |  ,_ |                    __    __    __    __
          /   '-(-.)/          bw     8 /__////__////__////__////
        .'--.   \  `                 7 ////__////__////__////__/
       /    `\   |                  6 /__////__////__////__////
     /`       |  / /`\.-.          5 ////__////__////__////__/
   .'        ;  /  \_/__/         4 /__////__////__////__////
 .'`-'_     /_.'))).-` \         3 ////__////__////__////__/
/ -'_.'---;`'-))).-'`\_/        2 /__////__////__////__////

(.'/ / .' 1 ////////////////__/
(_.'/ / / a b c d e f g h
_|.' / jgs.- __.'| Developers: Johannes Czech, Moritz Willig, Alena Beyer
.-'|| | Source-Code: QueensGambit/CrazyAra (GPLv3-License)
_`/ Inspiration: A0-paper by Silver, Hubert, Schrittwieser et al.
ASCII-Art: Joan G. Stark, Chappell, Burton

uci
id name ClassicAra 0.9.5 (Aug 23 2021)
id author Johannes Czech and CrazyAra developers (see AUTHORS file)
option name Allow_Early_Stopping type check default true
option name Batch_Size type spin default 16 min 1 max 8192
option name Centi_CPuct_Init type spin default 250 min 1 max 99999
option name Centi_Dirichlet_Epsilon type spin default 0 min 0 max 99999
option name Centi_Dirichlet_Alpha type spin default 20 min 1 max 99999
option name Centi_Epsilon_Checks type spin default 1 min 0 max 100
option name Centi_Epsilon_Greedy type spin default 5 min 0 max 100
option name Centi_Node_Temperature type spin default 170 min 1 max 99999
option name Centi_Q_Value_Weight type spin default 100 min 0 max 99999
option name Centi_Q_Veto_Delta type spin default 40 min 0 max 99999
option name Centi_Quantile_Clipping type spin default 25 min 0 max 100
option name Centi_Random_Move_Factor type spin default 0 min 0 max 99
option name Centi_Temperature type spin default 170 min 0 max 99999
option name Centi_Temperature_Decay type spin default 92 min 0 max 100
option name Centi_U_Init_Divisor type spin default 100 min 1 max 99999
option name Centi_Virtual_Loss type spin default 100 min 0 max 99999
option name Context type string default cpu
option name CPuct_Base type spin default 19652 min 1 max 99999
option name First_Device_ID type spin default 0 min 0 max 99999
option name Fixed_Movetime type spin default 0 min 0 max 99999999
option name Last_Device_ID type spin default 0 min 0 max 99999
option name Log_File type string default
option name MCTS_Solver type check default true
option name Model_Directory type string default model/ClassicAra/chess
option name Move_Overhead type spin default 20 min 0 max 5000
option name MultiPV type spin default 1 min 1 max 99999
option name Nodes type spin default 0 min 0 max 99999999
option name Nodes_Limit type spin default 0 min 0 max 999999999
option name Precision type combo default float32 var float32 var int8
option name Reuse_Tree type check default true
option name Temperature_Moves type spin default 0 min 0 max 99999
option name Use_NPS_Time_Manager type check default true
option name Search_Type type combo default mcgs var mcgs var mcts
option name Simulations type spin default 0 min 0 max 99999999
option name SyzygyPath type string default
option name Threads type spin default 2 min 1 max 512
option name Timeout_MS type spin default 0 min 0 max 99999999
option name UCI_Variant type combo default chess var chess var chess
option name Use_Raw_Network type check default false
uciok
isready
info string json file: model/ClassicAra/chess/model-1.19414-0.585-v3.0-symbol.json
info string Loading the model from model/ClassicAra/chess/model-1.19414-0.585-v3.0-symbol.json
[08:04:19] C:\lib\incubator-mxnet\src\nnvm\legacy_json_util.cc:204: Warning: loading symbol saved by MXNet version 10501 with lower version of MXNet v10500. May cause undefined behavior. Please update MXNet if you encounter any issue
info string Loading the model parameters from: model/ClassicAra/chess/model-1.19414-0.585-v3.0-0513.params

C:\Arena\Engines\ClassicAra>pause

can you supports Korean chess(Janggi), which is a variation of chess?

japanese chess(Shogi) https://github.com/kobanium/aobazero
chinese chess(Xiangqi) https://github.com/leedavid/leela-chess-to-Chinese-Chess

If you could supports korean chess(janggi), could you please distributed computing server use as methods like other chess variations above?
example using client exe or google colab etc

ianfab's Fairy Stockfish engine supported Korean chess(janggi), and Gui supported Korean chess(janggi) as winboard and cute chess.

documentation on UCI options

any place on descriptions of UCI options? the one on github is missing alot and --help in commandline does nothing.
Im trying to use my second GPU and i see First_Device_ID but not sure if thats the right option. Thanks and sorry for all the issues

CrazyAra Going To Infinite Analysis Mode On 1 Position (Can't Be Stopped) In Liground After Making Two Moves On The Board

Hey CrazyAra/Liground team,

I'm really excited to see that there is now a program that supports analysis with CrazyAra, outside of using the command line!

The first image is what I get when I load the initial position, and I imagine it's how things are meant to look:

image

From this setup, I am able to stop the engine analysis and it switches automatically to the next move when I make 1.e4 on the board - all good so far.

Then I try playing 1...e5, and this happens:

image

As you can see, the engine in the command line automatically switches to 'go infinite' mode, and is stuck on this position after 1.e4, no matter what moves I play or what I do on the board. My attempts to type 'stop' and any other commands are completely ignored, as you can see here:

image

I even tried uploading a new PGN, and that also didn't work (the PGN moves didn't load from Lichess).

Hopefully there is some simple fix (e.g. in the Settings) I'm missing, as otherwise this is quite a significant bug that stops CrazyAra being used in the way I assume it's intended on Liground.

Update: It seems that inputting the FEN from the Lichess Study each time, instead of making moves on the board, avoids this problem. That's still a lot better than the alternatives (like the command line), as you can see 5 options in the analysis, and it's a bit faster to copy and paste. But I believe this software (with some technical fixes) is capable of dominating the crazyhouse database/analysis scene the way ChessBase did with standard chess.

Installation on Mac?

Is there any way you can provide an installation guide for the latest version of CrazyAra on a Mac? I can't seem to compile cutechess for use on a Mac.

Thanks

"Bus error (core dumped)" on 'go' command

I finally managed to run the executable (the Linux GPU version; Ubuntu 19.04) without startup errors and I should have put the models in the right place, but the UCI go makes this happen:

Bus error (core dumped)

Many other UCI commands result in an error. For example, ucinewgame results in a segfault:

Segmentation fault: 11

Stack trace:
  [bt] (0) ./libmxnet.so(+0xe7d769) [0x7fca155d6769]
  [bt] (1) /lib/x86_64-linux-gnu/libc.so.6(+0x43f60) [0x7fca14229f60]
  [bt] (2) ./CrazyAra(MCTSAgent::clear_game_history()+0xd) [0x560b4de2fa1d]
  [bt] (3) ./CrazyAra(CrazyAra::uci_loop(int, char**)+0x84b) [0x560b4de0d5ab]
  [bt] (4) ./CrazyAra(main+0x4b) [0x560b4dd1c7fb]
  [bt] (5) /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb) [0x7fca1420cb6b]
  [bt] (6) ./CrazyAra(_start+0x2a) [0x560b4ddb00ea]

And isready returns a big error:

info string json file: model/model-1.19246-0.603-symbol.json
info string Loading the model from model/model-1.19246-0.603-symbol.json
[23:18:56] /media/queensgambit/Volume/Deep_Learning/libraries/mxnet/src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v1.4.1. Attempting to upgrade...
[23:18:56] /media/queensgambit/Volume/Deep_Learning/libraries/mxnet/src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
info string Loading the model parameters from model/model-1.19246-0.603-0223.params
terminate called after throwing an instance of 'dmlc::Error'
  what():  [23:18:56] /media/queensgambit/Volume/Deep_Learning/libraries/mxnet/cpp-package/include/mxnet-cpp/operator.hpp:141: [23:18:56] /media/queensgambit/Volume/Deep_Learning/libraries/mxnet/src/engine/threaded_engine.cc:328: Check failed: device_count_ > 0 (-1 vs. 0) : GPU usage requires at least 1 GPU
Stack trace:
  [bt] (0) ./CrazyAra(dmlc::LogMessageFatal::~LogMessageFatal()+0x43) [0x56357cc34483]
  [bt] (1) ./libmxnet.so(mxnet::engine::ThreadedEngine::PushAsync(std::function<void (mxnet::RunContext, mxnet::engine::CallbackOnComplete)>, mxnet::Context, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var*> > const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var*> > const&, mxnet::FnProperty, int, char const*, bool)+0x527) [0x7f4792341d87]
  [bt] (2) ./libmxnet.so(mxnet::CopyFromTo(mxnet::NDArray const&, mxnet::NDArray const&, int, bool)+0x8b0) [0x7f47924b7100]
  [bt] (3) ./libmxnet.so(mxnet::imperative::PushFComputeEx(std::function<void (nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector<mxnet::NDArray, std::allocator<mxnet::NDArray> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, std::vector<mxnet::NDArray, std::allocator<mxnet::NDArray> > const&)> const&, nnvm::Op const*, nnvm::NodeAttrs const&, mxnet::Context const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var*> > const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var*> > const&, std::vector<mxnet::Resource, std::allocator<mxnet::Resource> > const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&)::{lambda(mxnet::RunContext)#1}::operator()(mxnet::RunContext) const+0x9e) [0x7f47923e275e]
  [bt] (4) ./libmxnet.so(mxnet::imperative::PushFComputeEx(std::function<void (nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector<mxnet::NDArray, std::allocator<mxnet::NDArray> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, std::vector<mxnet::NDArray, std::allocator<mxnet::NDArray> > const&)> const&, nnvm::Op const*, nnvm::NodeAttrs const&, mxnet::Context const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var*> > const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var*> > const&, std::vector<mxnet::Resource, std::allocator<mxnet::Resource> > const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&)+0x3cc) [0x7f47923ea07c]
  [bt] (5) ./libmxnet.so(mxnet::Imperative::InvokeOp(mxnet::Context const&, nnvm::NodeAttrs const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, mxnet::DispatchMode, mxnet::OpStatePtr)+0xa9f) [0x7f47923d611f]
  [bt] (6) ./libmxnet.so(mxnet::Imperative::Invoke(mxnet::Context const&, nnvm::NodeAttrs const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&)+0x36a) [0x7f47923d6b6a]
  [bt] (7) ./libmxnet.so(MXImperativeInvokeImpl(void*, int, void**, int*, void***, int, char const**, char const**)+0x9f8) [0x7f47922940b8]
  [bt] (8) ./libmxnet.so(MXImperativeInvoke+0x4c) [0x7f4792294ebc]


Stack trace:
  [bt] (0) ./CrazyAra(dmlc::LogMessageFatal::~LogMessageFatal()+0x43) [0x56357cc34483]
  [bt] (1) ./CrazyAra(mxnet::cpp::Operator::Invoke(std::vector<mxnet::cpp::NDArray, std::allocator<mxnet::cpp::NDArray> >&)+0x583) [0x56357cc38fb3]
  [bt] (2) ./CrazyAra(mxnet::cpp::Operator::Invoke(mxnet::cpp::NDArray&)+0x9f) [0x56357cc3939f]
  [bt] (3) ./CrazyAra(mxnet::cpp::NDArray::Copy(mxnet::cpp::Context const&) const+0xbd) [0x56357cc6247d]
  [bt] (4) ./CrazyAra(NeuralNetAPI::load_parameters(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x592) [0x56357cc5cad2]
  [bt] (5) ./CrazyAra(NeuralNetAPI::NeuralNetAPI(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x433) [0x56357cc5e463]
  [bt] (6) ./CrazyAra(CrazyAra::is_ready()+0x809) [0x56357cc31449]
  [bt] (7) ./CrazyAra(CrazyAra::uci_loop(int, char**)+0x8ed) [0x56357cc3364d]
  [bt] (8) ./CrazyAra(main+0x4b) [0x56357cb427fb]


Aborted (core dumped)

CrazyAra ignoring my UCI "Threads" option

Because the CUDA version with cpu as Context did already work so far, I decided to try that already. I set the number of threads to use to one (same problem appears when picking 2 threads, didn't test for other values).

uci
setoption name Context value cpu
setoption name Threads value 1
isready
go movetime 5000

Screenshot from 2019-08-27 21-50-53

As confirmed with both htop and the System Monitor, CrazyAra takes up 100% of all my cores when thinking of a move, but that really shouldn't happen if I only specify one thread.

High memory usage (original: Tree doesn't grow beyond 6 million Nodes)

Hi Johannes,
First of all, congratulations on your latest release! This engine plays remarkably different from any others I have seen, and it seems to do so at a very high level.
I noticed an issue in infinite analysis. Once the engine hit somewhere between 5 and 6 million nodes it slowed down quite dramatically and didn't grow much after 6.3 million. Is this issue due to RAM limit?

My PC:

  1. i7-4790k
  2. NVIDIA RTX 2070 Super
  3. 8 GB DDR3 RAM.

Thank you for your wonderful contribution to chess! Let me know how I can reach you out for a potential collaboration.
Tanmay Srinath.

Decativate virtual loss when showing evaluation

Virtual loss is applied during the analysis which is mainly visible on low nps systems (e.g. CPU only back-end), i.e. the starting position for White is evaluated with a negative evaluation at low node counts.

It would be more better to deactivate it when logging to the console.

TensorRT Memory Free Error

You may run into

Unexpected Internal Error: [virtualMemoryBuffer.cpp::~StdVirtualMemoryBufferImpl::121] Error Code 1: Cuda Runtime (driver shutting down)

after building with the trt-files with TensorRT >= 8.2.0.6 and quitting the engine.
However, using the TensorRT files should still works as expected.

Log File

In trying to gather more information regarding #74, games were playing with the Log_File option.
Unfortunately, it looks like the log file is overwritten with each new game.
Many engines either append to the existing log file or create a new one with a unique name sequence.
Either option would be more helpful, IMO.
Thank you for sharing you work.

Something wrong with lichess-bot program

For some reason, CrazyAra is the only engine that I cant make it play on lichess, whenever I start a game, lichess-bot console shows me, after 20 minutes, this message

crazyara error

I know this has to be a problem of the lichess-bot program, (i have succesfuly played vs CrazyAra at cutechess UCI) but since their github page is basically abandoned, I want to know if you can help me with this issue.

CrazyAra nodes decreasing after 16 million nodes

After 16.2 million nodes, CrazyAra node count starts going down (and also NPS). Not sure if this is a bug or intentional in some way.
image
As you can see it reached a max of around 16.3 mio nodes, then every second after it decreased by around 500nodes/second.

Engine sometimes accepts draws in winning position

This seems to be related to the fact that terminal nodes can be visited more often.

Example game:

[Event "My Tournament"]
[Site "?"]
[Date "2021.04.18"]
[Round "9"]
[White "ClassicAra 0.9.1 - TB"]
[Black "ClassicAra 0.9.0"]
[Result "1/2-1/2"]
[ECO "B90"]
[GameDuration "00:00:29"]
[GameEndTime "2021-04-18T01:50:38.425 CEST"]
[GameStartTime "2021-04-18T01:50:09.327 CEST"]
[Opening "Sicilian"]
[PlyCount "146"]
[TimeControl "10+0.1"]
[Variation "Najdorf, Byrne (English) attack"]

1. e4 {book} c5 {book} 2. Nf3 {book} d6 {book} 3. d4 {book} cxd4 {book}
4. Nxd4 {book} Nf6 {book} 5. Nc3 {book} a6 {book} 6. Be3 {book} e5 {book}
7. Nb3 {book} Be6 {book} 8. f3 {book} Be7 {book} 9. Qd2 {book} h5 {book}
10. O-O-O {book} Nbd7 {book} 11. Kb1 {-0.03/21 0.36s} Rc8 {+0.16/22 0.36s}
12. Nd5 {-0.06/22 0.37s} Nxd5 {+0.17/24 0.37s} 13. exd5 {-0.20/22 0.37s}
Bf5 {+0.19/24 0.37s} 14. Bd3 {-0.15/22 0.37s} Bxd3 {+0.17/19 0.37s}
15. Qxd3 {-0.11/20 0.38s} Bg5 {+0.18/20 0.37s} 16. Bf2 {-0.05/23 0.38s}
O-O {+0.08/22 0.38s} 17. h4 {0.00/23 0.38s} Bf4 {+0.12/22 0.39s}
18. g3 {-0.05/24 0.38s} Bh6 {+0.09/23 0.38s} 19. g4 {+0.02/19 0.38s}
Bf4 {+0.14/20 0.38s} 20. gxh5 {+0.07/20 0.38s} Nf6 {-0.03/19 0.39s}
21. Rhg1 {+0.17/19 0.39s} Qd7 {-0.03/18 0.39s} 22. Nd2 {+0.19/21 0.39s}
Nxh5 {-0.08/20 0.39s} 23. Ne4 {+0.11/19 0.39s} f5 {-0.06/19 0.39s}
24. Ng5 {+0.16/27 0.40s} Bxg5 {-0.12/29 0.40s} 25. Rxg5 {+0.16/29 0.40s}
Nf4 {-0.19/23 0.40s} 26. Qd2 {+0.28/23 0.40s} Rf6 {-0.32/24 0.40s}
27. Be3 {+0.46/23 0.40s} Nh3 {-0.49/22 0.41s} 28. Rg2 {+0.56/20 0.41s}
f4 {-0.65/20 0.41s} 29. Bb6 {+0.64/19 0.42s} e4 {-0.46/26 0.42s}
30. fxe4 {+0.79/17 0.42s} f3 {-0.88/28 0.42s} 31. Rg3 {+0.86/27 0.24s}
f2 {-1.00/25 0.23s} 32. Qd3 {+1.37/30 0.23s} Nf4 {-1.33/26 0.23s}
33. Qf1 {+1.37/25 0.22s} Qa4 {-1.25/23 0.22s} 34. Qxf2 {+1.33/30 0.22s}
Nh5 {-1.05/29 0.22s} 35. b3 {+1.18/28 0.21s} Rxf2 {-0.91/27 0.21s}
36. bxa4 {+0.95/26 0.20s} Nxg3 {-0.79/25 0.20s} 37. Bxf2 {+0.81/24 0.20s}
Nxe4 {-0.78/27 0.20s} 38. Be1 {+0.85/26 0.19s} Rc4 {-0.77/26 0.20s}
39. a5 {+0.87/27 0.19s} Nc3+ {-0.81/25 0.19s} 40. Bxc3 {+0.85/26 0.18s}
Rxc3 {-0.91/22 0.18s} 41. Rd4 {+1.07/21 0.18s} Rc5 {-1.02/25 0.18s}
42. Rb4 {+1.17/25 0.18s} Rxa5 {-1.10/23 0.17s} 43. Kb2 {+1.25/23 0.17s}
Rxd5 {-1.13/21 0.17s} 44. Rxb7 {+1.20/20 0.17s} Rh5 {-1.09/19 0.17s}
45. Ra7 {+1.24/21 0.17s} Rxh4 {-1.08/21 0.17s} 46. Rxa6 {+1.20/20 0.17s}
Rd4 {-1.00/20 0.16s} 47. Kc3 {+1.13/20 0.16s} Rd5 {-0.96/19 0.16s}
48. Kc4 {+1.00/15 0.16s} Rc5+ {-0.75/14 0.16s} 49. Kb3 {+0.94/13 0.15s}
Rb5+ {-0.80/16 0.15s} 50. Kc3 {+0.75/11 0.15s} Rc5+ {-0.56/10 0.15s}
51. Kb3 {+0.71/13 0.15s} Rb5+ {-0.84/18 0.15s} 52. Ka4 {+1.01/17 0.14s}
Rb2 {-1.10/17 0.14s} 53. Rxd6 {+1.09/19 0.14s} Rxa2+ {-1.05/20 0.14s}
54. Kb3 {+0.83/19 0.14s} Ra8 {-0.95/21 0.14s} 55. c4 {+0.68/19 0.14s}
Kf7 {-0.64/17 0.14s} 56. c5 {+0.59/16 0.14s} g5 {-0.58/22 0.14s}
57. Rd1 {+1.18/17 0.14s} Rg8 {-0.88/23 0.14s} 58. Kb4 {+2.47/19 0.14s}
g4 {-1.11/22 0.13s} 59. c6 {+1.94/23 0.13s} g3 {-1.06/23 0.13s}
60. Ka5 {+1.82/19 0.13s} g2 {-1.05/20 0.13s} 61. c7 {+4.80/21 0.13s}
Ke7 {-1.25/22 0.13s} 62. Kb6 {+3.88/20 0.13s} Rg6+ {-1.37/24 0.13s}
63. Kb7 {+10.12/15 0.13s} g1=Q {-1.73/24 0.13s} 64. Rxg1 {+14.06/9 0.13s}
Rxg1 {-2.01/20 0.12s} 65. c8=Q {+7.18/29 0.12s} Rb1+ {-2.01/19 0.12s}
66. Ka7 {+8.82/17 0.12s} Ra1+ {-1.56/21 0.13s} 67. Kb8 {+8.89/21 0.12s}
Rb1+ {-0.33/8 0.12s} 68. Ka8 {+8.41/21 0.12s} Ra1+ {-0.62/22 0.12s}
69. Kb7 {+11.55/17 0.12s} Rb1+ {0.00/1 0.12s} 70. Ka7 {+9.21/19 0.12s}
Ra1+ {-0.93/19 0.12s} 71. Kb8 {+8.97/15 0.12s} Rb1+ {-0.05/4 0.12s}
72. Ka8 {+8.18/23 0.11s} Ra1+ {-0.01/3 0.12s} 73. Kb7 {0.00/2 0.12s}
Rb1+ {0.00/1 0.11s, Draw by 3-fold repetition} 1/2-1/2

Support for other variants

Greetings,

Crazyara was really well done and it's one of the finest works I've ever seen.

However I do have a really basic question, does it support other variants besides crazyhouse?

I downloaded Crazyara 0.7 and it shows up crazyhouse plus giveaway chess in the UCI_Variant options, and since I saw references for all the lichess variants I'm curious about it.

Best Regards,

Mistaken Evaluations by Classic Ara

Position 1:

r1b2kr1/bpp1qp2/p3nNn1/1P2P2p/P1B3p1/2P3B1/5PP1/RN2QRK1 w - - 0 23

Here Classic Ara wants to take on g8 with 23.Nxg8 at 1 million nodes, whereas it's a mistake. I ran a self play game from here and it ended up losing as White. Instead, 23.Bxe6 is stronger.

lichess.org bot issues

i tried to use crazyara for lichess bot but even with the weights files in engines folder it didnt work.

cutechess support windows 10

You write: "If the default maximum start-up time for external GUIs (e.g. cutechess) is not increased, it can happen that the GUI kills the CrazyAra process because of not responding in time."

This is happening to me. Starting it directly and then the command "isready" works. Is there a way around it? Are there other ways to match it with other engines beside the quirky command-line-uci-style?

crazyara 0.60 cuda worked very well !

Thanks for your effort!

Crash when calling ucinewgame before isready

CrazyAra crashes when calling ucinewgame before isready.

This occures when using python-chess 0.31.4.

import chess
import chess.engine
import chess.variant
import os

os.chdir("/root/CrazyAra_0.8.0_Linux_MKL/")
engine = chess.engine.SimpleEngine.popen_uci("/root/CrazyAra_0.8.0_Linux_MKL/CrazyAra")
## For CPU, comment if want to use GPU
engine.configure({"Context": "cpu"})

board = chess.variant.CrazyhouseBoard()

while not board.is_game_over():
	result = engine.play(board, chess.engine.Limit(time=0.1))
	board.push(result.move)

engine.quit()

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.