mcostalba / chess_db

GNU General Public License v3.0
22 stars 5 forks source link

regex for find command (in chess_db.py) is not accurate #37

Closed sshivaji closed 7 years ago

sshivaji commented 7 years ago

I put in the code to look for a line ending brace }. However, that is wrong when running many large tests. It turns out that this can be at the middle of the output.

We cannot test for EOF output either as the UCI executable is still running.

My solution for which I will issue a corresponding PR is to add a CTRL-A character at the end of the output of the find command. This still allows one to see the output fine if running on pure command line, but in python mode, we will know when the terminator is.

mcostalba commented 7 years ago

Can you please post a specific test case?

sshivaji commented 7 years ago

I tried but it's not easy, it's a bit non deterministic. Sometimes an exception happens, sometimes it does not. It's more easy to see when u are pagination on the UI page by page (you can see it randomly after 3 to 7 queries). I like the readyok solution. My solution was done quickly to enable the UI

sshivaji commented 7 years ago

I did not realize the UCI change to accept the "isready" command was straightforward like you demonstrated (I was thinking of multi-threaded isready, which is of course not needed). It would have been far easier for me to submit that as a pull request than do the ctrl-a or other character hacks. Apologies and thanks for the fix!

mcostalba commented 7 years ago

In scoutFish due to multithreading It is indeed more complex, but here it ended up to be far easier than expected.

On Tuesday, January 3, 2017, Shivkumar Shivaji notifications@github.com wrote:

I did not realize the UCI change to accept the "isready" command was straightforward like you demonstrated (I was thinking of multi-threaded isready, which is of course not needed). It would have been far easier for me to submit that as a pull request than do the ctrl-a or other character hacks. Apologies and thanks for the fix!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/mcostalba/chess_db/issues/37#issuecomment-270168167, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDGAazfM-e85DiNOssCuRG2-fBJhFGFks5rOoKPgaJpZM4LYz8c .