Time managment on ponder hit.

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
mathmoi
Posts: 265
Joined: Mon Mar 13, 2006 4:23 pm
Location: Québec
Contact:

Time managment on ponder hit.

Post by mathmoi » Tue Jun 16, 2009 2:31 am

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: Wed Mar 08, 2006 11:51 pm
Location: Earth
Contact:

Re: Time managment on ponder hit.

Post by Zach Wegner » Tue Jun 16, 2009 2:58 am

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: 20358
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Time managment on ponder hit.

Post by bob » Tue Jun 16, 2009 3:26 am

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: 265
Joined: Mon Mar 13, 2006 4:23 pm
Location: Québec
Contact:

Re: Time managment on ponder hit.

Post by mathmoi » Tue Jun 16, 2009 11:32 am

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: 265
Joined: Mon Mar 13, 2006 4:23 pm
Location: Québec
Contact:

Re: Time managment on ponder hit.

Post by mathmoi » Tue Jun 16, 2009 11:33 am

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 » Tue Jun 16, 2009 6:17 pm

Here is another way to use the pondering time:

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

Probably best against humans.

Post Reply