UCI Pondering workaround

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

UCI Pondering workaround

Post by AndrewGrant »

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?
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
mkchan
Posts: 88
Joined: Thu Oct 06, 2016 9:17 pm
Location: India

Re: UCI Pondering workaround

Post by mkchan »

AndrewGrant wrote: Fri Jul 13, 2018 5: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: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: UCI Pondering workaround

Post by Ferdy »

AndrewGrant wrote: Fri Jul 13, 2018 5: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: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: UCI Pondering workaround

Post by jdart »

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: 855
Joined: Sun May 23, 2010 1:32 pm

Re: UCI Pondering workaround

Post by elcabesa »

I'll add cutechess to the interfaces
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: UCI Pondering workaround

Post by Ras »

AndrewGrant wrote: Fri Jul 13, 2018 5:26 amfurthermore, 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: 584
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: UCI Pondering workaround

Post by RubiChess »

Ras wrote: Fri Jul 13, 2018 6:45 pm
AndrewGrant wrote: Fri Jul 13, 2018 5:26 amfurthermore, 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: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: UCI Pondering workaround

Post by Ras »

RubiChess wrote: Fri Jul 13, 2018 9:49 pmHe 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: 1750
Joined: Tue Apr 19, 2016 6:08 am
Location: U.S.A
Full name: Andrew Grant

Re: UCI Pondering workaround

Post by AndrewGrant »

Ras wrote: Fri Jul 13, 2018 6:45 pm
AndrewGrant wrote: Fri Jul 13, 2018 5:26 amfurthermore, 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 ?
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
mkchan
Posts: 88
Joined: Thu Oct 06, 2016 9:17 pm
Location: India

Re: UCI Pondering workaround

Post by mkchan »

AndrewGrant wrote: Sat Jul 14, 2018 5:38 am
Ras wrote: Fri Jul 13, 2018 6:45 pm
AndrewGrant wrote: Fri Jul 13, 2018 5:26 amfurthermore, 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: