Question on Hash Table

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Question on Hash Table

Postby Giuseppe Cannella » 19 Jun 2006, 14:01

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
Giuseppe Cannella
 
Posts: 5
Joined: 20 Mar 2006, 10:08
Location: Milan, Italy

Re: Question on Hash Table

Postby Daniel Shawul » 19 Jun 2006, 14:22

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
User avatar
Daniel Shawul
 
Posts: 366
Joined: 28 Sep 2004, 09:33
Location: Ethiopia

Re: Question on Hash Table

Postby Chan Rasjid » 19 Jun 2006, 18:38

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
Chan Rasjid
 
Posts: 73
Joined: 23 Feb 2005, 16:36
Location: Singapore

Re: Question on Hash Table

Postby Chan Rasjid » 19 Jun 2006, 20:28

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
Chan Rasjid
 
Posts: 73
Joined: 23 Feb 2005, 16:36
Location: Singapore

Re: Question on Hash Table

Postby Daniel Shawul » 20 Jun 2006, 09:30

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
User avatar
Daniel Shawul
 
Posts: 366
Joined: 28 Sep 2004, 09:33
Location: Ethiopia


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 34 guests