Re: Perft and hash with legal move generator
Posted: Fri Feb 19, 2016 3:33 pm
I have tested several ep and castling positions for example kiwipete and position 4 on chessprogramming wiki.Position 4 even with hash on works fine even up to depth 8,and kiwipete correct also up to depth 8 without hash,cannot remember if it was correct with hash on,didn't test it recently.
Also tested several other positions,to check for promotion bugs and ep etc... all clear.
For a chess engine yes i suppose it is correct enough.I just would like to have it as correct as i can with the hash enabled.Hopefully with the latest change it will help.
What i mean with verification test is,that i do a AllBitboardOcc comparison,i do save that one as 8 bytes in the hash as well,and if the hashkey is the same,it checks if the position,is the same,well if there is the same amount of pieces on the same squares,i know it's not a full perfect position comparison,but it helps.
At the moment my hash looks like this :
if UseHash eq 1
hashdivide = 4 ;32 byte hash = 5 16 byte hash = 4
hashtabledepth = 0
hashtablekey = 1
hashtablenodes = 5
hashtableposition = 6
hashtablescore = 14
end if
Which is 16 bytes in size,hashtableposition is where i store the AllBitboardOcc
Yes i am sure 32 bit's might also influence the results,as you mention,it would just be nice to have a correct depth 10 initial position with hash on,i think once i can accomplish this i will be happy with my hash function,if possible with 32 bit key.
My goal is to write a chess engine,not a perft champ,this does not seem to be possible with my implementation,although i am quite happy with the speed of my pure legal move generator,and i like the fact that it is in assembler.There is no processor new instruction optimizations used,besides 2 popcn't insturctions,the rest is all basic instructions that works on quite old processors.
Also tested several other positions,to check for promotion bugs and ep etc... all clear.
For a chess engine yes i suppose it is correct enough.I just would like to have it as correct as i can with the hash enabled.Hopefully with the latest change it will help.
What i mean with verification test is,that i do a AllBitboardOcc comparison,i do save that one as 8 bytes in the hash as well,and if the hashkey is the same,it checks if the position,is the same,well if there is the same amount of pieces on the same squares,i know it's not a full perfect position comparison,but it helps.
At the moment my hash looks like this :
if UseHash eq 1
hashdivide = 4 ;32 byte hash = 5 16 byte hash = 4
hashtabledepth = 0
hashtablekey = 1
hashtablenodes = 5
hashtableposition = 6
hashtablescore = 14
end if
Which is 16 bytes in size,hashtableposition is where i store the AllBitboardOcc
Yes i am sure 32 bit's might also influence the results,as you mention,it would just be nice to have a correct depth 10 initial position with hash on,i think once i can accomplish this i will be happy with my hash function,if possible with 32 bit key.
My goal is to write a chess engine,not a perft champ,this does not seem to be possible with my implementation,although i am quite happy with the speed of my pure legal move generator,and i like the fact that it is in assembler.There is no processor new instruction optimizations used,besides 2 popcn't insturctions,the rest is all basic instructions that works on quite old processors.