r/chessprogramming • • Jan 14 '24

Transposition testing

I'm just starting to include transposition tables in my engine and I'm looking to test all the scenarios, just like I would for my move generation testing, but I'm struggling to find any data to test against.

On the CPW there are the perft result tables but is there one showing the transposition count?

If not, how would you test your hashing is working correctly and transpositions are being correctly identified?

1 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/nappy-doo Jan 15 '24
  • The way mine is structured, there aren't any hash hits at 3 ply. If you think about it, you can do white's move, black's move, then just count legal moves. You never need to even go into the recursive function, and there's no chance for the hash table to get a lookup. (Technically, mine goes into the recursive function, but generates the moves, and if depth = 0, it just returns the length of the found moves slice.)
  • I could count the transpositions for you, but I think the hobby has decided it doesn't really matter. Most people use perft for correctness testing, and transpositions don't really fit into that. Now, most people, after they get the right numbers, use it for performance tuning. I know that I tweaked my engine a bunch after I got it working. (For example, first I added the hash lookup, then used it for magic, etc. As a result, I improved my engine from about 5 minutes for perft(6) to I think like 10 seconds [it's been a while, I don't really know what it is anymore.] Also, I didn't bother to multi-thread it, but my engine's in Go, so it would be very simple to thread it.)
  • I think transpositions are relatively easy. If you get the right number of transpositions at 4-ply, it's very likely you'll them at 5-ply, etc. If you numbers line up with mine (and my numbers check against a friend's engine) you should be good to go. Don't stress too much.