Page 1 of 1

Question on Hash Table

PostPosted: 19 Jun 2006, 14:01
by Giuseppe Cannella
on position #007 of WAC suite
rnbqkb1r/pppp1ppp/8/4P3/6n1/7P/PPPNPPP1/R1BQKBNR b KQkq - bm Ne3
i've these results with and without hash table (no other feature, null move, extension, futility pruning, etc)

**WITH hash table **
2 0 546 34 g4e5 e2e4
3 0 94 122 g4e5 e2e4 e5d3
4 0 31 1227 g4e5 e2e4 c7c5 g1f3
5 0 266 4380 g4e5 g1f3 e5f3 g2f3 d7d5
6 5 1734 47990 g4e3 c2c4 e3d1 e1d1 c7c5 e2e4
7 5 3953 114928 g4e3 e5e6 e3d1 e6f7 e8f7 e1d1 d7d5
8 5 29807 898897 g4e3 g1f3 e3d1 e1d1 d7d5 g2g4 c7c5 e2e4

result g4e3 is OK

**WITHOUT hash table **
2 0 94 34 g4e5 e2e4
3 0 62 121 g4e5 e2e4 e5d3
4 0 0 301 g4e5 e2e4 c7c5 g1f3
5 0 235 3191 g4e5 g1f3 e5f3 g2f3 d7d5
6 -1 1156 33518 g4e5 c2c3 d7d5 d1a4 b7b5 a4b5
7 0 687 43788 g4e5 e2e4 d7d5 d1h5 b8c6 e4d5 d8d5
8 0 3375 122421 g4e5 e2e4 f8b4 g1f3

result g4e5 is wrong !

is it necessary disable the hash table in some case?
thank you.
Giuseppe

Re: Question on Hash Table

PostPosted: 19 Jun 2006, 14:22
by Daniel Shawul
No you shouldn't disable it.
If your implementation is correct , you should be able to get the same result, and probalbly faster. I guess that you have a bug in your hash table.
Check out bruce moreland tutorial , it will give you some ideas.
http://www.brucemo.com/compchess/programming/index.htm
Daniel

Re: Question on Hash Table

PostPosted: 19 Jun 2006, 18:38
by Chan Rasjid
I have done some fixed depth search.

Generally with most (maybe nearly all ?) positions, we should have the same search characteristics, like maxply reached, scores, etc,... whether with or without hashing turned on.

A crude test of mine to depth 8 w/o hash needs 3.0 x longer to complete ; ie 3 x faster with TT.

I have a full QS and hashed all positions inclusive QS. No nullmove implemented.

Rasjid

Re: Question on Hash Table

PostPosted: 19 Jun 2006, 20:28
by Chan Rasjid
If there is a bug somewhere, especially in hashing, then nearly all search will give different scores with and w/o TT.

If everthing is clean it may still occasionally give a different best move and score.

Say there is an exact best move in a certain node with score x.
There may be another move that will also have the score x and be the best move. But alpha beta accepts the first and rejects the 2nd. With TT, the order of move selected may be changed and the tree searched will be different. Thus a different result may occur.

Rasjid

Re: Question on Hash Table

PostPosted: 20 Jun 2006, 09:30
by Daniel Shawul
Say there is an exact best move in a certain node with score x.
There may be another move that will also have the score x and be the best move. But alpha beta accepts the first and rejects the 2nd. With TT, the order of move selected may be changed and the tree searched will be different. Thus a different result may occur.


You are right ofcourse. I just thought this things are not typical, and assumed he has a bug in implementation.
Also if a deeper search result is used for a shallow search, we can get different moves. If the hash table entry is replaced ,and we don't have anything during the second visit, there will be search instablitity.

Daniel