UCI Pondering workaround

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.
AndrewGrant
Posts: 418
Joined: Tue Apr 19, 2016 4:08 am
Location: U.S.A
Full name: Andrew Grant
Contact:

UCI Pondering workaround

Post by AndrewGrant » Fri Jul 13, 2018 3:26 am

I'm trying to implement pondering, without having to deal with all of the ponderhit, send bestmove on stop, ... bs that is baked into the UCI spec.

Here is a sample that I would like to follow

Code: Select all

--> position startpos 
--> go wtime 10000 btime 10000
<-- info depth 1 ...
<-- ....
<-- bestmove e2e4 // NO PONDER MOVE!
--> position startpos moves e2e4
--> go ponder
...... wait for opponent to play move ....
--> stop
--> position startpos e2e4 opponentsMove
--> go wtime 9000 ....
So I want to do whatever I want on my own time. The question is will I get a "go ponder" if I don't send a ponder move?

furthermore, if the answer is no, I will do what I want and break the UCI spec. Will I still get a "stop" before the next position command, or will I have to trigger my own stop when seeing the new position?

mkchan
Posts: 72
Joined: Thu Oct 06, 2016 7:17 pm
Location: India
Contact:

Re: UCI Pondering workaround

Post by mkchan » Fri Jul 13, 2018 4:31 am

AndrewGrant wrote:
Fri Jul 13, 2018 3:26 am
I'm trying to implement pondering, without having to deal with all of the ponderhit, send bestmove on stop, ... bs that is baked into the UCI spec.

Here is a sample that I would like to follow

Code: Select all

--> position startpos 
--> go wtime 10000 btime 10000
<-- info depth 1 ...
<-- ....
<-- bestmove e2e4 // NO PONDER MOVE!
--> position startpos moves e2e4
--> go ponder
...... wait for opponent to play move ....
--> stop
--> position startpos e2e4 opponentsMove
--> go wtime 9000 ....
So I want to do whatever I want on my own time. The question is will I get a "go ponder" if I don't send a ponder move?

furthermore, if the answer is no, I will do what I want and break the UCI spec. Will I still get a "stop" before the next position command, or will I have to trigger my own stop when seeing the new position?
I don't think you'll get a go ponder. You only get that once you tell UCI you want to ponder on some move. You might as well tell it you want to ponder on some move and instead do whatever you want in your own time anyway. UCI will just send you the next position command once the other engine has played, you can deal with it however you want. If UCI sends you ponderhit, it just means the move y you gave it in your move x ponder y. It's not hard and fast that you have to ponder the ponder move according to the spec itself.

Ferdy
Posts: 3620
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: UCI Pondering workaround

Post by Ferdy » Fri Jul 13, 2018 6:18 am

AndrewGrant wrote:
Fri Jul 13, 2018 3:26 am
I'm trying to implement pondering, without having to deal with all of the ponderhit, send bestmove on stop, ... bs that is baked into the UCI spec.

Here is a sample that I would like to follow

Code: Select all

--> position startpos 
--> go wtime 10000 btime 10000
<-- info depth 1 ...
<-- ....
<-- bestmove e2e4 // NO PONDER MOVE!
--> position startpos moves e2e4
--> go ponder
...... wait for opponent to play move ....
--> stop
--> position startpos e2e4 opponentsMove
--> go wtime 9000 ....
So I want to do whatever I want on my own time. The question is will I get a "go ponder" if I don't send a ponder move?
No
AndrewGrant wrote: furthermore, if the answer is no, I will do what I want and break the UCI spec. Will I still get a "stop" before the next position command,
You cannot get a stop because the interface knew it did not send a go ponder to you.
AndrewGrant wrote: or will I have to trigger my own stop when seeing the new position?
Yes.

jdart
Posts: 3585
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: UCI Pondering workaround

Post by jdart » Fri Jul 13, 2018 11:17 am

You should be aware that there are a lot of UCI interfaces and they don't all follow the spec, plus there is some ambiguity in the spec itself.

At least, you should test with: Arena, Fritz, Shredder, Winboard/Polygot.

--Jon

elcabesa
Posts: 732
Joined: Sun May 23, 2010 11:32 am
Contact:

Re: UCI Pondering workaround

Post by elcabesa » Fri Jul 13, 2018 1:47 pm

I'll add cutechess to the interfaces

Ras
Posts: 1015
Joined: Tue Aug 30, 2016 6:19 pm
Contact:

Re: UCI Pondering workaround

Post by Ras » Fri Jul 13, 2018 4:45 pm

AndrewGrant wrote:
Fri Jul 13, 2018 3:26 am
furthermore, if the answer is no, I will do what I want and break the UCI spec.
Great idea if you want to infuriate testers because effectively, your engine will be stealing computing power from your opponent during his thinking time. In CCRL, pondering is off because both engines run on the same machine. Trashing the CPU in the opponent's time should lead to disqualification of the engine.

That's why UCI says that the engine must not ponder without being told to do so.
Rasmus Althoff
https://www.ct800.net

RubiChess
Posts: 30
Joined: Fri Mar 30, 2018 5:20 am

Re: UCI Pondering workaround

Post by RubiChess » Fri Jul 13, 2018 7:49 pm

Ras wrote:
Fri Jul 13, 2018 4:45 pm
AndrewGrant wrote:
Fri Jul 13, 2018 3:26 am
furthermore, if the answer is no, I will do what I want and break the UCI spec.
Great idea if you want to infuriate testers because effectively, your engine will be stealing computing power from your opponent during his thinking time. In CCRL, pondering is off because both engines run on the same machine. Trashing the CPU in the opponent's time should lead to disqualification of the engine.

That's why UCI says that the engine must not ponder without being told to do so.
I don't think that Andrew wants to use CPU on opponents time if ponder is off. He just doesn't want to send a ponder move to be allowed to use the CPU when pondering is on. Workaround would be to just send a random legal move as ponder move and then do what you want.

Andreas

Ras
Posts: 1015
Joined: Tue Aug 30, 2016 6:19 pm
Contact:

Re: UCI Pondering workaround

Post by Ras » Fri Jul 13, 2018 8:03 pm

RubiChess wrote:
Fri Jul 13, 2018 7:49 pm
He just doesn't want to send a ponder move to be allowed to use the CPU when pondering is on. Workaround would be to just send a random legal move as ponder move and then do what you want.
That should work. UCI explicitely says that if the GUI tells the engine to ponder on a specific move (which usually is the one the engine had told the GUI before), the engine is free to ponder other moves. That happens e.g. if during ponder, the engine sees that the move it originally wanted to ponder on is bad. However, UCI also says that the engine should not send PVs in that case because it can confuse the GUI if the PV doesn't start with the move the engine had been told to ponder on.
Rasmus Althoff
https://www.ct800.net

AndrewGrant
Posts: 418
Joined: Tue Apr 19, 2016 4:08 am
Location: U.S.A
Full name: Andrew Grant
Contact:

Re: UCI Pondering workaround

Post by AndrewGrant » Sat Jul 14, 2018 3:38 am

Ras wrote:
Fri Jul 13, 2018 4:45 pm
AndrewGrant wrote:
Fri Jul 13, 2018 3:26 am
furthermore, if the answer is no, I will do what I want and break the UCI spec.
Great idea if you want to infuriate testers because effectively, your engine will be stealing computing power from your opponent during his thinking time. In CCRL, pondering is off because both engines run on the same machine. Trashing the CPU in the opponent's time should lead to disqualification of the engine.

That's why UCI says that the engine must not ponder without being told to do so.
Well this is a non issue. If you don't want Ethereal pondering, then don't set pondering ?

mkchan
Posts: 72
Joined: Thu Oct 06, 2016 7:17 pm
Location: India
Contact:

Re: UCI Pondering workaround

Post by mkchan » Sat Jul 14, 2018 6:47 am

AndrewGrant wrote:
Sat Jul 14, 2018 3:38 am
Ras wrote:
Fri Jul 13, 2018 4:45 pm
AndrewGrant wrote:
Fri Jul 13, 2018 3:26 am
furthermore, if the answer is no, I will do what I want and break the UCI spec.
Great idea if you want to infuriate testers because effectively, your engine will be stealing computing power from your opponent during his thinking time. In CCRL, pondering is off because both engines run on the same machine. Trashing the CPU in the opponent's time should lead to disqualification of the engine.

That's why UCI says that the engine must not ponder without being told to do so.
Well this is a non issue. If you don't want Ethereal pondering, then don't set pondering ?
So you're saying Ethereal will only reliably not be using the CPU at any given point in time when the UCI option is off? Why not just do Xboard if you're so against the point of the UCI spec :lol:

Post Reply