ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

UCI pondering or infinite search
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Ferdinand Mosca



Joined: 10 Aug 2008
Posts: 3429
Location: Philippines

PostPost subject: Re: UCI pondering or infinite search    Posted: Fri Nov 10, 2017 5:00 am Reply to topic Reply with quote

lucasart wrote:
Is there a good reason why the engine can't print bestmove upon completion of the ID loop (eg. depth=127 completed) ?

I mean a good reason beyond the "it's written in the UCI protocol".

This seems to me like a design flaw of UCI, forcing engine programmers to add hacks and convoluted code for no reason. Am I missing something ?


Code:
   * infinite
      search until the "stop" command. Do not exit the search without being told so in this mode!
   
* stop
   stop calculating as soon as possible,
   don't forget the "bestmove" and possibly the "ponder" token when finishing the search

Regarding infinite, this is understandable, infinite has no limits on depth and time etc, if you don't want to search anymore, then just send say,
Code:
info string "I am done, this is just mate in 1, my bestmove is ...."

But when you receive stop command, better send your bestmove
Code:
bestmove ....

This way you still comply generally with the protocol by sending your bestmove after the stop command.

There is a story telling behind this. The user is the boss, not the engine. If you sent info string "I am done ..." the boss would be glad that he is informed and the boss now would stop the infinite search.
Code:
// tell the engine to search infinite from the start position after 1.e4 e5
position startpos moves e2e4 e7e5
go infinite

// the engine starts sending infos about the search to the GUI
// (only some examples are given)


      info depth 1 seldepth 0
      info score cp 13  depth 1 nodes 13 time 15 pv f1b5
      info depth 2 seldepth 2
      info nps 15937
      info score cp 14  depth 2 nodes 255 time 15 pv f1c4 f8c5
      info depth 2 seldepth 7 nodes 255
      info depth 3 seldepth 7
      info nps 26437
      info score cp 20  depth 3 nodes 423 time 15 pv f1c4 g8f6 b1c3
      info nps 41562
      ....


// here the user has seen enough and asks to stop the searching
stop

// the engine has finished searching and is sending the bestmove command
// which is needed for every "go" command sent to tell the GUI
// that the engine is ready again
      bestmove g1f3 ponder d8f6
Back to top
View user's profile Send private message
Display posts from previous:   
Subject Author Date/Time
UCI pondering or infinite search Lucas Braesch Fri Nov 10, 2017 2:07 am
      Re: UCI pondering or infinite search Álvaro Begué Fri Nov 10, 2017 2:30 am
      Re: UCI pondering or infinite search Ferdinand Mosca Fri Nov 10, 2017 5:00 am
            Re: UCI pondering or infinite search Dann Corbit Fri Nov 10, 2017 6:17 am
                  Re: UCI pondering or infinite search Michel Van den Bergh Fri Nov 10, 2017 9:30 am
                        Re: UCI pondering or infinite search Marco Belli Fri Nov 10, 2017 11:27 am
                              Re: UCI pondering or infinite search H.G.Muller Fri Nov 10, 2017 11:32 am
                                    Re: UCI pondering or infinite search Marco Belli Fri Nov 10, 2017 11:42 am
                              Re: UCI pondering or infinite search Dann Corbit Sat Nov 11, 2017 9:03 pm
                  Re: UCI pondering or infinite search Rasmus Althoff Fri Nov 10, 2017 8:29 pm
                        Re: UCI pondering or infinite search Dann Corbit Sat Nov 11, 2017 9:06 pm
                              Re: UCI pondering or infinite search Rasmus Althoff Sat Nov 11, 2017 9:25 pm
                                    Re: UCI pondering or infinite search H.G.Muller Sat Nov 11, 2017 9:49 pm
                                          Re: UCI pondering or infinite search Dann Corbit Sat Nov 11, 2017 9:54 pm
                                                Re: UCI pondering or infinite search Evert Glebbeek Sat Nov 11, 2017 10:37 pm
                                                      Re: UCI pondering or infinite search Dann Corbit Sat Nov 11, 2017 10:45 pm
                                                Re: UCI pondering or infinite search Ferdinand Mosca Sun Nov 12, 2017 7:43 am
                                                      Re: UCI pondering or infinite search Dann Corbit Sun Nov 12, 2017 8:57 am
                                                            Re: UCI pondering or infinite search Ferdinand Mosca Sun Nov 12, 2017 10:15 am
                                                                  Re: UCI pondering or infinite search Dann Corbit Sun Nov 12, 2017 10:57 am
                                                                        Re: UCI pondering or infinite search Ferdinand Mosca Sun Nov 12, 2017 11:20 am
                                          Re: UCI pondering or infinite search Rasmus Althoff Sat Nov 11, 2017 10:59 pm
                                                Re: UCI pondering or infinite search Dann Corbit Sat Nov 11, 2017 11:38 pm
                                                      Re: UCI pondering or infinite search H.G.Muller Sun Nov 12, 2017 7:22 am
                                                            Re: UCI pondering or infinite search Rasmus Althoff Sun Nov 12, 2017 11:03 am
      Re: UCI pondering or infinite search H.G.Muller Fri Nov 10, 2017 6:50 am
      Re: UCI pondering or infinite search Fabien Letouzey Fri Nov 10, 2017 11:26 am
            Re: UCI pondering or infinite search Evert Glebbeek Fri Nov 10, 2017 3:26 pm
            Re: UCI pondering or infinite search Lucas Braesch Sat Nov 11, 2017 12:38 am
                  Re: UCI pondering or infinite search H.G.Muller Sat Nov 11, 2017 7:26 am
                        Re: UCI pondering or infinite search Evert Glebbeek Sat Nov 11, 2017 9:18 am
      Re: UCI pondering or infinite search Rasmus Althoff Fri Nov 10, 2017 8:41 pm
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads