Crafty UCI version

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

Moderator: Ras

syzygy
Posts: 5943
Joined: Tue Feb 28, 2012 11:56 pm

Re: Crafty UCI version

Post by syzygy »

Evert wrote:That's once.
Twice in that post, but never mind. There was no good reason for me to spit through and criticise your original post. I should have skipped at least that part.
But since the word "adapter" never featured in the original post, so unless you're psychic or smart enough to know what someone means to write regardless of what they actually write, your inference is no more than a guess.
True, he did not mention adapters. So apparently we have a user with a UCI GUI who would like to run Crafty with it. Then we can either inform him of adapters or ask why they don't already suit his needs.

I still do not see what could be puzzling about the original question. He obviously had given up hope that Bob will ever do it himself, so he resorted to asking here whether anyone else was willing to do it (for the public good, at least as he perceives it, including himself).
Really. He simply asked if someone could make an UCI version. Nothing difficult about it.
Did you just miss the point again?
If I were to say "get rid of Windows and just use Linux", what "problem" did I just solve? Doesn't matter, right, since I already told you the solution?
The correct analogy rather seems to be: "Could someone port Houdini to Linux?" (just to name a windows-only engine and ignoring legalities).
To me that means "The solution to my problem is a Linux port of Houdini".

Even if I could not guess the problem (which in this case obviously is that someone is running Linux and would like to use Houdini), I don't really need to know it to understand the question. Of course I might ask why running Houdini on top of Wine is not already a satisfactory solution. But I don't see "the point" in asking "what is the point of a Linux version of Houdini".
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty UCI version

Post by bob »

hgm wrote:Yes, UCI still does that. I wouldn't bother with it if I were you.

But it would be nice if you could make Crafty deliver multi-PV in XBoard analyze mode, through an engine-defined option MultiPV...
That is on my list, and I think I have figured out a way to do this without "spaghettifying" the code as I have seen done in others. I already have a pretty good start with the new fail-high/fail-low handling method I am using.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty UCI version

Post by bob »

Evert wrote:
syzygy wrote:
I don't see why he needs to justify it.
Of course he doesn't, and if you think I ever said anything to the contrary you need to read more carefully. I asked for clarification.
You did not "ask" for clarification. You repeatedly insisted that he tell you "the point". The way you presented your "question" was pretty rude in my eyes.
The one who is really rude here is you. Since I don't believe you're as dense as you come across here, I also have to assume you're being deliberately obtuse.

I "repeatedly insist he tell me the point?" Really?
I asked in my first post: "what's the point of a UCI port of Crafty?" As in, what problem does having one solve? That's once.
A straight answer would have been nice, but I guess that would have been too easy.
In addition you took objection to "I realise Crafty's author, Bob Hyatt, doesn't like UCI as it cedes too much control to the GUI" which was merely a statement of fact from the point of view of the OP.
I take no objection to such a statement. I don't care whether Bob Hyatt likes UCI or not or why. What I said was that I don't understand "as it cedes too much control to the GUI." I still don't, really.
Then when he said he'd leave the "why" to Bob, you were again rude.
Since I didn't ask him why Bob thinks anything, but asked what he meant by "as it cedes too much control to the GUI", the response "Bob can speak for, and defend, himself" is really off the mark, and in itself rude. Which did annoy me.
That's since been cleared up as a miscommunication.
And I won't start on why you could possibly have felt the need to use this thread as an opportunity to share a story about Stockfish, Makruk, Senpai, whatever.
I would think this was quite clear, since I explained the reason. I'll repeat it for your convenience:

One reason I have seen people ask for a UCI port of an engine is that they assume that converting an engine to UCI would somehow make it stronger (the strongest engines are UCI engines, clearly there is a correlation there, and as we all know correlation equals causation). Of course there exist multi-protocol engines, but those are also generally not top engines, and you can't tell from a rating list if there is any strength difference between the two protocols (of course there shouldn't be).
It so happens that I did the reverse experiment: convert a UCI engine to CECP, with the predictable result that it remains equally strong. Given that I already suggested that such a conversion is essentially pointless, it seemed reasonable to say why I did that.

As it happens, the OP was not under this particular delusion, so that's where that piece of the conversation ended, until you saw the need to drag it up again. As an example, it still highlights a few pertinent points:

A "port" of an engine to another protocol is certainly doable, and depending on the engine, can be easy to do. It makes no difference in playing strength, it does not magically add new features and it does not fix bugs (but it may of course introduce new ones).
In short, as I just said, it is basically pointless unless you have a specific reason in mind. In my case, it was a necessary first step in another experiment.
He simply does not like the hassle of having to configure adapters.
That is not something you can infer from the original post, which is what prompted me to ask why he wanted it.
Certainly something that I can infer from the original post. It's quite clearly "the point" of having an UCI version. What else could it be.
You tell me. I don't know, that's why I asked.
But since the word "adapter" never featured in the original post, so unless you're psychic or smart enough to know what someone means to write regardless of what they actually write, your inference is no more than a guess.
Either way, it doesn't matter: if you get the point and I don't, I still get to ask what it is. To basically say "I understand what is meant, so you shouldn't have to ask" really is exceedingly arrogant and presumptuous.

Perhaps this point bears repeating: when I ask a question, I do so because I'm curious about the answer. I don't do it to wind other people up, or to put people down. You may want to stop and consider why someone asks a question, rather than going by your own preconceived opinion.
He told you the solution (UCI port of Crafty), so no need to wonder what the problem might be.
Come on, you're smarter than that.
Really. He simply asked if someone could make an UCI version. Nothing difficult about it.
Did you just miss the point again?
If I were to say "get rid of Windows and just use Linux", what "problem" did I just solve? Doesn't matter, right, since I already told you the solution?
Of course not. There can be many good reasons for doing that, and there can be many dumb reasons for doing that, and if I were asking someone for help with a particular solution I have in mind, I would hope that they would look at the problem and mention it if the solution I came up with doesn't seem like a good one. Why else would I ask someone else's opinion?
"UCI works better" is not an answer to the question, because it's not factually true. It may be subjectively true (or false!) but then it is useful to know why that is the case. Note that this isn't about anyone being "right" or "wrong", just about understanding a point of view.
Do you actually think the OP came here for a chess engine interface protocol war? He did not.
Of course not. So is there any particular reason you're derailing this thread by turning it into one?
You may take care to note (or not) that any discussion of the merits of CECP are in response to claimed advantages of UCI.
Here are some examples of what I mean by "cedes too much control to the GUI."

1. GUI can make opening book moves. Handle book learning. Decide which openings to play/not play without any input whatsoever from the program. Apparently this can be turned off, but it should not even be there to turn on. What part of "user interface" plays chess moves, when you think about it?


2. GUI can play endgame database moves without any input from the engine, even if an engine has various sorts of strategies to try to extract a win from a drawn position. Again, I presume this can be turned off, but it ought not be there for the reason in #1.

3. GUI tells engine when to ponder, when to search, what time limit to use, etc. That's a take for the engine, the GUI should NOT exert any influence on the game, any more than a blind players helper should tell him which openings to play or how to win an endgame or how long he should think, and what move he should expect from the opponent.

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. 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.

Xboard does what it is supposed to do. If you are playing a local game against the program, it serves as a graphical interface (amazing, what the name implies in fact). You drag pieces to move, xboard moves pieces when the program tells it what to move. Xboard keeps up with the clock, but only tells the engine how much time is left, the engine has to make time allocation decisions. Xboard doesn't play opening moves, nor does it take over a game once endgame tables are hit. It stays passively out of the way and "interfaces" between the human player and the computer player. It even exposes engine options so that the human can make whatever settings he wants, and then those are relayed to the engine.

In short, for me, xboard works perfectly. I can play games, I can analyze games, I can play tournaments against other programs, I can analyze games, etc, etc and etc... I want to spend what little time I have on things that are actually productive. This would just be more code with zero strength improvement or feature improvement.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty UCI version

Post by bob »

hgm wrote:
bob wrote:But as I mentioned, crafty only has multi-pv currently in the annotate command, which takes PGN as input, and makes comments/suggestions/finds blunders/etc depending on the annotate command given. This is not done through a GUI, it is a sort of off-line or background / batch thing.
Is there any reason why it cannot be used in normal XBoard analyze mode? It seems to me that if you have implemented it already in other modes, this should just be a matter of enabling it at the right time, (e,g, after receiving 'option MultiPV=N' with N != 1), which should be pretty trivial.
The drawback/problem is that the multi-pv stuff is 100% isolated to annotate.c, while the changes need to be in iterate.c where the main part of the chess playing occurs.

But as I said, this I will do soon. Maybe even in 25.0
User avatar
hgm
Posts: 28472
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Crafty UCI version

Post by hgm »

That would be great.

Note that XBoard protocol is not really picky about the order in which you send the lines, or how many lines you send. XBoard just displays any PV you send, sorted by score.
BBauer
Posts: 658
Joined: Wed Mar 08, 2006 8:58 pm

Re: Crafty UCI version

Post by BBauer »

I was just wondering...

Could someone out there fork Crafty and produce a UCI version?

I realise Crafty's author, Bob Hyatt, doesn't like UCI as it cedes too much control to the GUI.

Very well then, let someone else do it while keeping to all the legal proprieties including publishing the changed code, etc.
Reading this thread I decided to give winboard a try.
First problem: which winboard should I download?
I have WinBoard 4.8.0b. This string I have to type in, no copy paste.
When I start it, I have 3 options:
1. play
2. use
3. Just
I want to analyze a position. So I try to enter one. I do not suceed. So I enter the position in arena, put it to clipboard and paste it to winboard. Success! To analyze a position with syzygys. I do all I can (which is not much) but I do not get the right answer. Syzygys are not working.
Ending up here, I can undertand the OP.
There are GUIs, but what is usefull to analyze a position with syzygys?
My polyglot.ini file was ovreridden. This nasty farymax says it cannot analyze. What a mess.
Arena is working for me.
Kind regards
Bernhard
User avatar
hgm
Posts: 28472
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Crafty UCI version

Post by hgm »

BBauer wrote:Reading this thread I decided to give winboard a try.
First problem: which winboard should I download?
I have WinBoard 4.8.0b.
This is indeed the most recent one.
This string I have to type in, no copy paste.
I don't understand what you mean here at all. Type where? In the installer? It does propose the name of the install folder, not?
When I start it, I have 3 options:
1. play
2. use
3. Just
I suppose you selected "play with engine" here, as you wanted to use an engine.
I want to analyze a position. So I try to enter one. I do not suceed.
If you don't have something to paste, the easiest way to set up a position is (after selecting Edit Position) is to click the clock of the stm twice to call up a position that contains every piece type once, and then use the mouse to drag the pieces where you want them. (Keeping Ctrl pressed if you want to duplicate a piece, or dragging it off board to delete it.)
So I enter the position in arena, put it to clipboard and paste it to winboard. Success!
Indeed, pasting works. You could also just type the FEN in Edit Position mode. Or create pieces by right-clicking the square on which you want them, and drag the mouse vertically (keeping the button down) until you see the piece that you want there.
To analyze a position with syzygys. I do all I can (which is not much) but I do not get the right answer. Syzygys are not working.
Which engine where you using then? You have to tell the GUI where you have your tablebases installed, so it can communicate it to the engine. The tablebase path can be entered in the Common Engine Options dialog. You can prefix the EGT path with "syzygy:" to indicate it is Syzygy rather than Nalimov.
Ending up here, I can undertand the OP.
Well, his problem was not that he did not know how to use WinBoard, and we never told him to do that. He wanted to run a WB engine under ChessBase, without hassle, and was unhappy that Crafty is missing some features other engines have.
There are GUIs, but what is usefull to analyze a position with syzygys?
Well, most GUIs would do that, but perhaps expecting that you could do something relatively complicated without any prior experience with the GUI is expecting too much?
My polyglot.ini file was ovreridden.
Indeed. You should not mess with ini files. That is asking for trouble, and should be left to geek users.
This nasty farymax says it cannot analyze.
Why would anyone want to analyze with such a weak engine? It is intended for playing against. For analyzing, Fruit is included in the WinBoard package, and you could have selected from the combobox in the startup screen, when you selected to play with engine.
What a mess.
Arena is working for me.
Kind regards
Bernhard
Well, Arena was one of the other GUIs that was mentioned as supporting WB protocol.
chessico
Posts: 58
Joined: Mon Jan 28, 2013 5:27 pm
Location: Germany

Re: Crafty UCI version

Post by chessico »

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. Handle book learning. Decide which openings to play/not play without any input whatsoever from the program. Apparently this can be turned off, but it should not even be there to turn on. What part of "user interface" plays chess moves, when you think about it?
2. GUI can play endgame database moves without any input from the engine, even if an engine has various sorts of strategies to try to extract a win from a drawn position. Again, I presume this can be turned off, but it ought not be there for the reason in #1.
3. GUI tells engine when to ponder, when to search, what time limit to use, etc. That's a take for the engine, the GUI should NOT exert any influence on the game, any more than a blind players helper should tell him which openings to play or how to win an endgame or how long he should think, and what move he should expect from the opponent.

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. 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.

Xboard does what it is supposed to do. If you are playing a local game against the program, it serves as a graphical interface (amazing, what the name implies in fact). You drag pieces to move, xboard moves pieces when the program tells it what to move. Xboard keeps up with the clock, but only tells the engine how much time is left, the engine has to make time allocation decisions. Xboard doesn't play opening moves, nor does it take over a game once endgame tables are hit. It stays passively out of the way and "interfaces" between the human player and the computer player. It even exposes engine options so that the human can make whatever settings he wants, and then those are relayed to the engine.

In short, for me, xboard works perfectly. I can play games, I can analyze games, I can play tournaments against other programs, I can analyze games, etc, etc and etc... I want to spend what little time I have on things that are actually productive. This would just be more code with zero strength improvement or feature improvement.
Let me just say that for me as a simple chess player, who uses engines for his own training (and is not interested in computerchess per se; ok, not true, but for arguments sake) your arguments (which I understand) work just the other way round: For me it is good that the Gui is the one place where I configure my opening book(s) and everything else and where I plug in an engine which analyzes or plays frienldy games against me. And as good as xboard may be (it is fantastic, of course, almost as good as winboard): The tool of my choice is some Fritz Gui and the CB database software. Now I can see that people like me are marginalized here and people say dummies like me are not interesting. But on the other hand I think people like Anand, and probably almost everybody else are just as silly noobs as I am, and we may be the stupid majority. Not being uci means that an engine is not used, being uci means that you become an option. 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.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty UCI version

Post by bob »

chessico 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. Handle book learning. Decide which openings to play/not play without any input whatsoever from the program. Apparently this can be turned off, but it should not even be there to turn on. What part of "user interface" plays chess moves, when you think about it?
2. GUI can play endgame database moves without any input from the engine, even if an engine has various sorts of strategies to try to extract a win from a drawn position. Again, I presume this can be turned off, but it ought not be there for the reason in #1.
3. GUI tells engine when to ponder, when to search, what time limit to use, etc. That's a take for the engine, the GUI should NOT exert any influence on the game, any more than a blind players helper should tell him which openings to play or how to win an endgame or how long he should think, and what move he should expect from the opponent.

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. 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.

Xboard does what it is supposed to do. If you are playing a local game against the program, it serves as a graphical interface (amazing, what the name implies in fact). You drag pieces to move, xboard moves pieces when the program tells it what to move. Xboard keeps up with the clock, but only tells the engine how much time is left, the engine has to make time allocation decisions. Xboard doesn't play opening moves, nor does it take over a game once endgame tables are hit. It stays passively out of the way and "interfaces" between the human player and the computer player. It even exposes engine options so that the human can make whatever settings he wants, and then those are relayed to the engine.

In short, for me, xboard works perfectly. I can play games, I can analyze games, I can play tournaments against other programs, I can analyze games, etc, etc and etc... I want to spend what little time I have on things that are actually productive. This would just be more code with zero strength improvement or feature improvement.
Let me just say that for me as a simple chess player, who uses engines for his own training (and is not interested in computerchess per se; ok, not true, but for arguments sake) your arguments (which I understand) work just the other way round: For me it is good that the Gui is the one place where I configure my opening book(s) and everything else and where I plug in an engine which analyzes or plays frienldy games against me. And as good as xboard may be (it is fantastic, of course, almost as good as winboard): The tool of my choice is some Fritz Gui and the CB database software. Now I can see that people like me are marginalized here and people say dummies like me are not interesting. But on the other hand I think people like Anand, and probably almost everybody else are just as silly noobs as I am, and we may be the stupid majority. Not being uci means that an engine is not used, being uci means that you become an option. 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.
I don't see crafty as particularly relevant for "chess players" when you have stockfish and Komodo (among others). That leaves Crafty as a hobby for me, primarily. Playing opening moves is part of the game, and IMHO the engine plays the game, the GUI simply interfaces between the engine and GUI. UCI is a particularly lousy protocol. As a human would you want to play a game, and suddenly the board disappears, you have to forget what you have been doing, and then someone starts making all the moves in the game up to the point where they say "now it is your move?" That's a nonsensical protocol to be kind. xboard/winboard lets the engine maintain its own state information, play EVERY MOVE in the game.

As far as setting up books and such, most engines have facilities for this. You only have to tell them where to find the book and how you want to adjust it. This is not a UCI issue, as xboard can tell an engine anything it wants regarding the book, where to find it, which one to use, etc.

For me, the issue is the protocol. The knobs and dials are cute and HGM added something to xboard/winboard to adjust options. But that is not a protocol issue, that's a GUI/engine issue. But the protocol itself is simply not very well thought out. I've resisted trying to add UCI support because it offers absolutely nothing that Crafty currently doesn't do, and it is so different from the xboard/winboard protocol that I don't want to waste time adding spaghetti-code when it won't offer anything new nor solve any existing problem.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty UCI version

Post by bob »

BBauer wrote:
I was just wondering...

Could someone out there fork Crafty and produce a UCI version?

I realise Crafty's author, Bob Hyatt, doesn't like UCI as it cedes too much control to the GUI.

Very well then, let someone else do it while keeping to all the legal proprieties including publishing the changed code, etc.
Reading this thread I decided to give winboard a try.
First problem: which winboard should I download?
I have WinBoard 4.8.0b. This string I have to type in, no copy paste.
When I start it, I have 3 options:
1. play
2. use
3. Just
I want to analyze a position. So I try to enter one. I do not suceed. So I enter the position in arena, put it to clipboard and paste it to winboard. Success! To analyze a position with syzygys. I do all I can (which is not much) but I do not get the right answer. Syzygys are not working.
Ending up here, I can undertand the OP.
There are GUIs, but what is usefull to analyze a position with syzygys?
My polyglot.ini file was ovreridden. This nasty farymax says it cannot analyze. What a mess.
Arena is working for me.
Kind regards
Bernhard
I can't see why the GUI has anything to do with endgame tables. I've only been using xboard for 20 years now (late 1994 start). It has always worked flawlessly for me, letting me work on Crafty to change books, endgame tables and everything in between, just sitting there as an interface that will let me play, or let me play a tournament, or let me connect to a chess server and play, or let me connect Crafty to a server to play, all worry-free. And problem free. And ALL of the chess-playing code is in Crafty where it belongs.

If you can't enter a position in winboard, I can't imagine why not. I do it all the time. You can use fen, or drag and drop/add pieces, all trivially.