Author: David Rasmussen
Date: 12:38:18 12/06/00
Go up one level in this thread
On December 06, 2000 at 14:25:19, Scott Gasch wrote: >Hi all, > >My hashing code is working very well since I've been looking at it carefully and >finding bugs. Thanks for your help and comments. > >I am still unclear on one issue, though. Many people have said "store the >remaining depth in the draft of a hash entry." What happens if I make a move, >say "aha, this was a threatoning pawn push, extend by 1 ply!" then call search >recursively. This returns a fail high (beta cutoff). > >Now I am about to store a lower bound in my hash... this position is worth at >least X, maybe more. Do I store this with a draft of depth or depth + extend? >I think depth + extend -- after all I got the score from a depth + extend call >to search... the remaining depth for this position was depth + extend? Some >people have said "make sure you don't store extend values in your hash table or >you will have bugs" and I don't understand this. > >If I was about to store an exact or upper bound in the hash table after >searching all N moves in this position I would store with a draft of depth >_unless_ every move was searched with an extend of 1 ply. This is the case in >my code when the side on move is in check... so in this case I would store depth >+ extend again. > >Maybe I'm loony or don't fully understand this stuff. But the way I see it is >that I have a score X from an expensive recursive call(s) to search... and I >want to save this score for later. If I every one of my 1..N calls to search >used to generate X was made with a depth of depth + extend I store this as the >draft. > >Later if someone comes in and says I need a score of the same position to depth >+ 1 it should be OK to give them the same score computed above... because of the >extend above I did end up computing score X to depth + 1 already... > >Do I misunderstand some negative aspect of this plan? > >As always, much appreciate the help. >Scott This confused me too at first. But it is really quite simple and intuitive. The general rule is: You ALWAYS store the remaining depth at the current ply, that is, the number of plies that you asked this node to be searched with. You can't know whether it will be extended later, but you know that you get at least that. That is called the draft. The confusing part is that people extend at different places in the code. In Crafty, the extensions are determined just after MakeMove(), and so they come into effect in the NEXT ply, so "depth" for the recursive call of Search(), will be equal to depth plus extensions now. In this case, the extensions are done for each move and corresponds naturally to the call of Search() done after, so we don't store depth+extensions here, because extensions are not the same for all moves, in fact there might not be extensions for all moves, and in every way it would just be unnatural and wrong to do it here. But other programs determine their extensions in the beginning of the Search() function, and so they consider the move just made at the previous ply. In this case, the extensions found for the move just made, will be added to depth (remaining depth), right after they are determined. In both cases, the result is the same: that the depth variable is constant throughout the search() call after the move that caused the extension. It's just a matter of taste where you determine your extensions. Although some extensions might be easier to express in one way than in the other. I like determining the extensions in the beginning of Search(), because I think it makes the function cleaner, with the central loop not cluttered with extension code, and also, there is no need for extension code in the rootsearch function if you have one.
This page took 0 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.