The Quality of Caching and Hash Keys

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Re: The Quality of Caching and Hash Keys

Postby Reinhard Scharnagl » 09 Dec 2004, 20:18

Hi Uri,
If I understand correctly the only place that you can store the depth is in the special purpose flags.

you misunderstood, or I have not explained well enough.

a) The depth is stored in the Level field, but it is not part of the position identification with that.
b) The hash-address is modified by a depth depending constant random number to provide distinct hash entries for different depth information.
Do the special purpose flag contain more information except the question if you store perft 1 or perft 2 or perft 3(I guess that with only 16 bits you usually cannot store perft 4)?

I am only storing 16 bit values for those partial Perft sums. I store them simultaneously in one single depth depending hash entry. I do not store those Perft sums at all nor use the cache, if the corresponding sum exceeds a size which would allow to store them that way. But because that are only very few nodes compared to the big number of nodes totally affected, that would not slow down the whole counting that much. If you would prefer to only count the moves using a 64 bit counter, you have to replace the four shorts by one long long, and you have no longer to decide whether to store or not, because the intermediate sums will always be sufficient (if you are targeting on 64 bit counters).

You seem to be interested to learn more on the purpose of the Mix field. Well, it is needed to lock a cache entry (irrelevant here), it is used to mark a special type of nodes (irrelevant here), and it is used as a fingerprint to avoid a physical clearing of all nodes when clearing the whole cache logically has to be done. Because I am not familiar with other types of caching chess position information, I supposed such a usage would be quite normal.

Reinhard.
Reinhard Scharnagl
 
Posts: 608
Joined: 01 Oct 2004, 08:36
Location: Klein-Gerau, Germany

Previous

Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 10 guests

cron