Skip to content

Allow "engine debugging" to be enabled.#1152

Merged
AttackingOrDefending merged 8 commits into
lichess-bot-devs:masterfrom
folkertvanheusden:engine-debug
Dec 16, 2025
Merged

Allow "engine debugging" to be enabled.#1152
AttackingOrDefending merged 8 commits into
lichess-bot-devs:masterfrom
folkertvanheusden:engine-debug

Conversation

@folkertvanheusden

Copy link
Copy Markdown
Contributor

Type of pull request:

  • Bug fix
  • Feature
  • Other

Description:

This change allows a developer to enable UCI/XBoard protocol debugging to be enabled. This helps debugging communication problems between lichess-bot and certain chess engines.

Related Issues:

[Reference any related issues that this pull request addresses or closes. Use the syntax Closes #issue_number to automatically close the linked issue upon merging.]

Checklist:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

Screenshots/logs (if applicable):

@MarkZH

MarkZH commented Nov 7, 2025

Copy link
Copy Markdown
Collaborator

Good idea. Just fix the errors in the tests. Namely, the Stockfish.__init__() method in test_bot/homemade.py (and all the classes Stockfish inherits from) needs to be changed to take a debug paraemeter.

@folkertvanheusden

Copy link
Copy Markdown
Contributor Author

@MarkZH hi, I made the change. Could not find any other class that Stockfish inherits from. But pytest with the latest fix runs fine and it hangs without the fix so my guess is that it is now good?

Comment thread config.yml.default Outdated
engine: # Engine settings.
dir: "./engines/" # Directory containing the engine. This can be an absolute path or one relative to lichess-bot/.
name: "engine_name" # Binary name of the engine to use.
debug: False # Should all commands between Lichess & bot be logged?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really an accurate description. Setting debug: True prints messages about starting and stopping the engine executable. Showing UCI/Xboard communication is controlled by the -v option on the command line.

@MarkZH

MarkZH commented Nov 7, 2025

Copy link
Copy Markdown
Collaborator

I forgot to mention, please add documentation to the config wiki page: wiki\Configure-lichess-bot.md

@folkertvanheusden

Copy link
Copy Markdown
Contributor Author

I forgot to mention, please add documentation to the config wiki page: wiki\Configure-lichess-bot.md

Done!

@AttackingOrDefending

Copy link
Copy Markdown
Member

Can you fix the mypy errors?

Remove unused name parameter (no other code uses it) and replace it with
debug so all EngineWrapper classes have same __init__().

Remove default argument values to ensure __init__() is called correctly.
@AttackingOrDefending AttackingOrDefending merged commit 9b145a1 into lichess-bot-devs:master Dec 16, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants