[D]4k3/7r/3nb3/2R5/8/6n1/1R3K2/8 w - -
Here Hamsters failed to recognize that... all rooks are on open files! Now for the reason. I store this information in the pawn hash table, but here there are no pawns and the pawn hash key value is just the initial value: zero. This means I probe the very first index of the pawn hash table and get a match, because at the beginning of the program all tables are reset to zero. So for me entry #0 is ok for that position, and from there I get no bits set for open files, so no open files.
Ok, I fixed this by initializing the pawn and material keys to something other than zero. I tested on just a couple of positions and I was a little surprised by the difference.
[D]8/1p4kP/5pP1/3p4/8/4P3/7K/8 w - - bm e4;
Old (key = 0):
Code: Select all
22/40 0:17.47 299 12834080 e4 dxe4 Kg3 b5 Kf4 e3 Kxe3 b4 Kd4 b3 Kc3 f5 Kxb3 f4 Kc2 f3 Kd3 f2 Ke2 f1=N Kxf1 Kh8 Ke2
23/42 0:21.80 308 15917026 e4 dxe4 Kg3 b5 Kf4 e3 Kxe3 b4 Kd4 b3 Kc3 f5 Kxb3 f4 Kc2 f3 Kd3 f2 Ke2 f1=N Kxf1 Kh8 Ke2 Kg7
24/44 0:28.32 308 20579650 e4 dxe4 Kg3 b5 Kf4 e3 Kxe3 b4 Kd4 b3 Kc3 f5 Kxb3 f4 Kc2 f3 Kd3 f2 Ke2 f1=N Kxf1 Kh8 Ke2 Kg7 Ke3
Code: Select all
22/39 0:15.79 299 11578796 e4 dxe4 Kg3 b5 Kf4 e3 Kxe3 b4 Kd4 b3 Kc3 f5 Kxb3 f4 Kc2 f3 Kd3 f2 Ke2 f1=N Kxf1 Kh8 Ke2
23/40 0:19.92 308 14546912 e4 dxe4 Kg3 b5 Kf4 e3 Kxe3 b4 Kd4 b3 Kc3 f5 Kxb3 f4 Kc2 f3 Kd3 f2 Ke2 f1=N Kxf1 Kh8 Ke2 Kg7
24/42 0:25.79 308 18764888 e4 dxe4 Kg3 b5 Kf4 e3 Kxe3 b4 Kd4 b3 Kc3 f5 Kxb3 f4 Kc2 f3 Kd3 f2 Ke2 f1=N Kxf1 Kh8 Ke2 Kg7 Kd3