-
Notifications
You must be signed in to change notification settings - Fork 3
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
Problem using python-chess #1
Comments
I can get k2 to communicate nicely with python-chess 0.14.1 on my computer:
|
Hi @serg-meus and @niklasf, Thank you for your attention and for your time and efforts to solve this issue. I compiled the latest version of K2, but it still shows the same behaviour when using it with PicoChess (by means of the python-chess library). In the mean time I've found the same issue with the Rodent_II engine by @nescitus. Because many other engines are not affected, I assume (for now) that PicoChess is not at fault here. Could it perhaps have anything to do with python-chess sending 'isready' during search and then output strings getting mixed up? Greetings, |
Hello, @djdekker, thank you for your interest. Are you sure that K2 has been compiled successfully and executable file has permissions to execute? Can you connect your RPi to display, run the terminal and execute the engine in terminal? It may be done by following commands:
Best regards, |
Hi Sergey, |
@djdekker, everything is correct, engine seems to work fine. By default K2 use time control 5 minutes per game and the calculation stop is caused by timer. Best regards, |
If you run picochess like this in console mode (so that you don't need the physical DGT board) with K2 selected as its engine, you will see that picochess never receives the PV or score from the engine when search has started. Just enter Trying exactly the same procedure with, for example, Stockfish or Gull is successful (replace |
@djdekker, is it possible to get all commands sent from picochess to K2 from begin of session to the moment where K2 is not responding? |
Hi Sergey, it's the python-chess library that handles the chess playing part of PicoChess. I don't know the internals of python-chess, but @niklasf does. |
Hi Dirk-Jan, thanks for your response. |
@djdekker, @niklasf, @nescitus
Bug number 2 fixed by a474d64, picochess with K2 is working now on my laptop |
thank You very much! fixing it will take a while, but since I think that 2016-06-30 19:32 GMT+02:00 serg-meus [email protected]:
|
Thank you very much, Sergey! I just made a fresh K2 compile and it works fine now. 😃 |
Sorry Sergey, there still seems to be an issue with strings passed from the K2 engine to python-chess. In the log here below it's an invalid cp value, but sometimes it's an exception parsing the pv. 2016-06-30 20:40:45.223 ERROR uci - _info: exception parsing score cp value |
After 1. f3 e5 2. g4 Qh4# I'm getting this error immediately after putting the black Queen on h4: Traceback (most recent call last): |
@djdekker, I cant reproduce the mentioned errors, on my laptop picochess and K2 plays correctly, and f2f3 e7e5 g2g4 is also looks fine. I think it would be better if you change one line in picochess.py to make log on interaction between engine and python-chess. Then run picochess with keys '-l debug -lf logfile.log' and send me log file with erroneous behavior, if any. The original line is: The changed line is: |
@serg-meus This was not a bug in your engine, but probably some PicoChess bug. The latest PicoChess updates by @LocutusOfPenguin have solved it! @LocutusOfPenguin: I was using your 'level' branch (last week's version) and K2 version 0.83. After switching back to your 'master' branch (today's version, 72ab3e5) there is no error anymore. Then I switched back to your 'level' branch again, updated it with git to today's version (f4eabc8), and the error was also gone there too. |
well...today i (internally) released v0.68. This is alot more stable as the older version (solving some bug issues on our list). |
@serg-meus Here is a log file (with python-chess log level set to DEBUG) to show you what's happening with the invalid pv / score strings: |
Hello Sergey, |
Perhaps same as: niklasf/python-chess#83 ? |
@djdekker, @LocutusOfPenguin, thank you very much! |
I'm using K2 0.83 with PicoChess using python-chess by @niklasf. I compiled K2 on Raspberry Pi 3 with -march=armv6 to ensure backwards compatibility with RPi2.
The problem is: when K2 leaves the opening book it stops responding. What could be the cause?
There was another engine, Cinnamon by @gekomad, which also had this error. It was related to an infinite loop when closing stdin and to the use of isready/readyok. Cinnamon has been fixed now (pull requests #3 and #4).
Traceback (most recent call last):
File "./picochess.py", line 841, in
main()
File "./picochess.py", line 788, in main
stop_search_and_clock()
File "./picochess.py", line 205, in stop_search_and_clock
stop_search()
File "./picochess.py", line 198, in stop_search
engine.stop()
File "/opt/picochess/engine.py", line 230, in stop
self.engine.stop()
File "/usr/local/lib/python3.4/dist-packages/chess/uci.py", line 1249, in stop
return self._queue_command(command, async_callback)
File "/usr/local/lib/python3.4/dist-packages/chess/uci.py", line 890, in _queue_command
return future.result()
File "/usr/lib/python3.4/concurrent/futures/_base.py", line 397, in result
self._condition.wait(timeout)
File "/usr/lib/python3.4/threading.py", line 290, in wait
waiter.acquire()
The text was updated successfully, but these errors were encountered: