Disable null-move in IID?

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Disable null-move in IID?

Post by hgm »

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.
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:

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;
That would allow you to store scores for 8 different depths. You could hash the depth within the entry by storing it in element depth&7 of the score/depth arrays. Or you could use a depth-preferred scheme by hashing to slot depth&3, and only overwrite if the depth of the new one is larger, and bump it to slot+4 otherwise.

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).