That could cause a sever speed hit. Hash-table accesses tend to be slow. You would probably be off better to store many different depths in the same hash entry, so that you would only have to do a single probe. It only takes 3 bytes per depth (1 byte depth and flags, 2 bytes score). So with a 32-byte entry you could have:thomasahle wrote: ↑Sat Jan 07, 2023 10:53 pmI actually store moves in a separate hash table from scores. This table doesn't use the depth in the key.
This doesn't introduce search instability because the hash-move only affects the order I search thing, but the hypothetical tree being searched is the same.
Code: Select all
typedef struct {
uint32_t signature;
int16_t scores[8];
uint8_t depthAndFlags[8]; // low 6 bits for depth, two upper bits for flags
uint8_t valid;
char fromSqr;
char toSqrPromoPiece; // low 6 bits for square, two upper bits for promotion choice
char age;
} HashEntry;
The 'valid' byte would specify which depth slots are valid (1 bit per slot), and would be set to 0 when you requisition the entry for a new position (i.e. change the signature).