mcostalba wrote:bob wrote:
Default is 16K entries, but I generally use something bigger, say 1M entries (32Mbytes total size). I made defaults small years ago as users wanted to be able to start it up on small machines.. 16K is probably no longer necessary and I should increase it.
If you already have 99% hits you don't need to increase anything IMHO, perhaps it could be even better to decrease a bit to reduce cache pressure.
I have not verified 99% with the default size, since I never use that. I'll try to collect some data and post it later today, using short and long time controls, small, med and large pawn hash sizes, to see what the hit rate is for all cases.
Note that there are a lot of possible pawn positions. Something like 2^40 is a rough approximation if you assume 2.5 bits per pawn square x 16 pawn squares. Many of those are meaningless (where pawns have "passed thru each other or captured pieces to "pass". But there are a lot of 'em. If the table is big enough, eventually you store almost all reachable positions. I'll try to quantify the cache pressure issue on my laptop since it has 6M L2... More later today.
My 93% comes from the fact that I measure searching at fixed depth on a set of different positions, so it is worst then in real game case where, from move to move the positions change less.
I agree there. My observations are gathered while playing real games, where Crafty logs the pawn hash hit rate after each move, which provides realistic continuity between searches and positions.
I got 93% searching at depth 12 on some midgame positions. If I measure on endgame positions at depth 18 I get 99%.
I have also tested searching with one or 2 threads, but results doesn't change. I think with bigger search depths (or in real games) hit rate increases.
BTW when you speed tested with one table per thread did you remove the XOR-ing code ? I think you should if you didn't otherwise the test is meaningless.
Yes I did, but I can't even measure the cost of the XOR. It is 3 instructions folded into the pipeline and intermingled with other instructions anyway since no program keeps all the pipes busy all the time. I tested the version without XOR (the 22.x versions did not all have this, I added new code that broke on bad data somewhere either at the end of 22.x or in 23.0 and had to add the XOR trick to eliminate the problem. In any case, removing this is a 2-line change and it doesn't affect the speed at all.