UCI go command precedence

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

KLc
Posts: 140
Joined: Wed Jun 03, 2020 6:46 am
Full name: Kurt Lanc

UCI go command precedence

Post by KLc »

Suppose I send (for whatever stupid reason) the following UCI go commands (with white to move):

Code: Select all

go movetime 5000 wtime 1000
and

Code: Select all

go wtime 1000 movetime 5000
What’s the thinking time then? I checked and it seems the first time has precedence. However, this is not documented in the protocol and I’m not sure if I observed a general or an exceptional feature.
Ras
Posts: 2488
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: UCI go command precedence

Post by Ras »

KLc wrote: Mon Feb 22, 2021 9:50 pmWhat’s the thinking time then?
These are contradictory parameters for mutually exclusive game modes, so the engine can follow either of them, whatever it likes.
Last edited by Ras on Mon Feb 22, 2021 9:55 pm, edited 2 times in total.
Rasmus Althoff
https://www.ct800.net
KLc
Posts: 140
Joined: Wed Jun 03, 2020 6:46 am
Full name: Kurt Lanc

Re: UCI go command precedence

Post by KLc »

Ras wrote: Mon Feb 22, 2021 9:53 pm
KLc wrote: Mon Feb 22, 2021 9:50 pmWhat’s the thinking time then?
These are contradictory parameters for mutually exclusive game modes, so the engine can follow either of them, whatever it likes.
Thank you! Then it was just due to the parsing of the particular engine I tested I suppose. Good.
Ras
Posts: 2488
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: UCI go command precedence

Post by Ras »

KLc wrote: Mon Feb 22, 2021 9:54 pmThank you! Then it was just due to the parsing of the particular engine I tested I suppose. Good.
Yeah, my engine will follow the second one because that overwrites the time handling mode suggested by the first one.
Rasmus Althoff
https://www.ct800.net
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: UCI go command precedence

Post by Ferdy »

KLc wrote: Mon Feb 22, 2021 9:50 pm Suppose I send (for whatever stupid reason) the following UCI go commands (with white to move):

Code: Select all

go movetime 5000 wtime 1000
and

Code: Select all

go wtime 1000 movetime 5000
What’s the thinking time then? I checked and it seems the first time has precedence. However, this is not documented in the protocol and I’m not sure if I observed a general or an exceptional feature.
There is a quote from the specs,

Code: Select all

If one command is not sent its value should be interpreted as it would not influence the search.
Since both are specified, determine the one that is higher and use it.

go movetime 5000 wtime 1000

movetime 5000
That is 5s.

wtime 1000
White has 1s left on the clock.

So select go movetime 5000.