Torom / BotLi

Lichess Bot
GNU Affero General Public License v3.0
44 stars 82 forks source link

Unexpected warnings during engine startup / game play #148

Closed IbaiBuR closed 11 months ago

IbaiBuR commented 11 months ago

Please read, understand and follow: https://lichess.org/@/thibault/blog/how-to-ask-technical-questions/1HSthDSX

Describe the bug Since this commit: https://github.com/Torom/BotLi/commit/97ecdf1501a9e656b3e2f6bc0563b7164bb5ff68 BotLi makes a little test of the engines at startup to verify everything is working correctly, but, on my side, I get a bunch of warnings. The same warnings are shown during game play too.

To Reproduce Steps to reproduce the behavior:

  1. Go to your BotLi folder
  2. Start the bot (python3 user_interface.py)
  3. See error (A lot of warnings suddenly appear)

Expected behavior Instead of showing the warnings it should just say "OK"

Information:

Config: Paste your config.yml here REMOVE YOUR TOKEN:

token: ""         # Lichess OAuth2 Token.

engines:
  standard:                               # Engine used for standard chess and when no suitable special engine is configured.
    dir: "./engines"                      # Directory containing the engine.
    name: "stockfish"                     # Binary name of the engine to use.
    ponder: true                          # Think on opponent's time.
    use_syzygy: true                      # Whether the engine should be configured to use syzygy.
    silence_stderr: true                  # Suppresses stderr output.
    uci_options:                          # Arbitrary UCI options passed to the engine. (Commenting allowed)
      Threads: 6                          # Max CPU threads the engine can use.
      Hash: 1024                          # Max memory (in megabytes) the engine can allocate.
      Move Overhead: 350                  # Increase if your bot flags games too often.
      SyzygyPath: "/home/upm/BotLi/engines/syzygy"
      SyzygyProbeLimit: 5
  blitz:                                  # Engine used for standard chess and when no suitable special engine is configured.
    dir: "./engines"                      # Directory containing the engine.
    name: "BlackHole"                     # Binary name of the engine to use.
    ponder: true                          # Think on opponent's time.
    use_syzygy: true                      # Whether the engine should be configured to use syzygy.
    silence_stderr: true                  # Suppresses stderr output.
    uci_options:                          # Arbitrary UCI options passed to the engine. (Commenting allowed)
      Threads: 6                          # Max CPU threads the engine can use.
      Hash: 2048                          # Max memory (in megabytes) the engine can allocate.
      Move Overhead: 500                  # Increase if your bot flags games too often.
      SyzygyPath: "/home/upm/BotLi/engines/syzygy"
      SyzygyProbeLimit: 5
      Experience Book: true
      Opening variety: 10
  rapid:                                  # Engine used for standard chess and when no suitable special engine is configured.
    dir: "./engines"                      # Directory containing the engine.
    name: "BlackHole"                     # Binary name of the engine to use.
    ponder: true                          # Think on opponent's time.
    use_syzygy: true                      # Whether the engine should be configured to use syzygy.
    silence_stderr: true                  # Suppresses stderr output.
    uci_options:                          # Arbitrary UCI options passed to the engine. (Commenting allowed)
      Threads: 6                          # Max CPU threads the engine can use.
      Hash: 3072                          # Max memory (in megabytes) the engine can allocate.
      Move Overhead: 500                  # Increase if your bot flags games too often.
      SyzygyPath: "/home/upm/BotLi/engines/syzygy"
      SyzygyProbeLimit: 5
      Experience Book: true
      Opening variety: 15
  classical:                              # Engine used for standard chess and when no suitable special engine is configured.
    dir: "./engines"                      # Directory containing the engine.
    name: "BlackHole"                     # Binary name of the engine to use.
    ponder: true                          # Think on opponent's time.
    use_syzygy: true                      # Whether the engine should be configured to use syzygy.
    silence_stderr: true                  # Suppresses stderr output.
    uci_options:                          # Arbitrary UCI options passed to the engine. (Commenting allowed)
      Threads: 6                          # Max CPU threads the engine can use.
      Hash: 4096                          # Max memory (in megabytes) the engine can allocate.
      Move Overhead: 500                  # Increase if your bot flags games too often.
      SyzygyPath: "/home/upm/BotLi/engines/syzygy"
      SyzygyProbeLimit: 5
      Experience Book: true
      Opening variety: 20

syzygy:
  enabled: true                           # Activate local syzygy endgame tablebases.
  paths:                                  # Paths to local syzygy endgame tablebases.
    - "./engines/syzygy"
  max_pieces: 5                           # Count of max pieces in the local syzygy endgame tablebases.
  instant_play: true                      # Whether the bot should play directly from syzygy without engine if possible.

gaviota:
  enabled: false                          # Activate local gaviota endgame tablebases.
  paths:                                  # Paths to local gaviota endgame tablebases.
    - "/path/to/gaviota"
  max_pieces: 5                           # Count of max pieces in the local gaviota endgame tablebases.

opening_books:
  enabled: true                           # Activate opening books.
  priority: 400                           # Priority with which this move source is used. Higher priority is used first.
  books:
#   bullet:
#     selection: weighted_random          # Move selection is one of "weighted_random", "uniform_random" or "best_move".
#     names:                              # List of names of books to use in bullet.
#       - BulletBook
#       - DefaultBook
    standard_white:
      selection: weighted_random          # Move selection is one of "weighted_random", "uniform_random" or "best_move".
      names:
        - "BlackHole"
        - "Book2" 
        - "Book5"  
        - "Book3" 
        - "Book4" 
        - "Book8"  
        - "Book6"  
        - "DarkMatter" 
        - "Book7" 
        - "Book9" 
        - "Book10" 
        - "Book12" 
        - "Book13"
    standard_black:
      selection: best_move               # Move selection is one of "weighted_random", "uniform_random" or "best_move".
      names:
        - "BlackHole"
        - "Book5" 
        - "Book4"  
        - "Book8" 
        - "Book6"  
        - "Book7" 
        - "Book9" 
        - "Book3"  
        - "Book10" 

online_moves:
  opening_explorer:
    enabled: false                        # Activate online moves from Lichess opening explorer. The move that has performed best for this bot is played.
    priority: 300                         # Priority with which this move source is used. Higher priority is used first.
    use_for_variants: false               # Whether the Lichess opening explorer should be used for other variants than standard and chess960.
    min_time: 20                          # Time the bot must have at least to use the online move.
    timeout: 5                            # Time the server has to respond.
    min_games: 5                          # Minimum number of games in which the position must have occurred.
    only_with_wins: false                 # Whether to play only moves that have won before.
    selection: "performance"              # Move selection is "performance" or "win_rate".
    anti: false                           # Whether to play the moves in which the opponent performs the worst.
#   max_depth: 16                         # Half move max depth. (Comment this line for max depth)
#   max_moves: 1                          # Max number of moves played from Lichess opening explorer. (Comment this line for max moves)
  lichess_cloud:
    enabled: false                        # Activate online moves from Lichess cloud eval.
    priority: 200                         # Priority with which this move source is used. Higher priority is used first.
    only_without_book: false              # Whether the cloud should only be used if there is no matching book.
    min_eval_depth: 10                    # Minimum evaluation depth.
    min_time: 20                          # Time the bot must have at least to use the online move.
    timeout: 5                            # Time the server has to respond.
#   max_depth: 16                         # Half move max depth. (Comment this line for max depth)
#   max_moves: 1                          # Max number of moves played from Lichess cloud eval. (Comment this line for max moves)
  chessdb:
    enabled: false                        # Activate online moves from https://chessdb.cn/queryc_en/
    priority: 100                         # Priority with which this move source is used. Higher priority is used first.
    min_eval_depth: 10                    # Minimum evaluation depth.
    min_time: 20                          # Time the bot must have at least to use the online move.
    timeout: 5                            # Time the server has to respond.
#   max_depth: 16                         # Half move max depth. (Comment this line for max depth)
#   max_moves: 1                          # Max number of moves played from chessdb. (Comment this line for max moves)
  online_egtb:
    enabled: true                         # Activate online endgame tablebases from Lichess.
    min_time: 10                          # Time the bot must have at least to use the online move.
    timeout: 2                            # Time the server has to respond.

offer_draw:
  enabled: false                          # Activate whether the bot should offer draw.
  score: 10                               # If the absolute value of the score is less than or equal to this value, the bot offers/accepts draw (in cp)
  consecutive_moves: 100                  # How many moves in a row the absolute value of the score has to be below the draw value
  min_game_length: 350                    # Earliest move in which draw is offered.

resign:
  enabled: false                          # Activate whether the bot should resign games.
  score: -1000                            # If the score is less than or equal to this value, the bot resigns (in cp).
  consecutive_moves: 5                    # How many moves in a row the score has to be below the resign value.

move_overhead_multiplier: 1.0             # Increase if your bot flags games too often. Default move overhead is 1 second per 1 minute initital time.

challenge:                                # Incoming challenges. (Commenting allowed)
  concurrency: 1                          # Number of games to play simultaneously.
  bullet_with_increment_only: false       # Whether bullet games against BOTs should only be accepted with increment.
# min_increment: 0                        # Minimum amount of increment to accept a challenge.
  max_increment: 0                        # Maximum amount of increment to accept a challenge.
  min_initial: 60                         # Minimum amount of initial time to accept a challenge.
  max_initial: 1500                       # Maximum amount of initial time to accept a challenge.
  variants:                               # Chess variants to accept (https://lichess.org/variant).
    - standard
    - chess960
#   - fromPosition
#   - antichess
#   - atomic
#   - crazyhouse
#   - horde
#   - kingOfTheHill
#   - racingKings
#   - threeCheck
  time_controls:                          # Speeds or time controls in initial_minutes+increment_seconds format to accept.
    - 1+0
    - 3+0
    - 5+0
    - 8+0
    - 10+0
    - 25+0
  bot_modes:                              # Game modes to accept against BOTs.
#  - casual                              # Unrated games.
   - rated                               # Rated games
  human_modes:                            # Game modes to accept against humans.
#   - casual                              # Unrated games.
#   - rated                               # Rated games

matchmaking:
  delay: 120                              # Time in seconds the bot must be idle before a new challenge is started.
  timeout: 30                             # Time until a challenge is canceled.
  types:                                  # Matchmaking types of which one is randomly selected before each game.
    bullet:                               # Arbitrary name of the matchmaking type. Names must be unique.
      tc: 1+0                             # Time control in initial_minutes+increment_seconds format.
      rated: true                         # Whether matchmaking should play rated games.
      variant: standard                   # Chess variant (https://lichess.org/variant) to challenge.
      weight: 5                           # Weight with which this type is selected. (Default: 100)
      multiplier: 20                      # Multiplier for calculating timeouts in matchmaking. Higher values lead to a wider range of opponents.
      max_rating_diff: 400
    blitz_1:
      tc: 3+0
      rated: true
      variant: standard
      weight: 25
      multiplier: 20
      max_rating_diff: 400
    blitz_2:
      tc: 5+0
      rated: true
      variant: standard
      weight: 25
      multiplier: 20
      max_rating_diff: 400
    rapid_1:
      tc: 8+0
      rated: true
      variant: standard
      weight: 20
      multiplier: 20
    rapid_2:
      tc: 10+0
      rated: true
      variant: standard
      weight: 20
      multiplier: 20
    classical:
      tc: 25+0
      rated: true
      variant: standard
      weight: 5
      multiplier: 20

messages:
  # Optional substitution keywords (include curly braces):
  #   {opponent} to insert the opponent's name
  #   {me} to insert our name
  #   {engine} to insert engine name
  #   {cpu} to insert CPU information
  #   {ram} to insert RAM size
  # Any other words in curly braces will be removed.
  greeting: "Hey, I'm {me} running {engine}. Good luck! Type !help for a list of commands." # Message sent to the opponent at the beginning of a game.
  goodbye: "Good game {opponent} , see you next time."                                             # Message sent to the opponent after the end of a game.
  greeting_spectators: "Hey, I'm {me} running {engine}. Type !help for a list of commands." # Message sent to the spectators at the beginning of a game.
  goodbye_spectators: "Thanks for watching {me} vs {opponent}."                                           # Message sent to the spectators after the end of a game.

# whitelist:                              # List of users whose challenges are always accepted.
#   - Username1
#   - Username2

blacklist:                              # List of users who are not challenged and whose challenges are declined.
    - ElmiChess
    - actual_magnus
    - Annie_archy
    - chessfyBOT
    - ProteusSF
    - ProteusSF-Open
    - ProteusSF-Lite
    - ProteusSF-Turbo
    - ProteusSF-Godot
    - ProteusSF-Aureo
    - caissa-test
    - LazyBot
    - LazyBotJr
    - LeelaRogue
    - Rinestro
    - LeelaMultiPoss
    - Botyuliirma
    - Vanilla_v2
    - YuliGPrO5
    - Africaata
    - Nikitosikbot
    - Nikitosik-ai
    - NikitosikVariantsbot
    - NikitosikRandombot
    - Atomic_Chess_Bot
    - Nikitosik1708
    - catynok

Additional context It is worth noting that this only happens with engines with self-learning and when Experience Book is enabled. I'll try to explain further. My Stockfish Mod is able to store data and learn from the games it plays. When you enable Experience Book, you are telling the engine to play directly from the experience file (where all the learning data is stored) as if it was a book. I know this case is very specific and probably the warnings are not even made by BotLi but from python-chess instead, but I would like to not see the warnings continously even if they dont affect the bot's performance.

Example of the warnings I am getting:

upm@etsisi00059:~/BotLi$ py user_interface.py 

______       _   _     _ 
| ___ \     | | | |   (_)
| |_/ / ___ | |_| |    _ 
| ___ \/ _ \| __| |   | |
| |_/ / (_) | |_| |___| |
\____/ \___/ \__\_____/_| 20231021-710ae16

Testing engine "standard" ... OK
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -129 nodes 1 nps 0 tbhits 0 time 0 pv g2g4'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -74 nodes 2 nps 0 tbhits 0 time 0 pv f2f3'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -49 nodes 3 nps 0 tbhits 0 time 0 pv h2h4'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -29 nodes 4 nps 0 tbhits 0 time 0 pv f2f4'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -53 nodes 5 nps 0 tbhits 0 time 0 pv g1h3'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -56 nodes 6 nps 0 tbhits 0 time 0 pv b1a3'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -19 nodes 7 nps 0 tbhits 0 time 0 pv b2b4'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -17 nodes 8 nps 0 tbhits 0 time 0 pv a2a4'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 0 nodes 9 nps 0 tbhits 0 time 0 pv h2h3'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 15 nodes 10 nps 0 tbhits 0 time 0 pv e2e3'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 0 nodes 11 nps 0 tbhits 0 time 0 pv d2d3'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 3 nodes 12 nps 0 tbhits 0 time 0 pv b1c3'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -1 nodes 13 nps 0 tbhits 0 time 0 pv b2b3'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -8 nodes 14 nps 0 tbhits 0 time 0 pv a2a3'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 18 nodes 15 nps 0 tbhits 0 time 0 pv g2g3'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 21 nodes 16 nps 0 tbhits 0 time 0 pv c2c4'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 0 nodes 17 nps 0 tbhits 0 time 0 pv c2c3'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 26 nodes 18 nps 0 tbhits 0 time 0 pv g1f3'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 28 nodes 19 nps 0 tbhits 0 time 0 pv e2e4'
WARNING:chess.engine:<UciProtocol (pid=105115)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 27 nodes 20 nps 0 tbhits 0 time 0 pv d2d4'
Testing engine "blitz" ... OK
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -129 nodes 1 nps 0 tbhits 0 time 0 pv g2g4'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -74 nodes 2 nps 0 tbhits 0 time 0 pv f2f3'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -49 nodes 3 nps 0 tbhits 0 time 0 pv h2h4'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -29 nodes 4 nps 0 tbhits 0 time 0 pv f2f4'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -53 nodes 5 nps 0 tbhits 0 time 0 pv g1h3'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -56 nodes 6 nps 0 tbhits 0 time 0 pv b1a3'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -19 nodes 7 nps 0 tbhits 0 time 0 pv b2b4'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -17 nodes 8 nps 0 tbhits 0 time 0 pv a2a4'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 0 nodes 9 nps 0 tbhits 0 time 0 pv h2h3'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 15 nodes 10 nps 0 tbhits 0 time 0 pv e2e3'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 0 nodes 11 nps 0 tbhits 0 time 0 pv d2d3'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 3 nodes 12 nps 0 tbhits 0 time 0 pv b1c3'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -1 nodes 13 nps 0 tbhits 0 time 0 pv b2b3'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -8 nodes 14 nps 0 tbhits 0 time 0 pv a2a3'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 18 nodes 15 nps 0 tbhits 0 time 0 pv g2g3'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 21 nodes 16 nps 0 tbhits 0 time 0 pv c2c4'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 0 nodes 17 nps 0 tbhits 0 time 0 pv c2c3'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 26 nodes 18 nps 0 tbhits 0 time 0 pv g1f3'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 28 nodes 19 nps 0 tbhits 0 time 0 pv e2e4'
WARNING:chess.engine:<UciProtocol (pid=105149)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 27 nodes 20 nps 0 tbhits 0 time 0 pv d2d4'
Testing engine "rapid" ... OK
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -129 nodes 1 nps 0 tbhits 0 time 0 pv g2g4'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -74 nodes 2 nps 0 tbhits 0 time 0 pv f2f3'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -49 nodes 3 nps 0 tbhits 0 time 0 pv h2h4'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -29 nodes 4 nps 0 tbhits 0 time 0 pv f2f4'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -53 nodes 5 nps 0 tbhits 0 time 0 pv g1h3'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -56 nodes 6 nps 0 tbhits 0 time 0 pv b1a3'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -19 nodes 7 nps 0 tbhits 0 time 0 pv b2b4'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -17 nodes 8 nps 0 tbhits 0 time 0 pv a2a4'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 0 nodes 9 nps 0 tbhits 0 time 0 pv h2h3'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 15 nodes 10 nps 0 tbhits 0 time 0 pv e2e3'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 0 nodes 11 nps 0 tbhits 0 time 0 pv d2d3'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 3 nodes 12 nps 0 tbhits 0 time 0 pv b1c3'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -1 nodes 13 nps 0 tbhits 0 time 0 pv b2b3'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp -8 nodes 14 nps 0 tbhits 0 time 0 pv a2a3'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 18 nodes 15 nps 0 tbhits 0 time 0 pv g2g3'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 21 nodes 16 nps 0 tbhits 0 time 0 pv c2c4'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 0 nodes 17 nps 0 tbhits 0 time 0 pv c2c3'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 26 nodes 18 nps 0 tbhits 0 time 0 pv g1f3'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 28 nodes 19 nps 0 tbhits 0 time 0 pv e2e4'
WARNING:chess.engine:<UciProtocol (pid=105184)>: Unexpected engine output: ' info  depth 40 seldepth 40 multipv 1 score cp 27 nodes 20 nps 0 tbhits 0 time 0 pv d2d4'
Testing engine "classical" ... OK
IbaiBuR commented 11 months ago

I also get this kind of warnings / errors which also seem to be related to the usage of the experience file:

ERROR:asyncio:Exception in callback Protocol._line_received('info string ...BlackHole.exp')
handle: <Handle Protocol._line_received('info string ...BlackHole.exp')>
Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/home/ibaibur/.local/lib/python3.10/site-packages/chess/engine.py", line 1093, in _line_received
    self.command._line_received(self, line)
  File "/home/ibaibur/.local/lib/python3.10/site-packages/chess/engine.py", line 1384, in _line_received
    assert self.state in [CommandState.ACTIVE, CommandState.CANCELLING]
AssertionError
Torom commented 11 months ago

python-chess warns that the engine produces unexpected output. Looking at the output it is also kind of strange, these are all legal moves from the starting position with their respective evaluation, I guess the engine does this to inform about the information from the experience file?

On which engine is your "mod" based?

I also get this kind of warnings / errors which also seem to be related to the usage of the experience file:

ERROR:asyncio:Exception in callback Protocol._line_received('info string ...BlackHole.exp')
handle: <Handle Protocol._line_received('info string ...BlackHole.exp')>
Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/home/ibaibur/.local/lib/python3.10/site-packages/chess/engine.py", line 1093, in _line_received
    self.command._line_received(self, line)
  File "/home/ibaibur/.local/lib/python3.10/site-packages/chess/engine.py", line 1384, in _line_received
    assert self.state in [CommandState.ACTIVE, CommandState.CANCELLING]
AssertionError

No, this error is not related to that. It occurs at occasional intervals and does not seem to have any negative effects.

IbaiBuR commented 11 months ago

python-chess warns that the engine produces unexpected output. Looking at the output it is also kind of strange, these are all legal moves from the starting position with their respective evaluation, I guess the engine does this to inform about the information from the experience file?

On which engine is your "mod" based?

It is based on latest Stockfish-Dev.

Yes, the engine sends the moves to the GUI / cli or whatever to give some information about the available moves in the experience file, obviously, the NPS, TBHits and time are sent as 0 because the engine does not really "think". This is the part of code that sends the info:

                      //Provide some info to the GUI about available exp moves
                      int expCount = 0;
                      for (auto it = quality.rbegin(); it != quality.rend(); ++it)
                      {
                          ++expCount;

                          sync_cout
                              << " info "
                              << " depth "    << it->first->depth
                              << " seldepth " << it->first->depth
                              << " multipv 1"
                              << " score "    << UCI::value(it->first->value)
                              << " nodes "    << expCount
                              << " nps 0"
                              << " tbhits 0"
                              << " time 0"
                              << " pv " << UCI::move(it->first->move, rootPos.is_chess960())
                              << sync_endl;
                      }

I tried to hardcode it and send different values to avoid the warnings but it did not work either.

If the assertionerror does not have negative effects then no problem. The warnings dont seem to have negative effects either but it is a bit annoying that they pop up continously in the terminal.

Thanks for answering. If you need more information just tell me.

Torom commented 11 months ago

It is based on latest Stockfish-Dev.

Sorry I didn't expect you to have actually added the experience file yourself.

What I wonder, why is there a space before info an info output normally looks like this: info depth 4 seldepth 2 multipv 1 score cp 51 nodes 110 nps 55000 hashfull 0 tbhits 0 time 2 pv e2e4. Maybe this is already part of the problem?

IbaiBuR commented 11 months ago

That could be the problem...

Let me remove it, recompile, and try...

Maybe that eliminates the warnings.

IbaiBuR commented 11 months ago

You were right!

Thanks a lot!