Stockfish's Ponder option

Discussion of chess software programming and technical issues.

Moderator: Ras

Fulvio
Posts: 396
Joined: Fri Aug 12, 2016 8:43 pm

Stockfish's Ponder option

Post by Fulvio »

I have noticed that Stockfish, Berserk, Ethereal all have a "ponder" option.
I thought it may be a clever alternative to ponderhit: set it to true at the start of the game and the engine won't stop thinking after sending bestmove.
However I tried:

Code: Select all

setoption name Ponder value true
go movetime 500
but the engine do not send bestmove because it is pondering.
How should that option be used?
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Stockfish's Ponder option

Post by hgm »

That is not what the ponder option is supposed to do. The option only serves to notify the engine that it is playing a ponder game, so that it can adapt its time management based on the assumption that part of the time it spends thinking its clock will not be running. So that it can afford more thinking time per move for the same clock settings and number of moves to go.

An engine should only think it is pondering when it has received the command "go ponder" (and no ponderhit or stop yet).

After "go movetime" an engine should always stop searching and send a "bestmove" after the specified time.

Engines that behave differently are simply not UCI compliant.
Fulvio
Posts: 396
Joined: Fri Aug 12, 2016 8:43 pm

Re: Stockfish's Ponder option

Post by Fulvio »

Thanks.
I re-checked all 3 engines and it works like you described (I probably typed something wrong before).
I have also checked Stockfish's code and indeed it just increases optimumTime by 25%:
https://github.com/official-stockfish/S ... n.cpp#L102

I have another question though: why it is not called UCI_ponder?
Are there any cases where a GUI should let the user set the value manually?
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Stockfish's Ponder option

Post by hgm »

I guess that there also is a UCI v1 and v2, like there is a CECP v1 and v2. The first version of the protocol did not have the ucinewgame command, and the UCI_ prefixing was not yet conceived. But it already did have Ponder and Hash.