-
Notifications
You must be signed in to change notification settings - Fork 27
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
Improve UCI position command support #18
Conversation
Hi @thearst3rd! Thanks for the PR. This looks like a sensible change that improves UCI coverage. Could you take a look at the failing test please? And add test/s to cover any additional features that this PR adds. You can run the tests locally with Happy to help if you get stuck 👍 |
Hi @healeycodes - I got the tests working again, it was just a matter of trimming away the "info" text which I moved from stderr to stdout :) I also added some more coverage, specifically testing both Let me know if these tests seem ok to you, or if I'm being too specific :) Now there is one more thing I was thinking about adding - right now you specify the depth using a command line parameter. I think it would be cool to do one of two things - make it so you can tell it what depth to use using the uci standard The other way I was thinking is to add it as a UCI option. So, when it receives
then respond to the Let me know if either of those sound interesting to you can I can make another PR :) |
These tests look great 👍 Let's get this merged 🚀 |
@thearst3rd I like the UCI option you've described here. I agree that it's best to avoid chess GUIs defaulting to large depths due to the high-level nature/performance of this engine. I'll play back what I think this feature would look like (to check I understand correctly):
☝️ that all sounds great to me and you should open a PR if you're interested in taking it on :) |
Yep, that's exactly how it will work! I'll get a PR up probably pretty soon :) |
This pull request improves the functionality of the "position" command, enough to get the program running with Cute Chess resolving #7 and #15 (I think?)
Basically, the position command works like:
The token "initial position" is either
startpos
orfen <fen string>
. Then, it can optionally say "moves" followed by zero or more moves. I tested this using python-chess's UCI engine interface, as well as Cute Chess on Windows and Linux and it all works as expected.There could still be more error checking - for example, if you pass in an invalid FEN, or an invalid move list, the uci engine should just ignore it. Here, it will probably just crash the python script. But a real chess GUI should never do that so it's probably acceptable for now
I also made it print less stuff to stderr, since that isn't expected by any chess GUI and it was cluttering up stuff when running with python-chess's UCI interface. I kept the debug info though, using the standard "info" tag (though not following the standard for how you're supposed to fill it out. Not that it really matters for this)