ArjunBasandrai / elixir-chess-engine

UCI chess engine
https://lichess.org/@/ElixirChessEngine
GNU General Public License v3.0
9 stars 2 forks source link

loses on time #48

Closed tissatussa closed 5 months ago

tissatussa commented 5 months ago

in CuteChess (GUI) it lost on time !?

elixir-v0 1-PR45-loses-on-time

i let elixir (PR42 and PR45) play many games against other engines but this never happened .. here's the CuteChess GUI log tail :

[...]
<Elixir v0.1 PR45(47): info score cp -2467 depth 15 seldepth 31 nodes 657313 time 438 nps 1497296 pv e4d4 d5f5 d3e2 f5e6 e2d3 e6f5 d3e2 f5e6 e2d3 e6e3 d3c4 e3e2 c4b3 e2e3 b3c4 e3c1 c4d5 c1c6 d5e5 h6g7 e5f4 g7d4 f4f5 c6d6 f5e4 d6e6 e4d4 
<Elixir v0.1 PR45(47): info score cp -2488 depth 16 seldepth 33 nodes 720087 time 475 nps 1512787 pv e4d4 d5f5 d3e2 f5e6 e2d3 e6f5 d3e2 f5e6 e2d3 e6b3 d3e4 b3e3 e4d5 e3f3 d4e4 f3g2 d5e5 g2d2 e4e1 d2e1 e5d5 h6f8 d5d4 e1d1 d4e3 f8c5 e3f4 
<Elixir v0.1 PR45(47): info score mate -9 depth 17 seldepth 35 nodes 779143 time 509 nps 1527731 pv e4d4 d5b3 d3e4 b3e3 e4f5 e3d4 f5e6 d4e4 e6f7 e4f5 f7g8 f5e6 g8h7 h6f8 h7h8 e6f6 h8g8 f6g7 
<Elixir v0.1 PR45(47): info score mate -11 depth 18 seldepth 35 nodes 824937 time 532 nps 1547724 pv e4d4 d5b3 d3e4 b3e3 e4f5 e3d4 f5g6 d4d6 g6f7 d6d5 f7f6 d5e4 f6f7 e4f5 f7e7 h6f8 e7e8 f8c5 e8d8 f5f7 d8c8 f7e8 
<Elixir v0.1 PR45(47): info score mate -11 depth 19 seldepth 29 nodes 862290 time 553 nps 1556480 pv e4d4 d5b3 d3e4 b3e3 e4d5 h6g7 d4e4 e3d3 d5e6 d3e4 e6f7 g7h6 f7f6 e4d5 f6g6 d5e6 g6h7 h6f8 h7h8 e6f6 h8g8 f6g7 
<Elixir v0.1 PR45(47): info score mate -9 depth 20 seldepth 35 nodes 897394 time 574 nps 1560685 pv e4d4 d5b3 d3e4 b3e3 e4f5 e3d4 f5e6 d4e4 e6f7 e4f5 f7e7 h6f8 e7d8 f8c5 d8e8 f5e6 e8d8 e6f7 d8c8 f7f5 c8d8 c5f8 d8e8 f8g7 e8d8 g7f8 d8e8 f8c5 
<Elixir v0.1 PR45(47): info score mate -8 depth 21 seldepth 41 nodes 1048724 time 646 nps 1620902 pv e4d4 d5b3 d3e2 b3e3 e2d1 e3d4 d1c2 d4d2 c2b3 d2d3 b3b2 h6g7 b2c1 d3e2 c1b1 e2b2 
<Elixir v0.1 PR45(47): info score mate -10 depth 22 seldepth 39 nodes 1277694 time 748 nps 1705866 pv e4d4 d5b3 d3e4 b3e3 e4f5 e3d4 f5g6 d4d6 g6f7 d6d5 f7f6 d5e4 f6f7 e4f5 f7e7 h6f8 e7d8 f5e4 d8c8 e4e8 
<Elixir v0.1 PR45(47): info score mate -8 depth 23 seldepth 41 nodes 1367614 time 795 nps 1718108 pv e4d4 d5b3 d3e4 b3e3 e4f5 e3d4 f5g6 d4d6 g6f7 d6f4 f7e7 f4e5 e7d7 e5f5 d7d6 f5f6 d6d5 f6f3 d5e6 h6g7 e6d6 f3f4 d6d5 f4f5 d5c4 f5e4 c4b3 e4e2 b3a3 g7d4 a3b3 e2d3 b3a4 d4g7 a4b4 d3c2 
<Elixir v0.1 PR45(47): info score mate -7 depth 24 seldepth 45 nodes 1728599 time 963 nps 1793152 pv e4d4 d5b3 d3e4 b3e3 e4f5 e3d4 f5g6 d4g7 g6f5 g7f7 f5e4 f7e6 e4d3 h6g7 d3d2 e6e4 d2d1 e4e3 d1c2 g7d4 c2b1 e3e4 b1c1 e4e2 c1b1 d4g7 b1c1 g7h6 c1b1 e2d1 b1b2 d1d2 b2b3 d2d3 b3a2 
<Elixir v0.1 PR45(47): info score mate -7 depth 25 seldepth 43 nodes 1819996 time 1010 nps 1800193 pv e4d4 d5b3 d3e4 b3e3 e4f5 e3d4 f5g6 d4g7 g6f5 g7f7 f5e4 f7e6 e4d4 h6g7 d4d3 e6e8 d3c4 e8e4 c4b3 e4d3 b3a2 d3e3 a2b1 e3c3 b1a2 c3c2 a2a3 c2c3 a3a2 c3e3 a2b1 e3d3 b1c1 g7h6 c1b2 d3c4 b2a1 c4d3 
<Elixir v0.1 PR45(47): info score mate -7 depth 26 seldepth 45 nodes 1936930 time 1067 nps 1813604 pv e4d4 d5b3 d3e4 b3e3 e4f5 e3d4 f5g6 d4g7 g6f5 g7f7 f5e4 f7e6 e4d4 h6g7 d4d3 e6e8 d3c4 e8e4 c4b3 e4d3 b3b4 d3e4 b4b3 e4d3 b3b4 d3c2 b4a3 c2c3 a3a2 c3c4 a2a3 c4d4 a3a2 d4d5 a2a3 d5f3 a3a2 f3c3 a2b1 c3d3 b1c1 g7h6 c1b2 
<Elixir v0.1 PR45(47): bestmove e4d4
>Integral v1(46): isready
>Elixir v0.1 PR45(47): isready
<Integral v1(46): readyok
<Elixir v0.1 PR45(47): readyok
ArjunBasandrai commented 5 months ago

Hi,

Thanks for sharing this issue, I noticed this is happening on some of my tests too.

Would it be possible for you to share the complete uci commands that were used? I would help greatly in debugging this issue

tissatussa commented 5 months ago

...share the complete uci commands that were used?...

you mean the complete log ? That's gone .. CuteChess acts always the same, it's just :

uci ucinewgame position startpos go wtime ......

and a bestmove is given. after the opponent move, it continues with :

position fen [..] moves [moves-played-so-far] etc

am i right ? that's all i know .. maybe this happens again (but i doubt it), then i will save the full log.

tissatussa commented 5 months ago

i see all last moves are done within (about) 3 seconds, even until the very end : is your time management correct ?

ArjunBasandrai commented 5 months ago

What time control did you run the games on?

tissatussa commented 5 months ago

What time control did you run the games on?

7m+3s here's that game :

[Event "engine vs engine"]
[Site "Holland"]
[Date "2024.06.06"]
[Round "?"]
[White "Integral v1"]
[Black "Elixir v0.1 PR45"]
[Result "1-0"]
[ECO "C55"]
[GameDuration "00:22:10"]
[Opening "Two knights defense (Modern Bishop's Opening)"]
[PlyCount "211"]
[Termination "time forfeit"]
[TimeControl "420+3"]

1. e4 {+0.16/25 11s} e5 {-0.22/23 23s} 2. Nf3 {+0.11/25 11s} Nc6 {-0.22/23 22s}
3. Bc4 {+0.13/25 14s} Nf6 {-0.20/23 21s} 4. d3 {+0.12/26 11s} Be7 {-0.18/23 20s}
5. Nc3 {+0.15/25 7.5s} d6 {-0.23/23 20s} 6. Nd5 {0.00/26 21s} Na5 {-0.09/23 19s}
7. Nxe7 {+0.15/26 9.4s} Qxe7 {-0.15/26 18s} 8. Bb3 {+0.14/26 11s}
Nxb3 {-0.15/25 17s} 9. axb3 {+0.14/26 13s} Be6 {-0.15/23 17s}
10. O-O {+0.16/26 13s} O-O {-0.15/23 16s} 11. Re1 {+0.20/23 8.0s}
c5 {-0.12/21 15s} 12. c3 {+0.21/24 11s} h6 {-0.08/23 15s} 13. d4 {+0.26/24 6.1s}
cxd4 {0.00/26 14s} 14. cxd4 {+0.21/24 4.9s} Bg4 {0.00/26 14s}
15. d5 {+0.23/26 7.5s} a6 {-0.01/25 13s} 16. h3 {+0.25/27 12s}
Bh5 {+0.02/25 13s} 17. Qd3 {+0.21/26 6.9s} Nd7 {+0.10/26 12s}
18. b4 {+0.26/26 6.9s} Bg6 {+0.14/24 12s} 19. g4 {+0.19/26 11s}
Rac8 {+0.15/23 11s} 20. Bd2 {+0.18/26 5.7s} Qd8 {+0.16/24 11s}
21. Kg2 {+0.25/25 4.9s} Nf6 {+0.18/24 11s} 22. Ra3 {+0.24/26 12s}
Qb6 {+0.19/24 10s} 23. Nh4 {+0.24/25 7.2s} Bh7 {+0.18/25 9.9s}
24. Nf5 {+0.32/27 5.8s} Bxf5 {+0.26/23 9.6s} 25. gxf5 {+0.40/26 4.6s}
Rfe8 {+0.38/24 9.2s} 26. Rc3 {+0.27/27 7.7s} Kh7 {+0.21/23 8.9s}
27. Kf3 {+0.34/26 12s} Qd4 {+0.26/22 8.7s} 28. Qxd4 {+0.73/29 4.6s}
exd4 {-0.20/27 8.4s} 29. Rxc8 {+1.16/30 4.6s} Rxc8 {-0.10/26 8.1s}
30. Bf4 {+1.26/28 4.3s} d3 {-0.54/25 7.9s} 31. Bxd6 {+1.37/28 4.8s}
Rc4 {-0.90/24 7.7s} 32. Be5 {+1.47/29 6.4s} Nxe4 {-1.47/23 7.4s}
33. d6 {+1.66/28 4.0s} Nf6 {-1.31/24 7.2s} 34. Re3 {+1.48/30 4.9s}
Nd7 {-1.56/23 7.0s} 35. Bc3 {+1.57/29 3.9s} d2 {-1.55/25 6.8s}
36. Ke2 {+1.35/32 13s} Rc6 {-1.57/23 6.7s} 37. Rd3 {+1.42/29 3.7s}
g6 {-1.42/24 6.5s} 38. fxg6+ {+1.42/27 3.7s} Kxg6 {-1.53/24 6.3s}
39. Bxd2 {+1.55/27 3.9s} h5 {-1.54/25 6.2s} 40. Rd5 {+1.43/26 7.2s}
Rc2 {-1.52/24 6.0s} 41. b3 {+1.58/27 5.9s} Rb2 {-1.59/25 5.9s}
42. Rd3 {+1.56/28 4.7s} Rc2 {-1.56/24 5.7s} 43. h4 {+1.49/29 8.3s}
Kf5 {-1.56/22 5.6s} 44. Rd5+ {+1.55/26 4.6s} Ke6 {-1.60/23 5.5s}
45. Rxh5 {+1.46/25 3.4s} Kxd6 {-1.60/23 5.4s} 46. Rh6+ {+1.40/24 4.2s}
Ke5 {-1.63/24 5.2s} 47. Kd3 {+1.52/25 4.9s} Rc7 {-1.59/25 5.1s}
48. Rh5+ {+1.24/23 6.5s} Ke6 {-1.61/20 5.0s} 49. Rh8 {+1.31/24 7.2s}
Ne5+ {-1.31/21 4.9s} 50. Ke2 {+1.41/24 4.3s} Ng6 {-1.15/22 4.8s}
51. Rh7 {+1.37/26 4.6s} Ne5 {-1.38/21 4.8s} 52. h5 {+1.49/23 3.4s}
Nc6 {-1.60/22 4.7s} 53. Rh8 {+1.46/24 5.2s} Nd4+ {-1.73/22 4.6s}
54. Kd3 {+1.63/25 3.9s} Rd7 {-1.83/20 4.5s} 55. Kc4 {+1.55/24 7.0s}
Kf5 {-1.30/20 4.4s} 56. Be3 {+1.28/26 5.7s} Nc2 {-1.28/23 4.4s}
57. Bb6 {+1.33/28 4.9s} Na3+ {-1.24/23 4.3s} 58. Kc3 {+1.24/28 5.6s}
Nb5+ {-1.21/23 4.2s} 59. Kb2 {+1.17/28 6.5s} f6 {-1.15/25 4.2s}
60. Be3 {+1.14/26 5.2s} Nc7 {-1.08/25 4.1s} 61. Kc2 {+1.16/26 4.2s}
Nd5 {-1.43/23 4.1s} 62. Bd2 {+0.98/27 3.4s} Rc7+ {-1.38/25 4.0s}
63. Kd1 {+0.99/30 5.7s} Rd7 {-1.09/25 4.0s} 64. Rg8 {+0.96/31 5.5s}
Nf4 {-1.22/26 3.9s} 65. h6 {+1.03/30 3.4s} Rh7 {-1.14/27 3.9s}
66. Rg7 {+0.95/31 4.2s} Rxh6 {-1.32/26 3.8s} 67. Rxb7 {+1.01/31 7.1s}
Rh1+ {-1.32/25 3.8s} 68. Kc2 {+0.96/30 4.2s} Rf1 {-1.14/24 3.8s}
69. Ra7 {+1.55/29 3.0s} Rxf2 {-1.54/23 3.7s} 70. Rxa6 {+1.49/29 2.6s}
Ne6 {-1.30/23 3.7s} 71. b5 {+1.44/29 5.2s} Nc5 {-1.52/23 3.7s}
72. Rd6 {+1.46/30 2.9s} Ne4 {-1.82/23 3.6s} 73. Rd5+ {+1.50/30 6.2s}
Ke6 {-1.85/25 3.6s} 74. b6 {+1.50/31 4.7s} Nd6 {-1.86/24 3.6s}
75. Rd4 {+1.97/25 4.7s} Rg2 {-1.83/26 3.5s} 76. Kd1 {+1.99/26 3.8s}
f5 {-1.83/24 3.5s} 77. Bf4 {+2.12/29 3.1s} Nb7 {-1.99/22 3.5s}
78. Rc4 {+2.09/28 3.8s} Rg4 {-2.33/24 3.5s} 79. Ke2 {+2.30/28 3.4s}
Kd5 {-2.26/27 3.4s} 80. Kd3 {+2.36/29 3.2s} Rh4 {-2.07/20 3.4s}
81. Kc3 {+2.51/29 2.8s} Rh3+ {-2.43/21 3.4s} 82. Kb4 {+2.82/27 2.6s}
Rf3 {-3.06/23 3.4s} 83. Bg5 {+3.09/28 2.6s} Rg3 {-3.25/24 3.4s}
84. Be7 {+3.22/27 2.5s} f4 {-3.27/24 3.4s} 85. Rxf4 {+3.33/26 3.0s}
Ke6 {-3.44/21 3.3s} 86. Bf8 {+3.40/26 2.5s} Nd8 {-3.39/23 3.3s}
87. Re4+ {+3.45/27 3.2s} Kd7 {-3.73/21 3.3s} 88. Rc4 {+3.87/27 2.6s}
Nc6+ {-4.24/24 3.3s} 89. Ka4 {+4.05/26 2.7s} Rg5 {-4.35/27 3.3s}
90. b4 {+4.68/27 2.9s} Rf5 {-5.32/23 3.3s} 91. b5 {+5.57/28 3.0s}
Nb8 {-6.09/25 3.2s} 92. Bb4 {+6.69/27 2.9s} Rf6 {-6.85/23 3.2s}
93. Rc7+ {+9.50/28 2.6s} Ke6 {-7.31/22 3.2s} 94. Rc8 {+9.88/28 2.7s}
Nd7 {-10.17/24 3.2s} 95. b7 {+9.96/28 2.9s} Rf4 {-11.87/24 3.2s}
96. Re8+ {+11.04/27 2.5s} Kf5 {-12.36/20 3.2s} 97. Ka5 {+12.09/26 2.7s}
Rf1 {-12.94/21 3.2s} 98. Rf8+ {+13.61/27 2.5s} Nxf8 {-15.63/21 3.2s}
99. Bxf8 {+14.66/25 2.6s} Ra1+ {-16.43/21 3.2s} 100. Kb6 {+18.32/25 2.6s}
Ra4 {-16.85/22 3.2s} 101. b8=Q {+19.86/26 2.5s} Re4 {-17.61/22 3.2s}
102. Qc8+ {+999344.46/26 4.0s} Kf4 {-18.30/21 3.1s} 103. Qc7+ {+M47/26 4.6s}
Kf3 {-24.88/24 3.1s} 104. Qc6 {+M45/26 3.0s} Ke3 {-24.88/26 3.1s}
105. Bh6+ {+M29/36 4.3s} Kd3 {-M18/25 3.1s}
106. Qd5+ {+M23/43 4.3s, Black loses on time} 1-0
tissatussa commented 5 months ago

so Elixir played all last moves in bonus time ..

ArjunBasandrai commented 5 months ago

Thanks for providing the PGN log. Do you by any chance have the uci command history? Because that would be really helpful in debugging as I will be able reproduce this error properly

tissatussa commented 5 months ago

CuteChess logs all input & output in its "engine debug" pane (window), but as soon as a next game starts, this log will be overwritten .. this happens even when switching tabs .. after this game (and the sudden ending) i decided to save only the log tail, not the full log, sorry.

i don't think the full "uci command history" will help you solve this issue .. i really think it's about the time management : Elixer used only (!) the bonus time for all last moves (3 sec) and at one moment it spent a little longer, so CuteChess made it a loss.

tissatussa commented 5 months ago

by chance the last game had the same issue : Elixir lost on time .. i was shopping for a while and i left the engine debug pane open ! So here's the FULL log : Elixir 0.1 PR49 lost on time.zip

ArjunBasandrai commented 5 months ago

Thanks for sharing this! I will look into this and get back to you once its fixed

ArjunBasandrai commented 5 months ago

Hi,

The time losses issues should be fixed now, with the inclusion of a better time management scheme!

Kindly check the v1 release on the release page for latest binaries.

tissatussa commented 5 months ago

..check the v1 release..

I will and report my findings.

Today i used ChatGPT to know more about compiling C / C++ code. This AI was a great help, i saved the page : ChatGPT-about-compiling-C-C++-code.zip It might interest you.

tissatussa commented 5 months ago

i've successfully compiled v1.0 on Linux and it runs fine in CuteChess. and it's rather strong : it beats Zorgus v1.2.0 (~2300), Integral v1 (2830 Blitz), Minko v1.3 (2900, but lost also) and it draws Boychesser v1.0 (2718) and Zurichess Neuchatel (2838). Elixir v1.0 spends its time VERY good ! It consumes almost all its time, and it never ran out of time.

well done ! btw. Elixir v1.0 is also mentioned in a newest Chess Diary entry, with this nice image :

elixir-v1 0-chess-diary-360x360