Hi,
I've got a bit further, if anyone would care to take a look at this checkmate problem, I would be very grateful.
[d]8/8/8/8/7Q/3p4/3K3p/5b1k w 1-0
There is a simple solution...
1. Qg3, Bh3
2. Qf2, Bg2
3. Qe1, Bf1
4. Qxf1++
I'm using iterative deepening starting at Depth 1, and going up.
So,.. I run the engine, it plays the first 3 moves for white, while I play the corresponding moves for black.. taking me to this position..
Where it is whites turn to play
[d]8/8/8/8/8/3p4/3K3p/4Qb1k w 1-0
So, I'm using iterative deepening, my engine starts at depth 1.
It probes hash table, and gets the move Qxf1++ with value 7999,type hashfBETA, and alpha=-infinty, beta=infinty.
Whilst probing, I have the code (see
http://www.seanet.com/~brucemo/topics/hashing.htm)
Code: Select all
if(flag==hashfBETA && val>=beta) return beta
So, the 7999 value is never returned, and it just does a 1 ply search, and actually plays Qg3(since this is a mate in 6 or so ply).
So I don't know whats going on, perhaps I am storing it wrong.
However If I only record do record hash when depth>=1 (so not actually on leaf nodes (I don't have QS yet)), then engine runs much, since I'm not wasting time storing not very important positions, as well as the fact that I am leaving more space in the TT for the more important positions, and also.....
The puzzles I have been trying now work correctly.
Considering the position I mentioned a couple of posts ago which HG pointed out was totally wrong, I now have the new output...
[d]3Q1K1k/5p2/6p1/8/8/8/5q2/8 w 1-0
Depth=1 BM=Qd5 score=-208 count=20 PV=Qd5[1]
Depth=2 BM=Qd5 score=-213 count=45 PV=Qd5 --> Qd4[2]
Depth=3 BM=Qg5 score=-116 count=649 PV=Qg5 --> Qd4 --> Qxg6[3]
Depth=4 BM=Qg5 score=-200 count=1457 PV=Qg5 --> Kh7 --> Qe5 --> Qd4[4]
Depth=5 BM=Qg5 score=-110 count=13987 PV=Qg5 --> Kh7 --> Qe7 --> Kh8 --> Qxf7[5]
Depth=6 BM=Qd5 score=-125 count=20519 PV=Qd5 --> Qf5 --> Qxf7 --> Qc8 --> Ke7 --> Qc4[6]
Depth=7 BM=Qg5 score=-95 count=119772 PV=Qg5 --> Kh7 --> Qe5 --> f6 --> Qe7 --> Kh6 --> Qxf6[7]
Depth=8 BM=Qa8 score=-96 count=60350 PV=Qa8 --> g5 --> Qh1 --> Qh4 --> Qa1 --> f6 --> Qxf6[7]
Depth=9 BM=Qa8 score=8 count=174713 PV=Qa8 --> g5 --> Qh1 --> Qh4 --> Qa1 --> f6 --> Qxf6 --> Kh7 --> Qxg5[9]
Depth=10 BM=Qa8 score=834 count=92905 PV=Qa8 --> g5 --> Qh1 --> Qh4 --> Qa1 --> Qd4 --> Qxd4 --> f6 --> Qxf6 --> Kh7[10]
Depth=11 BM=Qa8 score=7989 count=664948 PV=Qa8 --> g5 --> Qh1 --> Qh4 --> Qa1 --> Qd4 --> Qxd4 --> f6 --> Qe4 --> f5 --> Qh1[11]
Computer plays Qa8, I reply Qg1(solution from book)
Depth=1 BM=Qd8 score=834 count=1 PV=Qd8[1]
Depth=2 BM=Qd8 score=834 count=1 PV=Qd8[1]
Depth=3 BM=Qd8 score=834 count=5 PV=Qd8[1]
Depth=4 BM=Qd8 score=834 count=4 PV=Qd8[1]
Depth=5 BM=Qd8 score=834 count=56 PV=Qd8[1]
Depth=6 BM=Qd8 score=834 count=390 PV=Qd8[1]
Depth=7 BM=Qd8 score=834 count=7187 PV=Qd8[1]
Depth=8 BM=Qd8 score=834 count=5372 PV=Qd8[1]
Depth=9 BM=Qa3 score=7991 count=43045 PV=Qa3 --> Qg5 --> Qh3 --> Qh5 --> Qc3 --> Qe5 --> Qxe5 --> f6 --> Qh2[9]
Computer plays Qa3, I reply Qg5
Depth=1 BM=Qh3 score=7993 count=0 PV=[0]
Computer plays Qh3, I reply Qh5
Depth=1 BM=Qc3 score=7995 count=0 PV=[0]
Computer plays Qc3+, I reply f6
Depth=1 BM=Qxf6 score=7997 count=0 PV=[0]
Computer plays Qxf6+, I reply Kh7
Depth=1 BM=Qg7 score=7999 count=0 PV=[0]
Computer plays Qg7# (CHECKMATE)
This is an improvement at least, since each time it is whites turn, the correct score comes out.
I kind of have a bad feeling the bug is still in there, and I have just concealed it by not recording at leaf nodes.
I'll try out some more checkmate puzzles, and see how it goes.
Thanks for any help
