Problem in tablehash

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
pedrox
Posts: 1056
Joined: Fri Mar 10, 2006 6:07 am
Location: Basque Country (Spain)

Problem in tablehash

Post by pedrox »

[d]8/8/8/3k4/1p4K1/1P6/3N3P/n7 w - - 0 53

Caligula05:
1 00:00 23 23 +1,42 53.h4
2 00:00 65 65 +1,31 53.h4 Nc2
3 00:00 126 126 +1,60 53.h4 Nc2 54.h5
4 00:00 250 250 +1,52 53.h4 Nc2 54.h5 Ne3+ 55.Kf4
5 00:00 602 15.050 +1,68 53.h4 Nc2 54.h5 Ne3+ 55.Kf4 Kd4
6 00:00 1.209 30.225 +1,79 53.h4 Nc2 54.h5 Ne3+ 55.Kf4 Ng2+ 56.Kf3 Nh4+ 57.Kf4
7 00:00 3.415 85.375 +2,17 53.h4 Nc2 54.h5 Ne3+ 55.Kf4 Ng2+ 56.Kg5 Ne3 57.h6
8 00:00 4.857 53.966 +2,29 53.h4 Nc2 54.h5 Ne3+ 55.Kf4 Ng2+ 56.Kf3 Ne1+ 57.Ke2 Nc2 58.h6
9 00:00 10.707 107.070 +2,04 53.h4 Ke5 54.h5 Kf6 55.Kf4 Nc2 56.Ne4+ Kg7 57.Ke5 Ne3
10 00:00 15.085 150.850 +2,16 53.h4 Ke5 54.h5 Kf6 55.Kf4 Nc2 56.Ne4+ Kg7 57.Kg5 Nd4 58.h6+ Kh7
11 00:00 23.105 115.525 +2,13 53.h4 Ke5 54.h5 Kf6 55.Kf4 Nc2 56.Ne4+ Kg7 57.Kg5 Nd4 58.h6+ Kh8 59.Nc5
12 00:00 58.461 139.192 +2,03 53.h4 Nc2 54.h5 Ke6 55.h6 Kf6 56.Kh5 Nd4 57.Ne4+ Kf7 58.Nc5 Kg8 59.Kg4
13 00:00 79.823 177.384 +2,11 53.h4 Nc2 54.h5 Ke6 55.h6 Kf6 56.Kh5 Nd4 57.Ne4+ Kf7 58.Nc5 Kg8 59.Kg4 Kh7
14 00:00 142.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 Ng4+ 56.Kg6 Kd4 57.h5 Kd3
22 00:19 8.300.359 431.187 +3,65 53.Kf5 Nc2 54.h4 Ne3+ 55.Kf6 Ng4+ 56.Kg6 Kd4 57.h5 Kd3 58.Nc4 Ke4 59.h6 Nxh6 60.Kxh6 Kd4 61.Na5 Kc3 62.Kg6 Kd4 63.Kf5 Kc3 64.Ke5 Kd3
23 00:32 15.929.188 482.702 +3,24 53.Kf5 Nc2 54.h4 Ne3+ 55.Kf6 Ng4+ 56.Kg6 Kd4 57.Nf3+ Ke4 58.Ng5+ Kd4 59.h5 Kc3 60.Nf7 Kxb3 61.Kg5 Kc4 62.Kxg4 b3 63.h6 b2 64.h7 b1Q 65.h8Q Qe4+ 66.Kg5 Qe7+ 67.Kg6 Qe6+ 68.Kg7 Qe2
24 00:44 22.926.175 509.470 +3,34 53.Kf5 Nc2 54.h4 Ne3+ 55.Kf6 Ng4+ 56.Kg6 Kd4 57.Nf3+ Ke4 58.Ng5+ Kd4 59.h5 Kc3 60.Nf7 Kxb3 61.Kg5 Kc4 62.Kxg4 b3 63.h6 b2 64.h7 b1Q 65.h8Q Qe4+ 66.Kg5 Qe7+ 67.Kg6 Qe6+ 68.Kg7 Kd4 69.Qh7
25 01:02 35.671.286 575.343 +3,36 53.Kf5 Nc2 54.h4 Ne3+ 55.Kf6 Ng4+ 56.Kg6 Kd4 57.Nf3+ Ke4 58.Ng5+ Kd4 59.h5 Kc3 60.Nf7 Kxb3 61.Kg5 Kc4 62.Kxg4 b3 63.h6 b2 64.h7 b1Q 65.h8Q Qe4+ 66.Kg5 Qe7+ 67.Kg6 Qe4+ 68.Kf6 Qc6+ 69.Ke7 Qb7+ 70.Ke6 Qd5+ 71.Kf6

In this position my program found Kf5 in 6 seconds (hash clean). However during the game with ponder and tables hash not deleted into moves, engine played Kg5 after 12 seconds and perhaps lost a chance to win.

It is an error for hash tables? How to avoid it?

Pedro
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Problem in tablehash

Post by bob »

pedrox wrote:[d]8/8/8/3k4/1p4K1/1P6/3N3P/n7 w - - 0 53

Caligula05:
1 00:00 23 23 +1,42 53.h4
2 00:00 65 65 +1,31 53.h4 Nc2
3 00:00 126 126 +1,60 53.h4 Nc2 54.h5
4 00:00 250 250 +1,52 53.h4 Nc2 54.h5 Ne3+ 55.Kf4
5 00:00 602 15.050 +1,68 53.h4 Nc2 54.h5 Ne3+ 55.Kf4 Kd4
6 00:00 1.209 30.225 +1,79 53.h4 Nc2 54.h5 Ne3+ 55.Kf4 Ng2+ 56.Kf3 Nh4+ 57.Kf4
7 00:00 3.415 85.375 +2,17 53.h4 Nc2 54.h5 Ne3+ 55.Kf4 Ng2+ 56.Kg5 Ne3 57.h6
8 00:00 4.857 53.966 +2,29 53.h4 Nc2 54.h5 Ne3+ 55.Kf4 Ng2+ 56.Kf3 Ne1+ 57.Ke2 Nc2 58.h6
9 00:00 10.707 107.070 +2,04 53.h4 Ke5 54.h5 Kf6 55.Kf4 Nc2 56.Ne4+ Kg7 57.Ke5 Ne3
10 00:00 15.085 150.850 +2,16 53.h4 Ke5 54.h5 Kf6 55.Kf4 Nc2 56.Ne4+ Kg7 57.Kg5 Nd4 58.h6+ Kh7
11 00:00 23.105 115.525 +2,13 53.h4 Ke5 54.h5 Kf6 55.Kf4 Nc2 56.Ne4+ Kg7 57.Kg5 Nd4 58.h6+ Kh8 59.Nc5
12 00:00 58.461 139.192 +2,03 53.h4 Nc2 54.h5 Ke6 55.h6 Kf6 56.Kh5 Nd4 57.Ne4+ Kf7 58.Nc5 Kg8 59.Kg4
13 00:00 79.823 177.384 +2,11 53.h4 Nc2 54.h5 Ke6 55.h6 Kf6 56.Kh5 Nd4 57.Ne4+ Kf7 58.Nc5 Kg8 59.Kg4 Kh7
14 00:00 142.254 180.068 +2,22 53.h4 Ke6 54.Kg5 Kf7 55.h5 Kg7 56.h6+ Kh7 57.Kh5 Nc2 58.Nf3 Ne3 59.Ng5+ Kh8 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Kg6 Kd4 57.h5 Kd3 58.Nc4 Ke4 59.h6 Nxh6 60.Kxh6 Kd4 61.Na5 Kc3 62.Kg6 Kd4 63.Kf5 Kc3 64.Ke5 Kd3
23 00:32 15.929.188 482.702 +3,24 53.Kf5 Nc2 54.h4 Ne3+ 55.Kf6 Ng4+ 56.Kg6 Kd4 57.Nf3+ Ke4 58.Ng5+ Kd4 59.h5 Kc3 60.Nf7 Kxb3 61.Kg5 Kc4 62.Kxg4 b3 63.h6 b2 64.h7 b1Q 65.h8Q Qe4+ 66.Kg5 Qe7+ 67.Kg6 Qe6+ 68.Kg7 Qe2
24 00:44 22.926.175 509.470 +3,34 53.Kf5 Nc2 54.h4 Ne3+ 55.Kf6 Ng4+ 56.Kg6 Kd4 57.Nf3+ Ke4 58.Ng5+ Kd4 59.h5 Kc3 60.Nf7 Kxb3 61.Kg5 Kc4 62.Kxg4 b3 63.h6 b2 64.h7 b1Q 65.h8Q Qe4+ 66.Kg5 Qe7+ 67.Kg6 Qe6+ 68.Kg7 Kd4 69.Qh7
25 01:02 35.671.286 575.343 +3,36 53.Kf5 Nc2 54.h4 Ne3+ 55.Kf6 Ng4+ 56.Kg6 Kd4 57.Nf3+ Ke4 58.Ng5+ Kd4 59.h5 Kc3 60.Nf7 Kxb3 61.Kg5 Kc4 62.Kxg4 b3 63.h6 b2 64.h7 b1Q 65.h8Q Qe4+ 66.Kg5 Qe7+ 67.Kg6 Qe4+ 68.Kf6 Qc6+ 69.Ke7 Qb7+ 70.Ke6 Qd5+ 71.Kf6

In this position my program found Kf5 in 6 seconds (hash clean). However during the game with ponder and tables hash not deleted into moves, engine played Kg5 after 12 seconds and perhaps lost a chance to win.

It is an error for hash tables? How to avoid it?

Pedro
I think you are looking at a symptom, not a cause. If your eval doesn't include specific code for this kind of ending, then whether you play the right move or wrong move is a matter of luck. The key is the score. However, the hash _can_ play tricks on the search because it causes grafting of deep lines onto other searches so that the search can actually see beyond the normal horizon in some of the lines, but not others. There is no fix that is workable.