This seems like an interesting idea, not sure if I understand it correctly:hgm wrote: ↑Mon Feb 17, 2020 10:12 am As to the corruption by races, the solution I consider best is an 8-byte (i.e. atomic) entry with a shortened key signature to make it fit (e.g. 24 bit), plus a signature extension in the first word of the hash bucket (e.g. 8 bit), so that this first word alone will (in almost all cases) be enough to conclude there is no hit within this bucket. The distribution of the key over different words will reduce the number of undetected race corruptions by the size of the smallest key part (i.e. by 256 in the 8-bit case). The overhead for such a 'divided key' is not an extra XOR, but the fact that the signature comparison has to be done in two parts. But in the overwhelming majority of cases the second comparison would not have to be done, because the first (the signature extension) already failed to match, and the fact that the signature extension for all entries is in the same word should more than make up for that. (Most hash probes are misses, and these would otherwise have to compare the key in all the eligible entries of the bucket, waiting for them to arrive from memory.)
So you propose to use 8 bytes in the bucket to store 8-bit parts of the zobrist key for each stored entry (at a specific position in the key), let's say such bucket can store 7 8-byte actual entries plus this merged extended signature.
So you extract the 8 bytes first (merged extended signatures), extract the extended signature from the zobrist key for the position a compare
(7 times using shifts+masks) to see if there's a potential hit in the bucket without accessing the individual entries yet?
I mean, you know the extended signature for the position you're probing, you don't know where it is in the merged extended signature key in the bucket (if at all), so a single comparison won't really work here (that is, unless I completely misunderstood your idea) - maybe some SIMD magic might work
EDIT: now that I think about it, you could actually use a 9-bit extension (this would give you 33-bit signature in TT), only wasting 1 bit per bucket. I still miss however how to do an efficient comparison of the probing signature, because you don't know the index in the bucket in the case of a hit