UCI pondering or infinite search

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: UCI pondering or infinite search

Post by Dann Corbit »

hgm wrote:Exactly. Infinite analysis is exactly that: go on until the command is revoked, no matter how long it takes. If you want to analyze for 8 hours, you should not use go-infinite, but go-8-hours, just like Rasmus says. Then it is the engine's decision when to spit out a move, and it could do (and probably would do) all the things you wish.

If you run an EPD testsuite in XBoard, you can set it to any TC you like. You can use fixed time per move, or just specify an average time through a classical TC.
Except in profile, I have never told an engine to do infinite analysis, even once in my life. I simply don't have that much patience. ;-)

Average time is fine. But if I give you an hour and you find a mate in 13 and you know there is not a mate in 12, then sitting there doing nothing for 45 minutes is not what anyone sensible on earth would want the engine to do. At least in my limited view, that is.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: UCI pondering or infinite search

Post by Evert »

Dann Corbit wrote: Except in profile, I have never told an engine to do infinite analysis, even once in my life. I simply don't have that much patience. ;-)

Average time is fine. But if I give you an hour and you find a mate in 13 and you know there is not a mate in 12, then sitting there doing nothing for 45 minutes is not what anyone sensible on earth would want the engine to do. At least in my limited view, that is.
I don't think any engine would do that. If you tell it to think for an hour, but it finds a/the winning move in less time, it returns early. Note, though, that an engine may behave differently in analysis mode than it does in normal play. My engines, for instance, typically do multi-pv only in analysis mode.

It would be beneficial, for the purpose of doing batch analysis, if the engine could communicate to the GUI that analysis of this position is "done". It is then up to the GUI to take the engine out of analysis mode (in both UCI and CECP). In the case of UCI this is probably considered a terrible breach of the underlying philosophy though.
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: UCI pondering or infinite search

Post by Dann Corbit »

Evert wrote:
Dann Corbit wrote: Except in profile, I have never told an engine to do infinite analysis, even once in my life. I simply don't have that much patience. ;-)

Average time is fine. But if I give you an hour and you find a mate in 13 and you know there is not a mate in 12, then sitting there doing nothing for 45 minutes is not what anyone sensible on earth would want the engine to do. At least in my limited view, that is.
I don't think any engine would do that. If you tell it to think for an hour, but it finds a/the winning move in less time, it returns early. Note, though, that an engine may behave differently in analysis mode than it does in normal play. My engines, for instance, typically do multi-pv only in analysis mode.

It would be beneficial, for the purpose of doing batch analysis, if the engine could communicate to the GUI that analysis of this position is "done". It is then up to the GUI to take the engine out of analysis mode (in both UCI and CECP). In the case of UCI this is probably considered a terrible breach of the underlying philosophy though.
I have found, that to do what I want, I have to take the engines and modify the source code so that it does what I want and also writes the analysis directly do disk. This is fine with engines like Stockfish which is open source, but for some of the engines I use, they are commercial so I cannot do that.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: UCI pondering or infinite search

Post by Ras »

hgm wrote:If you want to analyze for 8 hours, you should not use go-infinite, but go-8-hours
The only pitfall to remember is not to use "movetime" with 8 hours because that's exact time in UCI, not maximum time as in CECP. That's why I came up with the "movestogo=1" idea which allows the engine to return earlier. Of course, it's up to the engine to actually do this.
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: UCI pondering or infinite search

Post by Dann Corbit »

Ras wrote:
hgm wrote:If you want to analyze for 8 hours, you should not use go-infinite, but go-8-hours
The only pitfall to remember is not to use "movetime" with 8 hours because that's exact time in UCI, not maximum time as in CECP. That's why I came up with the "movestogo=1" idea which allows the engine to return earlier. Of course, it's up to the engine to actually do this.
Yes, this is exactly what I (and any sensible person who is analyzing a batch of positions) would want.
maxtimetilldone=720 seconds
Something like that
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI pondering or infinite search

Post by hgm »

Well, like Rasmus says, this is time = 8 hours, and movestogo = 1. No problem at all in UCI to communicate that. Whether the engine would actually stop the search when it is satisfied it has found the fastest mate, or just continues to deepen until the time is up or its maximum depth is reached, is another matter, and has nothing to do with the protocol.

It is true 'movetime' asks the engine to search exactly the specified time, but I don't think it is a protocol violation to return a move earlier, if there is nothing to search. It is a protocol violation to do that in case of go-poder and go-infinite, though, because an engine isn't supposed to spontaeously terminate the search there at all.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: UCI pondering or infinite search

Post by Ferdy »

Dann Corbit wrote:
hgm wrote:Exactly. Infinite analysis is exactly that: go on until the command is revoked, no matter how long it takes. If you want to analyze for 8 hours, you should not use go-infinite, but go-8-hours, just like Rasmus says. Then it is the engine's decision when to spit out a move, and it could do (and probably would do) all the things you wish.

If you run an EPD testsuite in XBoard, you can set it to any TC you like. You can use fixed time per move, or just specify an average time through a classical TC.
Except in profile, I have never told an engine to do infinite analysis, even once in my life. I simply don't have that much patience. ;-)

Average time is fine. But if I give you an hour and you find a mate in 13 and you know there is not a mate in 12, then sitting there doing nothing for 45 minutes is not what anyone sensible on earth would want the engine to do. At least in my limited view, that is.
UCI has,

Code: Select all

go mate n
You can combine that with depth and/or movetime

Code: Select all

go mate 13 depth 80 movetime 2700000
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: UCI pondering or infinite search

Post by Dann Corbit »

Ferdy wrote:
Dann Corbit wrote:
hgm wrote:Exactly. Infinite analysis is exactly that: go on until the command is revoked, no matter how long it takes. If you want to analyze for 8 hours, you should not use go-infinite, but go-8-hours, just like Rasmus says. Then it is the engine's decision when to spit out a move, and it could do (and probably would do) all the things you wish.

If you run an EPD testsuite in XBoard, you can set it to any TC you like. You can use fixed time per move, or just specify an average time through a classical TC.
Except in profile, I have never told an engine to do infinite analysis, even once in my life. I simply don't have that much patience. ;-)

Average time is fine. But if I give you an hour and you find a mate in 13 and you know there is not a mate in 12, then sitting there doing nothing for 45 minutes is not what anyone sensible on earth would want the engine to do. At least in my limited view, that is.
UCI has,

Code: Select all

go mate n
You can combine that with depth and/or movetime

Code: Select all

go mate 13 depth 80 movetime 2700000
How is it useful if I do not know the mate depth or even if it is a mate?
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: UCI pondering or infinite search

Post by Ferdy »

Dann Corbit wrote:
Ferdy wrote:
Dann Corbit wrote:
hgm wrote:Exactly. Infinite analysis is exactly that: go on until the command is revoked, no matter how long it takes. If you want to analyze for 8 hours, you should not use go-infinite, but go-8-hours, just like Rasmus says. Then it is the engine's decision when to spit out a move, and it could do (and probably would do) all the things you wish.

If you run an EPD testsuite in XBoard, you can set it to any TC you like. You can use fixed time per move, or just specify an average time through a classical TC.
Except in profile, I have never told an engine to do infinite analysis, even once in my life. I simply don't have that much patience. ;-)

Average time is fine. But if I give you an hour and you find a mate in 13 and you know there is not a mate in 12, then sitting there doing nothing for 45 minutes is not what anyone sensible on earth would want the engine to do. At least in my limited view, that is.
UCI has,

Code: Select all

go mate n
You can combine that with depth and/or movetime

Code: Select all

go mate 13 depth 80 movetime 2700000
How is it useful if I do not know the mate depth or even if it is a mate?
If you do not know the mate depth just set at high value say

Code: Select all

go mate 1000
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: UCI pondering or infinite search

Post by Dann Corbit »

Might not be a bad work-around, but I would have to do it from the command line. No GUI can do that so far as I know
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.