Author: Ross Boyd
Date: 20:10:12 05/03/04
Go up one level in this thread
On May 03, 2004 at 08:34:55, Aivaras Juzvikas wrote: >my question is how big gain would be for me to transit from a simple always >replace scheme to two tier table with depth prefered and always replace schemes. >its probably hard to measure because not only the tree size will differ but also >the accuracy of suggestested score and hash move (depth prefered table results >are (?) more accurate than simple always replace table). > I found two tier a bit better. It all depends on so many things. You just have to experiment. >also in such a two tier scheme, how does one divide the memory between these two >tables? should depth prefered table get less slots in memory than the other? If you use a power of two for the number of hash entries you can make a bit mask which will map to the first of two entries. The first entry is your depth preferred, your second entry is your always-replace. And then you calculate your pointer to the hashentry like this... hashmask = numhashentries - 2; // assuming numhashentries is a power of 2 ph = pHashTable + (hashcode & hashmask); if (ph->code == hashcode) ; // we got a match in the 'depth preferred' entry else if ((++ph)->code == hashcode) ; // we got a match in the 'always overwrite' entry Someone knowledgeable correct me if I'm wrong, but the advantage to this method is that your memory retrieve for the first hash entry will also include the second. (Assuming your hash entries are 16 bytes each.) If you want 4 slots then you can also use... hashmask = numhashentries - 4; // assuming numhashentries is a power of 2 Which slot is 'depth based' and which are 'overwrite' is up to you. Hope this helps, Ross
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.