In Mediocre the hash table consists of one big integer array (int being a 32 bit number in Java).
One transposition table entry requires three slots (move, zobrist key, and flag/depth/eval/etc). But since I use depth/new replacement scheme one index needs 6 slots to hold them both.
So if I were to use 2^20 slots the array would be 2^20*6 slots and take 24mb of memory.
Looking right? (I use a plain int array to store the information rather then objects since creating objects is a major bottleneck in Java)
Now my question is I'm thinking pawn and eval hash would only require two slots per entry each, the eval and the zobrist key, but how many entries should I have compared to the main transposition table? And should I count all the tables when setting the size of the hash tables to say 128mb?
Hash table sizes
Moderators: hgm, Rebel, chrisw
-
- Posts: 1808
- Joined: Wed Mar 08, 2006 9:19 pm
- Location: Oslo, Norway
Re: Hash table sizes
I don't know Java, but as far as I can see you shouldn't have to create any objects except when initializing or resizing the hash table. During the search, you only update existing objects, which should be cheap.Zlaire wrote:Looking right? (I use a plain int array to store the information rather then objects since creating objects is a major bottleneck in Java)
In the pawn hash table, I think you should consider more than just two entries. At the very least, storing the location of the passed pawns for both sides is useful.Now my question is I'm thinking pawn and eval hash would only require two slots per entry each, the eval and the zobrist key,
The pawn hash table can be quite small; the number of different pawn structures which occur in a search is very small compared to the total number of positions. For the evaluation hash table, it depends on how expensive your evaluation function is. If your evaluation is sufficiently simple, it is probably better not to have an evaluation hash table at all: It will just slow you down. You'll just have to experiment to find out what works best for you.but how many entries should I have compared to the main transposition table
Most people don't count them, I think.And should I count all the tables when setting the size of the hash tables to say 128mb?
Tord