lichess-bot-devs / lichess-bot

A bridge between Lichess bots and chess engines
GNU Affero General Public License v3.0
751 stars 443 forks source link

Unexpected `Game drawn by agreement` on move 300 #983

Closed eduherminio closed 3 months ago

eduherminio commented 3 months ago

Describe the bug

A game between bots ended up in a draw by agreement on move 300, before 50 moves rule could be applied and when at least one of the bots doesn't have offer_draw_enabled set to true.

Game link: https://lichess.org/83Acy8Zf

300 is a suspiciously round number, especially after realizing that 150 is also a hard length limit for games to be analyzed (https://github.com/lichess-org/lila/issues/15446).

Questions that would be great to clarify:

Expected behavior

No draw by agreement happens unless there is an option (similar to offer_draw_enabled) explicitly set to true

Logs

                    INFO     Searching for wtime 51950     engine_wrapper.py:727
                             btime 47520 for game rpTfAGLq                      
                    INFO     Source: Engine                engine_wrapper.py:330
                    INFO     Evaluation: 0.14              engine_wrapper.py:330
                    INFO     Depth: 26                     engine_wrapper.py:330
                    INFO     Nodes: 790.1K                 engine_wrapper.py:330
                    INFO     Speed: 399.6Knps              engine_wrapper.py:330
                    INFO     Pv: 301...Bc8 302. Kf4 Bb7    engine_wrapper.py:330
                             303. Be5 Ba8 304. Bc3 Bc6                          
                             305. Be5 Bd7 306. Bc3 Bc8                          
                             307. Be5 Ba6 308. Bc3 Bd3                          
                             309. Be5 Be2 310. Bb2 Bb5                          
                             311. Bc3 Ke6 312. Bd4 Bd7                          
                             313. Bb2 Bc6 314. Be5   
                    INFO     ***                              conversation.py:58
                             https://lichess.org/83Acy8Zf/bla                   
                             ck [player] SimpleChessEngine:                     
                             Source: Engine, Evaluation:                        
                             0.39, Depth: 17, Nodes: 593.5K,                    
                             Speed: 4.5Mnps, Pv: 301. Ke3 Bc6                   
                             302. Bb2 Bb5 303. Bc3 Bc4 304.                     
                             Ba1 Bb5 305. Bd4                                   
                    INFO     ***                              conversation.py:58
                             https://lichess.org/83Acy8Zf/bla                   
                             ck [spectator]                                     
                             SimpleChessEngine: Source:                         
                             Engine, Evaluation: 0.39, Depth:                   
                             17, Nodes: 593.5K, Speed:                          
                             4.5Mnps, Pv: 301. Ke3 Bc6 302.                     
                             Bb2 Bb5 303. Bc3 Bc4 304. Ba1                      
                             Bb5 305. Bd4                                       
                    INFO     Game ended in a draw.            lichess-bot.py:892
                    INFO     Game drawn by agreement.         lichess-bot.py:909
                    INFO     ***                             conversation.py:102
                             https://lichess.org/83Acy8Zf/bl                    
                             ack [player] Lynx_BOT: gg                          
                    INFO     ***                             conversation.py:102
                             https://lichess.org/83Acy8Zf/bl                    
                             ack [spectator] Lynx_BOT: Thx                      
                             for watching!

v2024.1.15.1

MarkZH commented 3 months ago

Do you have debugging logs for this game? Look in the lichess_bot_auto_logs directory and post them here. That would let us see the messages between lichess and your bot, as well as your configuration.

If you don't have those logs, please post your configuration file, and make sure to delete the token line before posting.

AttackingOrDefending commented 3 months ago

Lichess automatically draws all games after 300 moves (e.g. see here). I can't find it documented anywhere by lichess, nor can I understand typescript to find where the code is, but I was aware of this rule. This is the first time I have seen this rule come into action in a game. We can probably document this somewhere on lichess-bot for future users.

Edit: Found the code from reddit (see here for the code and here for the commit).

eduherminio commented 3 months ago

Lichess automatically draws all games after 300 moves (e.g. see here). I can't find it documented anywhere by lichess, nor can I understand typescript to find where the code is, but I was aware of this rule. This is the first time I have seen this rule come into action in a game. We can probably document this somewhere on lichess-bot for future users.

Edit: Found the code from reddit (see here for the code and here for the commit).

Thanks for the clarification @AttackingOrDefending, good to know it has nothing to do with BOT accounts and there's no way to change it via configuration