UCI pondering or infinite search

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Dann Corbit
Posts: 8680
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: UCI pondering or infinite search

Post by Dann Corbit » Sat Nov 11, 2017 9:54 pm

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: 2898
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: UCI pondering or infinite search

Post by Evert » Sat Nov 11, 2017 10:37 pm

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: 8680
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: UCI pondering or infinite search

Post by Dann Corbit » Sat Nov 11, 2017 10:45 pm

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: 952
Joined: Tue Aug 30, 2016 6:19 pm
Contact:

Re: UCI pondering or infinite search

Post by Ras » Sat Nov 11, 2017 10:59 pm

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: 8680
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: UCI pondering or infinite search

Post by Dann Corbit » Sat Nov 11, 2017 11:38 pm

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: 22338
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: UCI pondering or infinite search

Post by hgm » Sun Nov 12, 2017 7:22 am

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: 3607
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: UCI pondering or infinite search

Post by Ferdy » Sun Nov 12, 2017 7:43 am

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: 8680
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: UCI pondering or infinite search

Post by Dann Corbit » Sun Nov 12, 2017 8:57 am

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: 3607
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: UCI pondering or infinite search

Post by Ferdy » Sun Nov 12, 2017 10:15 am

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: 8680
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: UCI pondering or infinite search

Post by Dann Corbit » Sun Nov 12, 2017 10:57 am

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.

Post Reply