Skip to content

Getting info from thinking engine while go (play) is being processed. #1152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JohanSjoblom opened this issue Apr 27, 2025 · 0 comments
Open

Comments

@JohanSjoblom
Copy link

Background. I have ported the Picochess program from the old 0.25 version of python-chess to this library and I am also using async of both indefinite analysis and Play. https://github.com/JohanSjoblom/picochess

The problem is that we would need to get the InfoDict from a thinking engine. So between go (Play), and return of bestmove result we would like to get the info messages sent by the "thinking" engine. This was possible with the previous version of the library.

Current solution in the new Picochess we only get update on engine thinking InfoDict at the point when go (Play) returns. We have had a long discussion ( JohanSjoblom/picochess#49 ) and tested some workarounds, but we would really need help.
Yes, we can launch a new engine instance but we really do not want a parallel analysis... we want to know what the engine is thinking and display that to the user. So we really would like some mechanism to get the InfoDicts sent out by the thinking engine. Even if it means we would need to parse them using some kind of "read_line()".

I have done quite a lot of testing using the async analysis() and indefinite analysis(). I have also written a ContinousAnalyser wrapper class to use indefinite analysis() and it works well as long as the engine is not playing (making moves).
Results from tests (I only use async)

  • Running Play and indefinite Analysis in the same async loop causes async crash in library.
  • Running both Play and indefinite Analysis() in 2 separate create_task() causes Play never to return with a move. Nothing seems to happen if I start the analyser.

I would appreciate any hints, workarounds, or development ideas :-)
Yours, Johan Sjöblom

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

No branches or pull requests

1 participant