Page 1 of 1

Help solving a bug

PostPosted: 11 May 2008, 13:02
by Patrice Duhamel
I have problem in my new version of Cheese
in some positions, a mate is found, but lost later... (this not happens in Cheese 1.1b)

I only replace rotated bitboards by magic bitboards (and change SEE to use magic bitboards),
I don't remember changing anything else :?

any advice to find the problem ?

ex : WAC 217 : (mate found at depth 5, but lost at depth 7)

r3kb1r/1pp3p1/p3bp1p/5q2/3QN3/1P6/PBP3P1/3RR1K1 w kq -

Code: Select all
1 00:00:000 135           -1.69 Qd4-f2
2 00:00:002 1005    480.40 1.74 Ne4-g3 Qf5xc2
3 00:00:005 2664    459.94 2.86 Ne4-g3 Qf5-b5 Re1xe6 Bf8-e7
4 00:00:013 5893    419.84 2.94 Ne4-g3 Qf5-c5 Re1xe6 Ke8-f7 Re6-e2
5 00:00:027 12127   430.29 +M5  Qd4-d7 Be6xd7 Ne4-d6 Ke8-d8 Nd6-f7 Kd8-c8 Re1-e8 Bd7xe8 Rd1-d8
6 00:00:056 25193   456.23 +M5  Qd4-d7 Be6xd7 Ne4-d6 Ke8-d8 Nd6-f7 Kd8-c8 Re1-e8 Bd7xe8 Rd1-d8
7 00:00:549 234185  423.95 2.11 Ne4-g3 Qf5-c5 Re1xe6 Ke8-f7 Re6-e3 Ra8-d8 Qd4xd8 Qc5xe3 Kg1-h2
8 00:01:118 480557  433.08 2.14 Ne4-g3 Qf5-c5 Re1xe6 Ke8-f7 Re6-e3 Ra8-e8 Qd4xc5 Bf8xc5 Rd1-d7 Kf7-g8
9 00:02:753 1191288 434.74 2.06 Ne4-g3 Qf5-c5 Re1xe6 Ke8-f7 Re6-e3 Ra8-e8 Ng3-e4 Qc5xd4 Bb2xd4 Kf7-g8

Re: Help solving a bug

PostPosted: 11 May 2008, 17:48
by Pradu
Patrice Duhamel wrote:any advice to find the problem ?
Do both your rotated and magic implementations give the same perft numbers?

Re: Help solving a bug

PostPosted: 11 May 2008, 18:10
by Patrice Duhamel
I try some perft with the magic implementation and found the same result I had with rotated bitboards, but I will try to look deeper.

I tested with the WAC testsuite and I found 287/300 with the magic bitboard version, and 293/300 with the rotated version, the problem happens only on few positions, each times a mate found, and lost later...

Re: Help solving a bug

PostPosted: 13 May 2008, 17:34
by Patrice Duhamel
I found the problem,
I remember that I try to fix some compiler warning,
it was a problem with a unsigned value used for the depth in the hash table...
(now I have to find why the depth is negative sometimes)