Stockfish, info currmove and bad UCI practice

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Uri Blass
Posts: 10282
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Stockfish, info currmove and bad UCI practice

Post by Uri Blass »

syzygy wrote:
hgm wrote:
syzygy wrote:In so far as it "damages" the usefulness of the engine in the sense that the GUI now has no way of knowing what moves are legal in chess, then you are really asking developers to cater for the inadequacy of a GUI whose primary function is to be used for chess (or is this primary function again my imagination?).
Indeed, that is your imagination.
Ok, if xboard and winboard are not anymore about chess, then I give up. In the past they were, though.
They are also about chess but not only about chess.
The fact that you can play other games on it is an improvement
and now if you ask them to have a legal move generator for chess than by the same logic you can ask them to have a legal move generator for other games.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Stockfish, info currmove and bad UCI practice

Post by hgm »

Note also that I was talking about UCI2WB, which does not necessarily have the same design goal as WinBoard. Actually, the primary design goal of WinBoard is to be a front-end for Fairy-Max. And as Chess is one of the variants supported by Fairy-Max, it is not completely unimportant. But Fairy-Max of course does not need UCI2WB, being a native WB engine.
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: Stockfish, info currmove and bad UCI practice

Post by Rebel »

HGM, why not take all in your own hand and give Winboard a nice new feature. Create 2 new buttons:

1. Analysis Include
2. Analysis Exclude

Both modes start analyzing all moves (as in the normal analyze mode) but in these 2 modes when the user enters a move (or moves) then:

1. In "Include-mode" you send that moves to the engine and the engine only search those moves.

2. In "Exclude mode" you send moves also and the engine will remove those moves from the root list.

You put the selected moves on the screen, see: http://www.rebel.nl/pics/r917.gif and when the user clicks on a move it will be removed from your internal list and you send the new list again.

I am still missing this feature in any GUI and it's so comfortable.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Stockfish, info currmove and bad UCI practice

Post by hgm »

Well, this is pretty much how exclude-moves work in WB protocol, and how the latest WinBoard beta version implements it. Except that I don't use any explicit buttons, but let the user indicate he wants to exclude the move, rather than play it, by double-clicking the piece, rather than single-clicking it. (And after that, either drag the piece, or click the to-square, as usual). And always toggle the inclusion state, so there is no need for having separate includde and exclude modes. See http://hgm.nubati.net/news.html#tag-A1 .

The problem, however, is how to let UCI engines perform the required action. When the user excludes e2e4 from the opening position (say), the only way to do a search that excludes e2e4 in a UCI engine is to send it a 'searchmoves' command with the 19 remaining moves. To a WB engine, WB only sends 'exclude e2e4', and the engine will exclude it from its root move list, exactly like you suggest. But when the 'engine' in fact is an adapter, like Polyglot, it would now have to make this translation from e2e4 to all remaining moves, which cannot be done in a state-unaware adapter without rule knowledge without using the engine to supply a move list.

The design of UCI is really disastrous in this respect. For one, you cannot exclude any moves without aborting the search, and start a new one. For people doing hours-long analysis of orrespondence game this is really annoying. The 'exclude' command in WB protocol allows an engine to exclude moves from the current search without the need to restart the search, e.g. when the excluded move is a non-best move currently not being searched. So when, after 15 min of analysis, the user gets convinced that a position has only two reasonable moves, he can simply exclude all others without the need to redo the 15 min already invested, to speed up the search during the subsequent hour.