Time managment on ponder hit.

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mathmoi
Posts: 286
Joined: Mon Mar 13, 2006 5:23 pm
Location: Québec

Time managment on ponder hit.

Post by mathmoi »

Hi,

How do you guys manage your time after a ponder hit? I'm particularly interested in the case where you normally have the time for a (say) 10 plies search, but you went to 11 during the ponder and started the 12th ply before the hit. It seems to be a bad idea to finish this ply, since it may takes up to 4-6 times what you would have used (the time for a 10 plies search). I read in the archives of CCC that some peoples simply finish this iteration, but it seems to be a bad idea.

How are you choosing when you should move instantly (if you ever do)?
User avatar
Zach Wegner
Posts: 1922
Joined: Thu Mar 09, 2006 12:51 am
Location: Earth

Re: Time managment on ponder hit.

Post by Zach Wegner »

The way I do it is really very simple, and it makes the most sense to me. When you are predicting an opponent move, it's the same as if the opponent made that move instantly, so allocate as much time as you would for your next move. If the opponent thinks longer than this time, then you get extra searching done, but you can move immediately once the opponent moves.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Time managment on ponder hit.

Post by bob »

mathmoi wrote:Hi,

How do you guys manage your time after a ponder hit? I'm particularly interested in the case where you normally have the time for a (say) 10 plies search, but you went to 11 during the ponder and started the 12th ply before the hit. It seems to be a bad idea to finish this ply, since it may takes up to 4-6 times what you would have used (the time for a 10 plies search). I read in the archives of CCC that some peoples simply finish this iteration, but it seems to be a bad idea.

How are you choosing when you should move instantly (if you ever do)?
My algorithm is simple.

case 1. My target time is X, opponent uses Y seconds, Y is < X. I have not yet used my target, so I search an additional X-Y seconds which means I search for my original target, but only X-Y seconds were on my clock, saving time.

Case 2. My target time is X, opponent uses Y seconds, Y is >= X. If Y is much larger, I move instantly as searching longer is hopeless. If Y is < 2X (He used more than my target, but not 2 times the target or more, then I look at where I am. If I am on the first move of an iteration, I quit instantly. Otherwise I make sure I finish searching the current move (it might be trying to fail high) although I will not go over 2 times my original target...
mathmoi
Posts: 286
Joined: Mon Mar 13, 2006 5:23 pm
Location: Québec

Re: Time managment on ponder hit.

Post by mathmoi »

Zach Wegner wrote:The way I do it is really very simple, and it makes the most sense to me. When you are predicting an opponent move, it's the same as if the opponent made that move instantly, so allocate as much time as you would for your next move. If the opponent thinks longer than this time, then you get extra searching done, but you can move immediately once the opponent moves.
This make more sense, I think. Thanks.
mathmoi
Posts: 286
Joined: Mon Mar 13, 2006 5:23 pm
Location: Québec

Re: Time managment on ponder hit.

Post by mathmoi »

bob wrote:
mathmoi wrote:Hi,

How do you guys manage your time after a ponder hit? I'm particularly interested in the case where you normally have the time for a (say) 10 plies search, but you went to 11 during the ponder and started the 12th ply before the hit. It seems to be a bad idea to finish this ply, since it may takes up to 4-6 times what you would have used (the time for a 10 plies search). I read in the archives of CCC that some peoples simply finish this iteration, but it seems to be a bad idea.

How are you choosing when you should move instantly (if you ever do)?
My algorithm is simple.

case 1. My target time is X, opponent uses Y seconds, Y is < X. I have not yet used my target, so I search an additional X-Y seconds which means I search for my original target, but only X-Y seconds were on my clock, saving time.

Case 2. My target time is X, opponent uses Y seconds, Y is >= X. If Y is much larger, I move instantly as searching longer is hopeless. If Y is < 2X (He used more than my target, but not 2 times the target or more, then I look at where I am. If I am on the first move of an iteration, I quit instantly. Otherwise I make sure I finish searching the current move (it might be trying to fail high) although I will not go over 2 times my original target...
This also makes more sense. I think I'll adapt this to my engine. Thanks.
JensBNielsen

Re: Time managment on ponder hit.

Post by JensBNielsen »

Here is another way to use the pondering time:

http://www.talkchess.com/forum/viewtopi ... ht=#197697

Probably best against humans.