Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about fixing the time management of movei

Author: Robert Hyatt

Date: 14:39:14 07/28/04

Go up one level in this thread


On July 28, 2004 at 11:28:19, Uri Blass wrote:

>On July 28, 2004 at 11:16:49, Uri Blass wrote:
>
>>On July 28, 2004 at 10:52:44, Robert Hyatt wrote:
>>
>>>On July 28, 2004 at 01:56:04, Uri Blass wrote:
>>>
>>>>On July 28, 2004 at 01:43:38, Matthew Hull wrote:
>>>>
>>>>>On July 27, 2004 at 22:44:31, Robert Hyatt wrote:
>>>>>
>>>>>>On July 27, 2004 at 19:53:32, Uri Blass wrote:
>>>>>>
>>>>>>>On July 27, 2004 at 19:37:13, Robert Hyatt wrote:
>>>>>>>
>>>>>>>>On July 27, 2004 at 18:53:29, Uri Blass wrote:
>>>>>>>>
>>>>>>>>>On July 27, 2004 at 18:10:11, Robert Hyatt wrote:
>>>>>>>>>
>>>>>>>>>>On July 27, 2004 at 16:53:17, Uri Blass wrote:
>>>>>>>>>>
>>>>>>>>>>>On July 27, 2004 at 16:01:09, Robert Hyatt wrote:
>>>>>>>>>>>
>>>>>>>>>>>>On July 27, 2004 at 15:25:50, Uri Blass wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>>On July 27, 2004 at 13:26:54, Robert Hyatt wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>>On July 27, 2004 at 12:42:42, Uri Blass wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>On July 27, 2004 at 11:11:10, Robert Hyatt wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>On July 27, 2004 at 03:18:50, Sune Fischer wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>On July 25, 2004 at 22:01:31, Robert Hyatt wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>Bad idea.  Start the next iteration even if you don't think you will have time
>>>>>>>>>>>>>>>>>>to finish it.  You might fail low.  Wouldn't that be nice to know?  :)
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>This may or may not be a good idea.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>I think if it is a good idea, then you should always try and search the next
>>>>>>>>>>>>>>>>>iteration for a short time to see if you get a quick fail-low.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>On the other hand, if it is a bad idea it is better to save the time that will
>>>>>>>>>>>>>>>>>probably be wasted anyway.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>From what I can tell you propose to do a mixture, i.e. to use extra time if the
>>>>>>>>>>>>>>>>>time manager tells you to?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>I really doubt this is the best way, because it will be extremely random when
>>>>>>>>>>>>>>>>>you get to begin the next ply.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>No idea what that means.  I set a target time.  If I have not used that much
>>>>>>>>>>>>>>>>time, I keep searching.  Whether that means starting a new iteration or
>>>>>>>>>>>>>>>>continuing on the current iteration.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>When the target time is reached, I set a flag that says "do not search another
>>>>>>>>>>>>>>>>root move, but don't stop until either the current root move has been searched
>>>>>>>>>>>>>>>>or 2x the time limit has been used."  This does not apply if the root move being
>>>>>>>>>>>>>>>>searched is the first one in the list...
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>Basically there are 2 cases to consider.
>>>>>>>>>>>>>>>case 1:you did not expect the opponent move correctly.
>>>>>>>>>>>>>>>case 2:You expected the opponent move correctly.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>I completely ignore this.  My only purpose for "pondering" is to save time so
>>>>>>>>>>>>>>that I have more later when I need it.
>>>>>>>>>>>>>
>>>>>>>>>>>>>I think that it is wrong to ignore it because the situation is not the same.
>>>>>>>>>>>>>
>>>>>>>>>>>>>suppose that you have 2 minutes to finish the game when the opponent played fast
>>>>>>>>>>>>>in previous moves and have 20 minutes to finish the game
>>>>>>>>>>>>>
>>>>>>>>>>>>>Suppose also that the opponent used 2 minutes for the last move.
>>>>>>>>>>>>>
>>>>>>>>>>>>>If you pondered the correct move you can use more than 2 minutes without losing
>>>>>>>>>>>>>on time(you count in that case also the time that you used in the opponent time
>>>>>>>>>>>>>otherwise you can never reply immediatly) and there may be cases when you want
>>>>>>>>>>>>>to do it(for example after a big fail low when you hope to find a better move).
>>>>>>>>>>>>
>>>>>>>>>>>>I don't understand.  When I am "pondering" I have no "time limit" to deal with.
>>>>>>>>>>>>The time limit is set when my opponent actually moves and my clock starts.  I
>>>>>>>>>>>>will generally "move instantly" in such a case where I have a small time target
>>>>>>>>>>>>but used a lot of time waiting on my opponent...
>>>>>>>>>>>
>>>>>>>>>>>Suppose that it is game in 30 minutes without increasment to do things more
>>>>>>>>>>>simple.
>>>>>>>>>>>
>>>>>>>>>>>If I understand correctly you simply use the following factors to decide if to
>>>>>>>>>>>play immediatly.
>>>>>>>>>>>
>>>>>>>>>>>1)target time that is based on the time that you have to finish the game.
>>>>>>>>>>
>>>>>>>>>>Correct...
>>>>>>>>>>
>>>>>>>>>>>2)time used that is based on the time that you started the search(if you
>>>>>>>>>>>pondered correctly it is a positive number and if you pondered wrong it is 0)
>>>>>>>>>>
>>>>>>>>>>No.  It is zero for either case.  IE my "ponder start time" is the instant I
>>>>>>>>>>start pondering.  My non-ponder-start-time is the instant I start searching.  My
>>>>>>>>>>time limit will either be ponder-start-time + time limit, or
>>>>>>>>>>non-ponder-start-time + time limit.  IE when I ponder and use my target, I might
>>>>>>>>>>actually use zero clock time.  With a non-ponder search I always burn time off
>>>>>>>>>>of my clock.
>>>>>>>>>>
>>>>>>>>>>But here is an easier-to-visualize explanation:
>>>>>>>>>>
>>>>>>>>>>I set a target time of 100 seconds and start pondering.  My opponent makes a
>>>>>>>>>>different move.  I re-start the search from the right position, and I'll burn
>>>>>>>>>>100 seconds off my clock, then make the move.
>>>>>>>>>>
>>>>>>>>>>I set a target time of 100 seconds and start pondering.  My opponent makes the
>>>>>>>>>>right move after 150 seconds.  Since I have searched for > my target time, I
>>>>>>>>>>move instantly and save that 100 seconds to use later if needed.
>>>>>>>>>>
>>>>>>>>>>I set a target time of 100 seconds and start pondering.  My opponent makes the
>>>>>>>>>>right move after 50 seconds.  I continue searching for another 50 seconds to use
>>>>>>>>>>my total 100 second time limit, but I only burn 50 seconds off the real chess
>>>>>>>>>>clock.  I save the other 50 seconds for use when needed later in the game.
>>>>>>>>>
>>>>>>>>>I understand.
>>>>>>>>>It simply seems to me not the best decision and I think that it is better to
>>>>>>>>>decide about the target time after the opponent plays it's move.
>>>>>>>>
>>>>>>>>I don't see the difference.  In one case, I "assume" that my opponent makes the
>>>>>>>>predicted move and set a time limit.  In the other case he actually makes a move
>>>>>>>>and I set a time limit.  Are you saying you might choose a different time limit
>>>>>>>>depending on whether he plays the predicted move or not?
>>>>>>>>
>>>>>>>>I can't really say whether that would be reasonable or not.  Perhaps if I
>>>>>>>>predict correctly I either (a) understand things well enough that less time
>>>>>>>>would be safe, or (b) don't have a clue and am walking into some deep error that
>>>>>>>>I need more time to see.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>>The reason is that if you pondered the correct move you simply have more time
>>>>>>>>>for other moves and not use part of it for the next move seems to me not correct
>>>>>>>>>decision.
>>>>>>>>
>>>>>>>>
>>>>>>>>I don't quite see how I could do that.  I suppose I could set the ponder time
>>>>>>>>limit such that I assume I am correct, but how could I guess how long my
>>>>>>>>opponent would take to search that move and then play it?  I have no idea what
>>>>>>>>his time limit is set to.  It could be short for an easy move.  His "best" move
>>>>>>>>could fail low and make him take a long time.  IE I see no reasonable way to
>>>>>>>>guess how much time I will save until I actually save it (if I do).
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>>The problem may be more important in time control of x minutes/y moves
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>Let look in the case of 40 minutes/40 moves(does not happen in ICC but happen in
>>>>>>>>>tournaments that people play).
>>>>>>>>>
>>>>>>>>>Suppose that Crafty is at move 39 and has 2 minute on the clock for move 39-40.
>>>>>>>>>suppose that the target time is the average time that you have for a move.
>>>>>>>>>Suppose that you decide about target time of 1 minute and the opponent use
>>>>>>>>>exactly 1 minute to play so you respond immediatly.
>>>>>>>>>
>>>>>>>>>Now at move 40 your target time is bigger and is 2 minutes.
>>>>>>>>>A better decision seems to me to increase the target time for move 39 to 1.5
>>>>>>>>>minutes and you can use 1.5 minutes both for move 39 and for move 40 that seems
>>>>>>>>>more logical to me than 1 minute for move 39 and 2 minutes for move 40.
>>>>>>>>>
>>>>>>>>>Uri
>>>>>>>>
>>>>>>>>I can see that failing easily.  I set the target time at move 39 to 1.5 minutes.
>>>>>>>> My opponent moves instantly and plays the predicted move.  I'm now stuck with
>>>>>>>>burning 1.5 minutes leaving 30 seconds for the last move...
>>>>>>>
>>>>>>>The idea is that you set the target time only after the opponent play.
>>>>>>>
>>>>>>>If the opponent played not the predicted move then your target time is 1 minute.
>>>>>>>If the opponent played the predicted move your target time is dependent on the
>>>>>>>time that the opponent used.
>>>>>>>
>>>>>>>If the opponent used 1 minute then your target time is 1.5 minutes but if the
>>>>>>>opponent replied immediatly it is still 1 minute.
>>>>>>>
>>>>>>
>>>>>>OK.  that is easy to do.  Early CB versions did that very thing.  But later we
>>>>>>chose to save the time.  IE what is the reason to search deeper only on moves
>>>>>>where you predict correctly?  Those are the ones that are probably most
>>>>>>accurately evaluated already...  So we chose to go to the "pure target time" and
>>>>>>search all moves for about the same time (excluding long ponder thinks when the
>>>>>>opponent goes for a long time of course).  I think that overall it is better to
>>>>>>be fairly uniform, rather than randomly searching some positions more deeply,
>>>>>>without any sort of clue that more searching is needed (fail low, etc.)
>>>>>
>>>>>
>>>>>It seems also that, at least in principle, a few scattered deep searches in the
>>>>>middle-game might end up choosing a position that the next search will not know
>>>>>what to do with, if it is not fortunate enough to search to the same depth as
>>>>>the previous search (on the previous move).
>>>>
>>>>I do not think that it is going to be a problem.
>>>>
>>>>Do not forget that in the next search you are 2 plies later and also hash tables
>>>>help crafty not to forget what it planned earlier.
>>>>
>>>>
>>>>  It would be as if for some moves,
>>>>>the speed of your machine were doubled, only to have it slow down to "normal"
>>>>>for the next move, which might require a critical continuation.
>>>>
>>>>I think that usually there is no problem to find the critical continuation.
>>>>This may be a theoretic problem for a program that clears it's hash tables like
>>>>movei when it may find a win and forget the win 2 plies later but usually it is
>>>>not a problem.
>>>>
>>>>
>>>>  An extreme case
>>>>>might be that a very long think by an opponent, and a correct ponder by you
>>>>>could have the same deleterious effect where the one deep search leaves
>>>>>subsequent searches at a loss as how to proceed.
>>>>>
>>>>>If any of this is true, it seems your current policy would be the correct one,
>>>>>saving the time for later instead of burning it for a few random moves in the
>>>>>middle.  Perhaps this is where some credit is due for some really good endgame
>>>>>saves at WCCC where crafty's surplus of time built up were expended to good
>>>>>effect at the critical juncture.
>>>>
>>>>I do not think that Crafty did well in the endgame because of espacially good
>>>>time management and the difference between what Crafty used and other ideas that
>>>>were suggested is probably not very big(the main important thing is to use more
>>>>time when you fail low and other tricks probably give not more than 20 elo).
>>>>
>>>>Uri
>>>
>>>
>>>Depends on what happens.  If you do as some programs did, and near the first
>>>time control with almost no time left, my approach is going to be worth _far_
>>>more than 20 elos.  Or would you really care to play me on good hardware with a
>>>10:1 time handicap for a few moves?
>>
>>The question is if programs got serious time trouble of 2:1 or something like
>>10:1 and also why it happened.
>>
>>A program may get to a serious time trouble because of fail lows when using less
>>time could not save the game.
>>
>>I do not think that programs got to serious time trouble because of using other
>>ideas that were suggested here.
>>
>>I do not say that programs did not have problems in time management against
>>Crafty but it was not because of the ideas that were suggested here like
>>finishing at the end of the iteration when you believe that you have no time to
>>complete the next iteration.
>>
>>The idea to finish at the end of the iteration can be improved but I remember
>>that Amir Ban said that it was better for him than previous strategy that
>>allowed often playing in the middle of the iteration.
>>
>>Uri
>
>I can add that if we talk about the idea to increase the target time after
>predicting the correct move then I do not suggest to increase it significantly
>when you have many moves to the time control.
>
>I only want the target time not to increase in the next move
>
>Suppose that I have at least 2 moves to complete the first time control.
>
>If I have target time of 2 minutes and I predicted the opponent move correctly
>and reply immediatly then the target time for the next move is always going to
>be bigger because there are less moves to the time control.
>
>I can prevent it by increasing the target time when I ponder correctly so the
>target time for the next move will be the same(if I do not predict correctly the
>opponent move) or bigger(if I predict correctly the next move) or smaller in
>case of something that force me to use more than the target time like fail low.
>
>Uri


I should add that I fudge near time controls anyway.  IE when I get close, I
won't try to burn off my saved time.  I just let it carry over to the next T/C
to help there.  IE there is no sense in burning 30 minutes on move 40...




This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.