Ponder and UCI

Code, algorithms, languages, construction...
Post Reply
geko
Posts: 34
Joined: Mon Aug 01, 2011 5:11 pm

Ponder and UCI

Post by geko » Mon Nov 19, 2012 3:20 pm

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.

geko
Posts: 34
Joined: Mon Aug 01, 2011 5:11 pm

Re: Ponder and UCI

Post by geko » Mon Nov 26, 2012 10:01 am

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.

Richard Vida
Posts: 50
Joined: Thu Jun 10, 2010 12:48 am

Re: Ponder and UCI

Post by Richard Vida » Mon Nov 26, 2012 1:27 pm

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...

geko
Posts: 34
Joined: Mon Aug 01, 2011 5:11 pm

Re: Ponder and UCI

Post by geko » Mon Nov 26, 2012 3:04 pm

thanks Richard,
in first example, why
position p1 moves a2a3 a7a6 ???
should it be position p1 moves a2a3
a7a6 is the expected value

Richard Vida
Posts: 50
Joined: Thu Jun 10, 2010 12:48 am

Re: Ponder and UCI

Post by Richard Vida » Tue Nov 27, 2012 9:05 am

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).

Post Reply