Replacement Scheme / Hash Hits

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: Replacement Scheme / Hash Hits

Post by Desperado »

hg muller:
ok. think i got it. if the rootnode for example is stored in the TT,
the slot where it is stored would be locked forever in a depth-preferred replacement scheme. similar to nodes near the root. So after a while
all slots (so to say the TT) would be locked because of depth preferred condition. On the other hand, if using always replace scheme, the TT keeps "alive", but the gain of the entries is much lower and maybe important interiornodes could be overwritten (too fast). thx for introducing me to the draft-terminology.

Robert:
Yes, this in principal the same i am doing in "Leonardo", but with more greeness :-). i just incremented a counter on new search...which of course need more then 3 bits :-). so it is clever to use modular 8.

But so easy as it looks, there are 1,2 more questions on it. Why not using
an alternating bit (instead of mod8), when you always replace. i know 2 more search instructions may keep the entries alive because it cant be differed between cur,old search.(The same can occur with mod8,not so often of course). But anyway this isnt a problem, or am i wrong.
And is "age" only used for detecting old,cur search, or is there another usage for it (maybe computing a replacement-score) ?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Replacement Scheme / Hash Hits

Post by bob »

Desperado wrote:hg muller:
ok. think i got it. if the rootnode for example is stored in the TT,
the slot where it is stored would be locked forever in a depth-preferred replacement scheme. similar to nodes near the root. So after a while
all slots (so to say the TT) would be locked because of depth preferred condition. On the other hand, if using always replace scheme, the TT keeps "alive", but the gain of the entries is much lower and maybe important interiornodes could be overwritten (too fast). thx for introducing me to the draft-terminology.

Robert:
Yes, this in principal the same i am doing in "Leonardo", but with more greeness :-). i just incremented a counter on new search...which of course need more then 3 bits :-). so it is clever to use modular 8.

But so easy as it looks, there are 1,2 more questions on it. Why not using
an alternating bit (instead of mod8), when you always replace. i know 2 more search instructions may keep the entries alive because it cant be differed between cur,old search.(The same can occur with mod8,not so often of course). But anyway this isnt a problem, or am i wrong.
And is "age" only used for detecting old,cur search, or is there another usage for it (maybe computing a replacement-score) ?
You could certainly do that. The current approach came from Cray Blitz where we actually used the age to make decisions. For example, if age <= 2 (or 3 or whatever you choose) don't replace, as those entries are from a previous search, but they are pretty close to the current position and the transpositions might be useful... Using 1 bit has the drawback that if you do a "0" search and store entries, then do a "1" search but do not overwrite all the "0" entries, then when you start the next "0" search you will think those old "0" entries come from the current "0" search when they are actually old, and could be very old in fact...