Page 1 of 1

Ponder and UCI

Posted: Mon Nov 19, 2012 3:20 pm
by geko
I have difficulty in the command ponderhit and when to use the stop command.
Can you explain to me step by step dialogue between two UCI engines using ponder?

best regards
g.

Re: Ponder and UCI

Posted: Mon Nov 26, 2012 10:01 am
by geko
as an example, is this a correct sequence of commands?
...
engine_1 -> bestmove a2a3 a7a6 ponderhit
engine_1 continues the search in ponder mode
engine_2 -> ponderhit
engine_1 plays a7a6, stops the ponder, continues the standard search and responds with bestmove b2b3
...

best regards
g.

Re: Ponder and UCI

Posted: Mon Nov 26, 2012 1:27 pm
by Richard Vida
geko wrote:as an example, is this a correct sequence of commands?
...
engine_1 -> bestmove a2a3 a7a6 ponderhit
engine_1 continues the search in ponder mode
engine_2 -> ponderhit
engine_1 plays a7a6, stops the ponder, continues the standard search and responds with bestmove b2b3
...

best regards
g.
Ponderhit example:

gui -> engine: position p1 [initial position]
gui -> engine: go wtime xxx btime yyy [engine starts searching]
... time passes
gui <- engine: bestmove a2a3 ponder a7a6 [engine stops]
gui -> engine: position p1 moves a2a3 a7a6 [position after ponder move]
gui -> engine: go ponder wtime xxx btime yyy [engine starts searching]
... time passes (engine does not stop searching until 'stop' or 'ponderhit' is received)
gui -> engine: ponderhit [engine may or may not continue searching depending on time management]
... time passes (or not, engine is free to reply instantly)
gui <- engine: bestmove a3a4 ponder a6a5

Pondermiss example:

gui -> engine: position p1
gui -> engine: go wtime xxx btime yyy [engine starts searching]
... time passes
gui <- engine: bestmove a2a3 ponder a7a6 [engine stops]
gui -> engine: position p1 moves a2a3 a7a6
gui -> engine: go ponder wtime xxx btime yyy [engine starts searching]
... time passes (engine does not stop until 'stop' or 'ponderhit' is received)
gui -> engine: stop [engine stops searching]
gui <- engine: bestmove m1 ponder m2 [this is discarded by gui -]
gui -> engine: position p1 moves a2a3 b7b6... [- because engine2 played a different move]
gui -> engine: go...

Re: Ponder and UCI

Posted: Mon Nov 26, 2012 3:04 pm
by geko
thanks Richard,
in first example, why
position p1 moves a2a3 a7a6 ???
should it be position p1 moves a2a3
a7a6 is the expected value

Re: Ponder and UCI

Posted: Tue Nov 27, 2012 9:05 am
by Richard Vida
geko wrote:thanks Richard,
in first example, why
position p1 moves a2a3 a7a6 ???
should it be position p1 moves a2a3
a7a6 is the expected value
No. With UCI you never ponder the opponents move. You ponder your next move (as if the opponent already played the predicted reply).