Crafty UCI version

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
hgm
Posts: 28468
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Crafty UCI version

Post by hgm »

chessico wrote:As Crafty is famous due to its long and successful history people might consider it an alternative for variety's sake, I would. Being winboard means you are an option for the tiny minority of fans of computer chess, not for chess players.
We should not exaggerate things. Most 'noobs' would not use Crafty even if it was UCI, because downloading, installing and registering it to the (ChessBase) GUI is already too difficult for them. The whole concept that GUIs and engines are separate entities is often completely alien to them. If it isn't bundled with and automatically invoked by the GUI it will be out of their reach. And they would not be very interested in it anyway, as it is not within 10 Elo of Stockfish or Komodo.

But it is true that if you want the general public to use your engine, you should distribute it in an extremely user-friendly manner. I usually distribute complete packages: GUI + engine(s) + all conceivable support files completely pre-configured in a single zip file or executable installer.

I think Crafty is pretty harsh in this respect. Bundling it with a pre-cofigured WB-to-UCI adapter wouldn't be much trouble, and greatly increase the market for it.
Last edited by hgm on Fri Jul 17, 2015 6:06 pm, edited 1 time in total.
mvk
Posts: 589
Joined: Tue Jun 04, 2013 10:15 pm

Re: Crafty UCI version

Post by mvk »

bob wrote: Here are some examples of what I mean by "cedes too much control to the GUI."

1. GUI can make opening book moves.
2. GUI can play endgame database moves without any input from the engine
These are not protocol properties as both protocols allow this mode of operation. These are things the user typically does on purpose, and typically wants to have control over. The user wins if it works the same for every engine. It lowers the acceptance threshold for that engine if it behaves the same as the others.
3. GUI tells engine when to ponder, when to search, what time limit to use, etc.
UCI drivers typically don't let you ponder unless it is out of book. That is a disadvantage of UCI. But that can also be solved in the driver/GUI without protocol change. In the meantime every engine suffers in the same way. (Mind that you are free to ignore the ponder move suggestion in the ponder message. The UCI spec makes that explicit.)

All other pondering is the same with both protocols, as far as I understand the specs. You get the ponder message immediately after you make your move. You don't have to program remembering the game's ponder mode (the 'hard/easy/force/white/black/go' mess inherited from the gnuchess cli mode), which is an advantage for the programmer. It is ironic that not even gnuchess has these anymore, but it lives on in programs that copied that design in order to interoperate with xboard. With UCI you can get rid of all of that.
4. Most chess engines want to receive a move, then generate a reply, until the game ends. They don't want to have the entire game's list of moves stuffed into them before each move. That seems beyond retarded.
This is a non-techical argument. Programs don't "want" things.

The UCI way has advantages here to the programmer because he doesn't have to implement additional commands for analysis, takeback, white/black/force, game resumption etc. The user doesn't care if the message is a couple of bytes longer. There is no real performance impact. Even if following the move list is too much, cycle-junkie-wise, you can always program to skip the moves that were unchanged since last move. That takes one or two lines of code. But why bother, the move notation is designed to be fast to parse.
And it would be a disruption. Such a big disruption that years ago I had to write special code to prevent ChessBase GUI from breaking Crafty's pondering savings by doing this same stupid nonsense. I don't want to do it again.
The problem you mention is one of a bogus driver/adapter that sent a 'newgame' command before every move in a game. That is not typical behaviour for native drivers. Does SF makes the same workarounds you mention?
In short, for me, xboard works perfectly.
The key perspective is 'me'. By releasing it, people get the impression that it is intended to be used by chess players. For Crafty that may not really the case, and its releases primarily intended to be looked at by other programmers. One can also see UCI support as an opportunity to increase the potential user base, because it works with all interfaces while the gnuchess protocol doesn't, or gives practical inconveniences for users, and users ask for it. There are disadvantages from the programmer's point of view, but the users apparently don't share the same perspective on those. The UCI protocol didn't become the primary engine standard for no reason.
[Account deleted]
BBauer
Posts: 658
Joined: Wed Mar 08, 2006 8:58 pm

Re: Crafty UCI version

Post by BBauer »

You can prefix the EGT path with "syzygy:" to indicate it is Syzygy rather than Nalimov.
This solved my problem.

BTW: IMHO "Play against a chess engine or match two engines" seams to me something different from analyzing a position. Again I have to type the output from WinBoardStartup. I cannot copy it and paste it here. Comes time I will remove fairymax and such crap so when I stop analysis winboard will not start doing analysis by fairymax, which I never wanted.
The UCI parameters are placed in different boxes. Hashsize and number of procs are separated from other UCI parameters. But I may get used to it.

Kind regards
Bernhard
User avatar
hgm
Posts: 28468
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Crafty UCI version

Post by hgm »

BBauer wrote:BTW: IMHO "Play against a chess engine or match two engines" seams to me something different from analyzing a position.
Good point. These texts are very old, and it never occurred to me to change them. Basically the three modes are: (1) with engine(s) (2) connect to ICS (3) neither. The text for (1) should probably be changed to "Use an engine to play against or analyze, or play two engines against each other".
Again I have to type the output from WinBoardStartup. I cannot copy it and paste it here.
I still do not get it. The Startup Dialog is just checkboxes and comboboxes. What do you want to copy from there? Normally you just tick the radio button (and not even that, because playing with engine is checked by default), and select the engine from the first combobox (and a second only if you want to do engine vs. engine). If you want an engine that is not in the combobox yet, you could in theory type or paste it there, but because the format there might be a bit cryptic, it is usually easier to just accept the default choice and use the Engine -> Load 1st Engine dialog for loading the engine you want. Next time it will then appear in the combobox.
Comes time I will remove fairymax and such crap so when I stop analysis winboard will not start doing analysis by fairymax, which I never wanted.
You can use the Engine->Edit Engine List dialog to permanently modify what is displayed in the startup comboboxes. Just delete the lines there that correspond to engines you dont want, and sort the others in the order you prefer.
The UCI parameters are placed in different boxes. Hashsize and number of procs are separated from other UCI parameters. But I may get used to it.
True. Things like hash size and cores apply to all engines, so that you would not have to set them every time you load a new engine. Because usually these depend on the properties of your computer (RAM, cores), and not so much on the engine.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty UCI version

Post by bob »

mvk wrote:
bob wrote: Here are some examples of what I mean by "cedes too much control to the GUI."

1. GUI can make opening book moves.
2. GUI can play endgame database moves without any input from the engine
These are not protocol properties as both protocols allow this mode of operation. These are things the user typically does on purpose, and typically wants to have control over. The user wins if it works the same for every engine. It lowers the acceptance threshold for that engine if it behaves the same as the others.
3. GUI tells engine when to ponder, when to search, what time limit to use, etc.
UCI drivers typically don't let you ponder unless it is out of book. That is a disadvantage of UCI. But that can also be solved in the driver/GUI without protocol change. In the meantime every engine suffers in the same way. (Mind that you are free to ignore the ponder move suggestion in the ponder message. The UCI spec makes that explicit.)

All other pondering is the same with both protocols, as far as I understand the specs. You get the ponder message immediately after you make your move. You don't have to program remembering the game's ponder mode (the 'hard/easy/force/white/black/go' mess inherited from the gnuchess cli mode), which is an advantage for the programmer. It is ironic that not even gnuchess has these anymore, but it lives on in programs that copied that design in order to interoperate with xboard. With UCI you can get rid of all of that.
4. Most chess engines want to receive a move, then generate a reply, until the game ends. They don't want to have the entire game's list of moves stuffed into them before each move. That seems beyond retarded.
This is a non-techical argument. Programs don't "want" things.

The UCI way has advantages here to the programmer because he doesn't have to implement additional commands for analysis, takeback, white/black/force, game resumption etc. The user doesn't care if the message is a couple of bytes longer. There is no real performance impact. Even if following the move list is too much, cycle-junkie-wise, you can always program to skip the moves that were unchanged since last move. That takes one or two lines of code. But why bother, the move notation is designed to be fast to parse.
And it would be a disruption. Such a big disruption that years ago I had to write special code to prevent ChessBase GUI from breaking Crafty's pondering savings by doing this same stupid nonsense. I don't want to do it again.
The problem you mention is one of a bogus driver/adapter that sent a 'newgame' command before every move in a game. That is not typical behaviour for native drivers. Does SF makes the same workarounds you mention?
In short, for me, xboard works perfectly.
The key perspective is 'me'. By releasing it, people get the impression that it is intended to be used by chess players. For Crafty that may not really the case, and its releases primarily intended to be looked at by other programmers. One can also see UCI support as an opportunity to increase the potential user base, because it works with all interfaces while the gnuchess protocol doesn't, or gives practical inconveniences for users, and users ask for it. There are disadvantages from the programmer's point of view, but the users apparently don't share the same perspective on those. The UCI protocol didn't become the primary engine standard for no reason.
The "ponder=on/off" wasn't inherited from gnuchess for me. Nor was it a product of xboard. Even Cray Blitz had that option because when testing I didn't want the randomness of pondering affecting what I was doing. I did that same thing back in the late 60's when blitz came along, since even then pondering made perfect sense to me, and having the ability to turn it off at times seemed reasonable.

As far as wb2uci goes, I know nothing about it, because I don't run a single UCI client anywhere. I use exactly two. Xboard for online or when I want to watch as games are played, and my own referee program when testing on my clusters since it has no GUI and hence no appreciable overhead to disrupt very fast games.

I will at least look at wb2uci to see what it looks like. Is source available? I don't object to bundling (or even building it in if it is simple enough) such a thing. But the key is "simple enough". I don't want to spend weeks testing / learning how to test since I am not currently running any UCI clients at all and would have to first install and configure one and then learn how to use it... Not just a few minutes I don't think.
BBauer
Posts: 658
Joined: Wed Mar 08, 2006 8:58 pm

Re: Crafty UCI version

Post by BBauer »

IMHO every UCI parameter should belong to an engine.
Engine1: p1,p2,p3....
Engine2: q1,q2,q3,...
This would let me play engine1 vs engine2 with different hash sizes, etc.
I would like to be able to use the analysis output. Therefor I want to be able to copy and paste it. BTW, everything winbord says should be placeable to clipboard. Editing the engine list using clipboard would be much easier.
That way winboard could be widely accepted.

Thanks for your help to a winboard beginner.
Kind regards
Bernhard
User avatar
hgm
Posts: 28468
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Crafty UCI version

Post by hgm »

BBauer wrote:IMHO every UCI parameter should belong to an engine.
Engine1: p1,p2,p3....
Engine2: q1,q2,q3,...
This would let me play engine1 vs engine2 with different hash sizes, etc.
Most users want it the other way, but I guess it should be possible to add a feature where the user can 'decouple' the common parameters by putting an invalid value there. Wich would then make the options appear in the Engine Settings dialog. I will think about it. (It is currently possible to give engines separate hash, threads or depth-limit value, but it requires a geeky trick, redefining the 'initString' they receive at the start of the game.)
I would like to be able to use the analysis output. Therefor I want to be able to copy and paste it.
Well, that is possible. I do it all the time. Just select the part of the text you want to copy, and press Ctrl-C.
BTW, everything winbord says should be placeable to clipboard. Editing the engine list using clipboard would be much easier.
Well, that is also possible. Just display the engine list through Engine->Edit Engine List, and you can select it (or any part of it) and copy it, using the norrmal mouse pop-up menu Ctrl-C key. Then you could paste it anywhere you want, edit it there, and copy-paste it back. It seems like a waste of time to me, though, as WinBoard text memos have full edit capability.
BBauer
Posts: 658
Joined: Wed Mar 08, 2006 8:58 pm

Re: Crafty UCI version

Post by BBauer »

That looks great!

Thank you very much.

Bernhard
chessico
Posts: 58
Joined: Mon Jan 28, 2013 5:27 pm
Location: Germany

Re: Crafty UCI version

Post by chessico »

bob wrote: As far as wb2uci goes, I know nothing about it, because I don't run a single UCI client anywhere. ... I will at least look at wb2uci to see what it looks like. Is source available? I don't object to bundling (or even building it in if it is simple enough) such a thing. But the key is "simple enough". I don't want to spend weeks testing / learning how to test since I am not currently running any UCI clients at all and would have to first install and configure one and then learn how to use it... Not just a few minutes I don't think.
That sounds good to me. Unfortunately I am not up to date, but the author of wb2uci is Odd Gunnar Malin, it worked very well for me in the past, in the 32bit past, I must admit. I also remember that Jim Ablett had something like a bundle, HGM may know more about recent developments. A bundle by the engine author, where I know things have been checked a little bit and are not too far away from your intentions would be a nice thing.
Thanks everybody for your reactions and efforts, btw.
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: Crafty UCI version

Post by Adam Hair »

bob wrote:As far as wb2uci goes, I know nothing about it, because I don't run a single UCI client anywhere. I use exactly two. Xboard for online or when I want to watch as games are played, and my own referee program when testing on my clusters since it has no GUI and hence no appreciable overhead to disrupt very fast games.

I will at least look at wb2uci to see what it looks like. Is source available? I don't object to bundling (or even building it in if it is simple enough) such a thing. But the key is "simple enough". I don't want to spend weeks testing / learning how to test since I am not currently running any UCI clients at all and would have to first install and configure one and then learn how to use it... Not just a few minutes I don't think.
http://web.archive.org/web/201009250221 ... /#download

wb2uci is a closed source Windows program, so I don't know if you want to spend any time messing with it. If you do, I have found it works fine with Wine 1.6 in Ubuntu 13.04.