Page 1 of 2

UCI Pondering workaround

Posted: Fri Jul 13, 2018 5:26 am
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?

Re: UCI Pondering workaround

Posted: Fri Jul 13, 2018 6:31 am
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.

Re: UCI Pondering workaround

Posted: Fri Jul 13, 2018 8:18 am
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.

Re: UCI Pondering workaround

Posted: Fri Jul 13, 2018 1:17 pm
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

Re: UCI Pondering workaround

Posted: Fri Jul 13, 2018 3:47 pm
by elcabesa
I'll add cutechess to the interfaces

Re: UCI Pondering workaround

Posted: Fri Jul 13, 2018 6:45 pm
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.

Re: UCI Pondering workaround

Posted: Fri Jul 13, 2018 9:49 pm
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

Re: UCI Pondering workaround

Posted: Fri Jul 13, 2018 10:03 pm
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.

Re: UCI Pondering workaround

Posted: Sat Jul 14, 2018 5:38 am
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 ?

Re: UCI Pondering workaround

Posted: Sat Jul 14, 2018 8:47 am
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: