Changes

Jump to: navigation, search

UCI

8,409 bytes added, 08:52, 30 April 2021
no edit summary
==Contra==
* GUIs may send very long commands (for chess positions) to chess engines
* It is hard for chess engines to process input/output without an extra thread for that duty
* Missing some useful commands/info: inform chess engines the results, no information about after movestogo GUIs will reset clock or not
 
Excerpt concerning UCI from a [[Robert Hyatt]] interview by [[Frank Quisinsky]] in 2002 <ref>[http://www.top-5000.nl/int/crafty.htm Interview with Robert Hyatt] by [[Frank Quisinsky]], May 11, 2002, hosted by [[Ed Schroder|Ed Schröder]]</ref> :
I simply don't like UCI. It subsumes '''all''' engine control parameters. It tells the engine when to [[Pondering|ponder]], when to [[Search|search]], when to stop, etc. That is contrary to my design and I have no interest in hacking [[Crafty]] to support something that is so different from the [[Chess Engine Communication Protocol|WinBoard/XBoard]] protocol that has been around for a '''long''' time and which works '''perfectly'''.
It removes several critical engine-decisions that are best made by the engine, not the GUI. [[Harm Geert Muller]] wrote on a [[Talkchess]] thread <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=7&t=72019&start=36 Re: PGN standard, its improvement and standardization] by [[Pham Hong Nguyen|Nguyen Pham]], [[CCC]], October 14, 2019 » from [[Portable Game Notation]] to [[Protocols]]</ref>  IMO statelessness w.r.t. the game state (including clocks) in UCI was a very bad idea. It is not only that it makes the communication unnecessarily verbose, but w.r.t. clocks there is a real problem: in classical TC the timing info accompanying the 'go' command does not specify how much time will be added after the 'movestogo' have been played. With movestogo=1 and wtime/btime=59000 you could be in a 40moves/hour game, at the brink of receiving another hour for the next 40 moves, in which case it would be wise to completely spend the remaining 59 sec on the upcoming move, as this is already below average. But you could also be in a 40moves/min game, where you got out of book after 39 moves, and receive only 1 new minute for the next 40. Wasting the 59 sec on a single move now effectively reduces your time for the second session by a factor 2, which would be very sub-optimal. The time management in this case should act like you have 1:59 for 41 moves (but be aware of a 'cold-turkey deadline' for the upcoming move). There is no way a UCI engine could know this.
==Pro==
* Statelessness. That reduces unsynchronised problems between chess GUIs and engines
* Chess systems (chess GUIs and chess engines) may work more stably
* Remove the need of having extra configuration/init files for engines
* Easier for chess engine developers to support: easy to parse, create commands, almost no ambiguous, straight/simple code since it is almost not required automatic algorithms
* Easier for debugging: easy to start a match from the middle of a game (using various opening types); easy to pick up a position from long logs (for debugging purposes)
* Almost all new and/or strong chess engines support UCI
* Almost all chess GUIs support
 
[[Fabien Letouzey]] emphasize the ease of implementation in a [[Frank Quisinsky|Quisinsky]] interview, April 05, 2005 <ref>[http://www.playwitharena.com/?Newsticker:Archive_7 The alternative to Crafty, Interview with Fabien Letouzey] by [[Frank Quisinsky]], [[Arena|Arena Chess GUI 3.0]] - Archive , Page 7, 96, April 05, 2005</ref> :
The choice of UCI is based on software-design principles that are not easy to explain. It's a programmer's thing really, I don't expect engine users to understand. Let me give you a clue though: think about young WinBoard engines that you have tried; how many handled pondering ... without bugs??? Another clue might be that surely, [[Stefan Meyer-Kahlen]] knows a lot about good programming, right? So trust him if not me, UCI is good for programmers because it leads to fewer bugs in the code ...
Fabien wrote a protocol translation program, [[PolyGlot]] to allow use of the new protocol on [[Linux]], though this is now supported natively by the powerful [[Scid vs. PC]] toolkit. Scid vs. PC itself includes Polyglot code to enable support for Polyglot opening books.
 
[[Marco Costalba]] replied [[Robert Hyatt]] on a [[Talkchess]] thread <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=7&t=58392&hilit=winboard&start=20#p650169 Re: Ugly UCI] by [[Kempelen]], [[CCC]], November 29, 2015 » [[Protocols]]</ref>
 
The protocol is brilliant (and you can clearly realize it was designed by a very good programmer) because allows the code needed to handle it to be:
- Straightforward
- Simple (meaning with the minimal number of 'if' branches and logic)
- General (meaning the same algorithm can handle all the different cases in an uniform fashion).
The aim of the UCI protocol is to make the code simple, that's why I think it was made for programmers by a (great) programmer.
 
[[Pham Hong Nguyen|Nguyen Pham]] replied [[Harm Geert Muller]] on a [[Talkchess]] thread <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=7&t=72019&start=36 Re: PGN standard, its improvement and standardization] by [[Pham Hong Nguyen|Nguyen Pham]], [[CCC]], October 14, 2019 » from [[Portable Game Notation]] to [[Protocols]]</ref>
 
UCI's statelessness is surely not a bad idea. Your example did not prove that (it is a bad idea) but just point out a flawed detail on UCI design.
A stateless protocol means a chess GUI must provide enough information each time an engine starts thinking. In your example, it cannot send enough information about the timer since the protocol does not mention it. It is not a big deal since programmers can solve that issue easily by adding some assumes. Of course, it is better one day we can fix those flawed details in the protocol (version 2?).
 
I have written engines with both protocols (UCI, WB) and now support them all in my own chess GUI. Thus I have my own ideas about the strong points of each. Both are so good and can do so well their jobs. The stateless idea is the central point of UCI, which makes it a bit more suitable for modern computers and programming - that is why recently it becomes very popular.
=Engines=
* [[:Category:UCI|UCI Engines]]* [[:Category:Linux |Linux UCI Engines]]
<span id="GUI"></span>
=[[GUI|GUIs]]=
* [[Aquarium]]
* [[Arena]]
* [[Banksia]]
* [[Banksia GUI]]
* [[Chess Assistant]]
* [[ChessBase (Database)]]
* [[Cute Chess]]
* [[Fritz#FritzGUI|Fritz GUI]]
* [[Hiarcs HIARCS Chess Explorer]]
* [[Jerry]]
* [[jose]]
* [[Shredder#GUI|Shredder GUI]]
* [[Tarrasch]]
 
=[[CLI|CLIs]]=
* [[Cutechess-cli]]
* [[c-chess-cli]]
=Utilities=
* [[CPW-Engine_com]]
* [[Engine Testing]]
* [[USI]] - Universal Shogi Interface
* [[Vice#UCI|Vice UCI-Videos]]
* [[WinBoard]]
* [http://www.talkchess.com/forum/viewtopic.php?t=33088 UCI extensions for kibitzing] by [[Aaron Becker]], [[CCC]], March 05, 2010
* [http://www.talkchess.com/forum/viewtopic.php?t=34481 UCI issues] by [[Miguel A. Ballicora]], [[CCC]], May 24, 2010
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=37126 UCI-compatible interface for 10x8 chess?] by [[Norbert Raimund Leisner]], [[CCC]], December 17, 2010
* [http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&p=381800 some UCI protocol issues/questions] by [[Jon Dart]], [[CCC]], December 17, 2010
'''2011'''
* [http://www.talkchess.com/forum/viewtopic.php?t=42037 About UCI multipv] by [[Fermin Serrano]], [[CCC]], January 17, 2012 » [[Principal Variation#MultiPV|Multi-PV]]
* [http://www.talkchess.com/forum/viewtopic.php?t=42154 good macintosh guy for UCI engine development] by [[Sam Hamilton]], [[CCC]], January 25, 2012 » [[GUI]], [[Macintosh]], [[Mac OS]]
* [https://open-chess.org/viewtopic.php?f=7&t=2053 Remote UCI engines and port forwarding] by itias, [[Computer Chess Forums|OpenChess Forum]], August 01, 2012
* [http://www.open-chess.org/viewtopic.php?f=5&t=2146 Ponder and UCI] by geko, [[Computer Chess Forums|OpenChess Forum]], November 19, 2012 » [[Pondering]]
* [http://www.talkchess.com/forum/viewtopic.php?t=46586 Problem with UCI engines hash in Arena] by Carl Langan, [[CCC]], December 26, 2012 » [[Arena]]
'''2013'''
* [http://www.open-chess.org/viewtopic.php?f=5&t=2221 UCI Programming] by [[Christian Daley|CDaley11]], [[Computer Chess Forums|OpenChess Forum]], January 15, 2013
* [http://www.open-chess.org/viewtopic.php?f=5&t=2245 UCI protocol not working] by [[Christian Daley|CDaley11]], [[Computer Chess Forums|OpenChess Forum]], January 27, 2013
* [http://www.open-chess.org/viewtopic.php?f=5&t=2357 UCI Interfacing question] by epideath, [[Computer Chess Forums|OpenChess Forum]], July 05, 2013
* [http://www.talkchess.com/forum/viewtopic.php?t=48768 UCI protocol issue] by [[Jon Dart]], [[CCC]], July 27, 2013 » [[Repetitions]]
'''2014'''
* [http://www.talkchess.com/forum/viewtopic.php?t=51763 JSUCI 1.0 - connect javascript chess engines to UCI] by [[Edmund Moshammer]], [[CCC]], March 28, 2014 » [[JavaScript]] <ref>[http://sourceforge.net/projects/jsuci/ Javascript Universal Chess Interface | Free software downloads at SourceForge.net] by [[Edmund Moshammer]]</ref>
* [http://www.talkchess.com/forum/viewtopic.php?t=51973 MadChess UCI_LimitStrength Algorithm] by [[Erik Madsen]], [[CCC]], April 12, 2014 » [[MadChess]], [[Playing Strength]]
* [http://www.talkchess.com/forum/viewtopic.php?t=52661 UCI, ownbooks, and a potential problem] by [[Miguel A. Ballicora]], [[CCC]], June 16, 2014 » [[Opening Book]]
* [http://www.talkchess.com/forum/viewtopic.php?t=53123 UCI exclude move] by [[Steven Atkinson]], [[CCC]], July 30, 2014
* [http://www.talkchess.com/forum/viewtopic.php?t=56776 ponder engine-gui interaction] by [[Alexandru Mosoi]], [[CCC]], June 25, 2015 » [[Pondering]]
* [http://www.talkchess.com/forum/viewtopic.php?t=56935 Crafty UCI version] by [[Marek Soszynski]], July 10, 2015 » [[Crafty]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=58176 UCI OwnBook shim?] by [[Ian Osgood]], [[CCC]], November 07, 2015 » [[PolyGlot]]
* [http://www.talkchess.com/forum/viewtopic.php?t=58392 Ugly UCI] by [[Fermin Serrano]], [[CCC]], November 27, 2015
: [http://www.talkchess.com/forum/viewtopic.php?t=58392&start=9 Re: Ugly UCI] by [[Marcel van Kervinck]], [[CCC]], November 27, 2015
* [http://www.talkchess.com/forum/viewtopic.php?t=64679 UCI error codes?] by [[Rasmus Althoff]], [[CCC]], July 21, 2017
* [http://www.talkchess.com/forum/viewtopic.php?t=65324 Regarding UCI Pondering] by [[Manik Charan]], [[CCC]], September 28, 2017 » [[Pondering]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=65454 Loading opening book and tablebases (xboard vs uci)] by [[Pedro Castro]], [[CCC]], October 15, 2017 » [[Chess Engine Communication Protocol]]
* [http://www.talkchess.com/forum/viewtopic.php?t=65679 UCI pondering or infinite search] by Lucas Braesch, [[CCC]], November 10, 2017 » [[Pondering]]
* [http://www.talkchess.com/forum/viewtopic.php?t=65913 Regarding options ponder flag] by [[Jürgen Précour]], [[CCC]], December 06, 2017 » [[Pondering]]
'''2018'''
* [http://www.talkchess.com/forum/viewtopic.php?t=66745 UCI vs Winboard question] by [[Michael Sherwin]], [[CCC]], March 05, 2018 » [[Chess Engine Communication Protocol]], [[WinBoard]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=67971 UCI Pondering workaround] by [[Andrew Grant]], [[CCC]], July 13, 2018 » [[Pondering]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=68703 ExaChess interface UCI to program] by [[Stuart Cracraft]], [[CCC]], October 20, 2018
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=69279 UCI pondering done right] by lucasart, [[CCC]], December 16, 2018 » [[Pondering]]
'''2019'''
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=69746 UCI question] by [[Ed Schroder|Ed Schröder]], [[CCC]], January 28, 2019
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=71050 Ambiguous: UCI and option Clear Hash] by [[Pham Hong Nguyen|Nguyen Pham]], [[CCC]], June 20, 2019
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=71617 Sending pure comments using UCI protocol] by [[Vivien Clauzon]], [[CCC]], August 21, 2019
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=72019&start=36 Re: PGN standard, its improvement and standardization] by [[Pham Hong Nguyen|Nguyen Pham]], [[CCC]], October 14, 2019 » from [[Portable Game Notation]] to [[Protocols]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=72140 UCI Win/Draw/Loss reporting] by [[Gian-Carlo Pascutto]], [[CCC]], October 22, 2019 » [[Pawn Advantage, Win Percentage, and Elo]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=72686 UCI pondering and time management] by [[Vivien Clauzon]], [[CCC]], December 30, 2019 » [[Pondering]], [[Time Management]]
==2020 ...==
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=73592 UCI to CECP] by Fulvio, [[CCC]], April 07, 2020 » [[Chess Engine Communication Protocol|CECP]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=73617 UCI Options, clarifation] by Alan Cooper, [[CCC]], April 10, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=75218 Remote UCI] by [[Daniel José Queraltó]], [[CCC]], September 26, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75783 UCI wrapper?] by Kurt Lanc, [[CCC]], November 13, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75992 UCI Gui to remote Linux Engine] by [[Joshua Shriver]], [[CCC]], December 05, 2020 » [[GUI]], [[Linux]]
'''2021'''
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=76344 Uci "go" command without other parameters] by [[Vivien Clauzon]], [[CCC]], January 17, 2021
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=77088 Missing input in ponder] by [[Fabio Gobbato]], [[CCC]], April 15, 2021 » [[Pondering]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=77189 Listening for GUI input when searching] by [[Niels Abildskov]], [[CCC]], April 27, 2021 » [[GUI]], [[Search]], [[Thread]]
=External Links=
=References=
<references />
 
'''[[Protocols|Up one Level]]'''
[[Category:Videos]]

Navigation menu