UCI pondering and time management

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

UCI pondering and time management

Post by xr_a_y »

I think I finally understood UCI pondering ... and implemented it.

I new question for me is what to do with time management on a ponderhit ?

Probably both engines handle time more or less the same way so if opponent returned a move, there is a high probability that my standard allocated time is also over. I thus have some choices to do :
- go on with search with my own time as current depth was reached during opponent time in order to go deeper than my opponent
- return immediatly and keep time for later in the game
- anything in between (like going on for 5/4 or 3/2 the the standard allocated time

Other refinement based on remaining opponent time are not in my scope right now ...

What do you do with this ?
User avatar
hgm
Posts: 27795
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI pondering and time management

Post by hgm »

Return immediately if you have already spent the time after which you would return immediately. If the time spent is such that you would normally not abort the current iteration, you should finish it after a ponderhit too.

Note that your target time in a ponder game can be longer as it would otherwise be, as part of the thinking will take place when the opponent's clock is running. So when the UCI Ponder option is set you should base your time calculation not just on your own time left, but (say) on own_time + 0.6 * opponent_time.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: UCI pondering and time management

Post by xr_a_y »

hgm wrote: Mon Dec 30, 2019 9:27 pm Note that your target time in a ponder game can be longer as it would otherwise be, as part of the thinking will take place when the opponent's clock is running. So when the UCI Ponder option is set you should base your time calculation not just on your own time left, but (say) on own_time + 0.6 * opponent_time.
Which is a first shot will be approximated by min(own_time*3/2, total_remaining_time - safe_margin)
elcabesa
Posts: 855
Joined: Sun May 23, 2010 1:32 pm

Re: UCI pondering and time management

Post by elcabesa »

my time management algorithm is quite simple when pondering. Vajolet starts pondering then as soon as a "ponderhit" is received the standard time management starts and Vajolet allocate time based only on his own time.

I do the same when playing in real chess, I ponder on the opponent time, but as soon is my turn I allocate some time and use it, indipendently from the opponent velocity on replying to my moves.

I don't know if this is a good time managment, and how good it's :)