Testing Transposition Tables

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Samuele Giraudo

Re: Testing Transposition Tables

Post by Samuele Giraudo »

I have a problem testing my hashtable implementation :

On the position 4k3/8/8/8/8/8/43/4K3 w - - 0 1 (white king e1, white pawn e2, black king e8), my engine seems don't see the winning sequence :

Code: Select all

1ply 0.00s +1.03 7N 1.e2-e4 
2ply 0.00s +1.01 24N 24000ns 1.e2-e4 e8-f7 
3ply 0.00s +1.13 95N 95000ns 1.e1-f2 e8-f7 2.f2-f3 
4ply 0.00s +1.00 232N 232000ns 1.e1-f2 e8-f7 2f2-f3 f7-f6 
5ply 0.00s +1.10646N 323000ns 1.e1-f2 e8-f7 2.f2-f3 f7-f6 3.f3-e4 
6ply 0.00s +1.10 1278N 426000ns 1.e1-f2 e8-f7 2.f2-f3 f7-f6 3.f3-e4f6-e6 
7ply 0.01s +1.12 3312N 552000ns 1.e1-f2 e8-f7 2.f2-f3 f7-f6 3.f3-e4 f6-e6 4.e2-e3 
8ply 0.01s +1.12 6312N 631000ns 1.e1-f2 e8-f7 2.f2-f3 f7-f6 3.f3-e4 f6-e6 4.e2-e3 e6-f6 
9ply 0.02s +1.12 11099N 616000ns 1.e1-f2 e8-f7 2.f2-f3 f7-f6 3.f3-e4 f6-e6 4.e2-e3 e6-f6 5.e4-d5 
10ply 0.03s +1.12 16243N 624000ns 1.e1-f2 e8-f7 2.f2-f3 f7-f6 3.f3-e4 f6-e6 4.e2-e3 e6-f6 5.e4-d5 f6-f5 
11ply 0.07s +1.20 37077N 553000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 
12ply 0.12s +1.18 64956N 564000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.f4-g4 d6-c5 
13ply 0.17s +1.33 98138N 573000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.e4-e5 d6-e6 6.f4-e4 e6-f7 
14ply 0.22s +1.35 127232N 573000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.e4-e5 d6-e6 6.f4-e4 e6-e7 7.e4-d5 e7-f7 
15ply 0.32s +1.35 198061N 620000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-f6 5.e4-e5 f6-e6 6.f4-e4 
16ply 0.39s +1.40 245896N 627000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-d4 f6-e6 4.e2-e4 e6-d6 5.e4-e5 d6-e6 6.d4-e4 e6-e7 
17ply 0.47s +1.40  302981N 640000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-d4 f6-e6 4.e2-e4 e6-d6 5.e4-e5 d6-e6 6.d4-e4 e6-e7 
18ply 0.60s +1.63 401873N 665000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.f4-f5 d6-e7 6.e4-e5 e7-f7 7.e5-e6 f7-g7 8.f5-g5 g7-h8 
19ply 0.70s +1.63  471486N 670000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.f4-f5 d6-e7 6.e4-e5 e7-f7 7.e5-e6 f7-g7 8.f5-g5 g7-h8 
20ply 0.80s +1.63 543935N 679000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.f4-f5 d6-e7 6.e4-e5 e7-f7 7.e5-e6 f7-g8 8.f5-f6 g8-f8 9.f6-e5 f8-e8 
21ply 0.95s +1.63 654007N 689000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.f4-f5 d6-e7 6.e4-e5 e7-f7 7.e5-e6 f7-g8 8.f5-f6 g8-f8 9.f6-e5 f8-g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-e5 e7-f7 7.e5-e6 f7-g8 8.f5-f6 g8-f8 9.f6-e5 f8-g8 
36ply 12.00s +1.63 8826705N 735000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.f4-f5 d6-e7 6.e4-e5 e7-f7 7.e5-e6 f7-g8 8.f5-f6 g8-f8 9.f6-e5 f8-g8 
37ply 14.24s +1.63 10386476N 729000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.f4-f5 d6-e7 6.e4-e5 e7-f7 7.e5-e6 f7-g8 8.f5-f6 g8-f8 9.f6-e5 f8-g8 
38ply 17.14s +1.63 12436407N 725000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.f4-f5 d6-e7 6.e4-e5 e7-f7 7.e5-e6 f7-g8 8.f5-f6 g8-f8 9.f6-e5 f8-g8 
39ply 20.55s +1.63 14601394N 710000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.f4-f5 d6-e7 6.e4-e5 e7-f7 7.e5-e6 f7-g8 8.f5-f6 g8-f8 9.f6-e5 f8-g8 
40ply 24.26s +1.63 17277617N 712000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.f4-f5 d6-e7 6.e4-e5 e7-f7 7.e5-e6 f7-g8 8.f5-f6 g8-f8 9.f6-e5 f8-g8 
41ply 28.19s +1.63 20022154N 710000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.f4-f5 d6-e7 6.e4-e5 e7-f7 7.e5-e6 f7-g8 8.f5-f6 g8-f8 9.f6-e5 f8-g8 
42ply 35.33s +1.63 23646684N 669000ns 1.e1-f2 e8-f7 2.f2-e3 f7-f6 3.e3-f4 f6-e6 4.e2-e4 e6-d6 5.f4-f5 d6-e7 6.e4-e5 e7-f7 7.e5-e6 f7-g8 8.f5-f6 g8-f8 9.f6-e5 f8-g8
I think I have problems when I try to retrieve information

Code: Select all

if (tt.hash == pos->hash && tt.depth >= depth) {
        if (tt.type == EXACT_SCORE_TT)
            return tt.eval;
        if (tt.type == LOW_SCORE_TT && tt.eval > alpha)
            alpha = tt.eval;
        if &#40;tt.type == HIGH_SCORE_TT && tt.eval < beta&#41;
            beta = tt.eval;
        if &#40;alpha >= beta&#41;
            return tt.eval;
&#125;
in the beginning of my alpha-beta search (after testing draw by 2-fold repetition and 50-rule-draw);

or when I store information

Code: Select all

   
if &#40;depth >= tt.depth&#41; &#123;
        if &#40;eval <= alpha&#41;
            tt.type = LOW_SCORE_TT;
        else
            if &#40;eval >= beta&#41;
                tt.type = HIGH_SCORE_TT;
            else
                tt.type = EXACT_SCORE_TT;
    tt.eval = eval;
    tt.hash = pos->hash;
    tt.depth = depth;
    tt.best_move = best_move;
&#125; 
at the end of alpha-beta just before return the minmax value of the position.

I think I'm wrong but I don't found where.

Regards (and sorry for my mediocre English),
Samuele Giraudo.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Testing Transposition Tables

Post by sje »

For those wanting to test, here's a corrected FEN:

[D] 4k3/8/8/8/8/8/4P3/4K3 w - - 0 1
Harald Johnsen

Re: Testing Transposition Tables

Post by Harald Johnsen »

Your pv in truncated ? we do not see the moves past ply 9.

Here is an example output, promotion occured @ depth 24.

1 00:00 10 0 +1,40 e4
2 00:00 24 0 +1,22 e4 Kd7
3/3 00:00 55 0 +1,34 e4 Kd7 Kd2
4/4 00:00 163 0 +1,22 e4 Kd7 Kd2 Kd6
5/6 00:00 360 0 +1,28 e4 Kd7 Kd2 Kd6 Kd3
6/7 00:00 828 0 +1,10 e4 Kd7 Kd2 Kd6 Kd3 Ke5
6/7 00:00 1.223 0 +1,22 Kd2 Kd7 Kd3 Ke6 Ke4 Kd6
7/8 00:00 2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ke6 Kc8 e4 Kb8 Kf5 Kc8 e5 Kd8
21/22 00:00 40.670 1 +7,28 Kd2 Kd8 Kd3 Ke7 Ke4 Ke6 e3 Kf6 Kd5 Ke7 Ke5 Kd7 Kf6 Ke8 e4 Kf8 e5 Ke8 Ke6 Kf8 Kd7
22/22 00:00 52.725 1 +7,28 Kd2 Kd8 Kd3 Ke7 Ke4 Ke6 e3 Kf6 Kd5 Ke7 Ke5 Kd7 Kf6 Ke8 e4 Kf8 e5 Ke8 Ke6 Kf8 Kd7 Kg8
23/23 00:00 67.271 1 +7,36 Kd2 Kd8 Kd3 Ke7 Ke4 Ke6 e3 Kf6 Kd5 Ke7 Ke5 Kd7 Kf6 Ke8 e4 Kf8 e5 Kg8 Ke7 Kh8 e6 Kh7 Kd8
24/26 00:00 101.521 1 +10,91 Kd2 Kd8 Kd3 Ke7 Ke4 Ke6 e3 Kf6 Kd5 Ke7 Ke5 Kd7 Kf6 Ke8 e4 Kf8 e5 Kg8 Ke7 Kh8 e6 Kg7 Kd8 Kf6 e7 Ke5 e8Q+ Kd4

HJ.
Samuele Giraudo

Re: Testing Transposition Tables

Post by Samuele Giraudo »

Hello,
yes, my PV is truncated because if I read a best move by my transposition table without reading the next moves.

But, if I read the PV by the transposition table, I obtain :
0.Re1-f2 Re8-f7 1.Rf2-e3 Rf7-f6 2.Re3-f4 Rf6-e6 3.Pe2-e4 Re6-d6 4.Rf4-f5 Rd6-e7 5.Pe4-e5 Re7-f7 6.Pe5-e6 Rf7-g8 7.Rf5-f6 Rg8-f8 8.Rf6-e5 Rf8-g8 9.Re5-d6 Rg8-f8 10.Rd6-d7 Rf8-g7 11.Pe6-e7 Rg7-h8 12.Rd7-c8 Rh8-g8 13.Pe7-e8=D Rg8-h7 14.De8-f8 Rh7-g6 15.Df8-h8 Rg6-g5 16.Dh8-g8 Rg5-h6 17.Dg8-f8 Rh6-h7 18.Df8-d8 Rh7-g7 19.Dd8-e7 Rg7-h8 20.De7-d8 Rh8-h7

It's very strange because the evaluation is very low (+1.63).

I think I have a problem because in the Fine test, my program don't find the correct first move (1.Kb2 ?? instead of 1.Kb1!).

Samuele Giraudo
Samuele Giraudo

Re: Testing Transposition Tables

Post by Samuele Giraudo »

Without Quiescent Search, I obtain the following PS :

0.Re1-f2 Re8-f7 1.Rf2-e3 Rf7-f6 2.Re3-d4 Rf6-e6 3.Pe2-e4 Re6-d6 4.Pe4-e5 Rd6-e6 5.Rd4-e4 Re6-e7 6.Re4-d5 Re7-f7 7.Pe5-e6 Rf7-f8 8.Rd5-e5 Rf8-e8 9.Re5-d5 Re8-e7 10.Rd5-e5 Re7-f8 11.Re5-d5 Rf8-e7 12.Rd5-e5 Re7-f8 13.Re5-d5 Rf8-e7 14.Rd5-e5 Re7-f8 15.Re5-d5 Rf8-e7 16.Rd5-e5 Re7-f8 17.Re5-d5 Rf8-e7 18.Rd5-e5 Re7-f8 19.Re5-d5 Rf8-e7 20.Rd5-e5 Re7-f8

It's obviously wrong.

It seems giving 3-Repetition (and my program can detect it) but the evaluation is +1.58. Very strange.
Samuele Giraudo

Re: Testing Transposition Tables

Post by Samuele Giraudo »

Ok, I have found my error and I will respond to myself :) :

The right sequence was :

Code: Select all

if &#40;depth >= tt.depth&#41; &#123;
    tt.type = EXACT_SCORE_TT;
    if &#40;eval <= alpha&#41;
        tt.type = HIGH_SCORE_TT;
    if &#40;eval >= beta&#41;
         tt.type = LOW_SCORE_TT;
    tt.eval = eval;
    tt.hash = pos->hash;
    tt.depth = depth;
    tt.best_move = best_move;
&#125; 
when we store information in the TT at the end of AlphaBeta before returning the value of the the node.
This seem to work very well after tests I made.

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

Re: Testing Transposition Tables

Post by bob »

Samuele Giraudo wrote:Without Quiescent Search, I obtain the following PS :

0.Re1-f2 Re8-f7 1.Rf2-e3 Rf7-f6 2.Re3-d4 Rf6-e6 3.Pe2-e4 Re6-d6 4.Pe4-e5 Rd6-e6 5.Rd4-e4 Re6-e7 6.Re4-d5 Re7-f7 7.Pe5-e6 Rf7-f8 8.Rd5-e5 Rf8-e8 9.Re5-d5 Re8-e7 10.Rd5-e5 Re7-f8 11.Re5-d5 Rf8-e7 12.Rd5-e5 Re7-f8 13.Re5-d5 Rf8-e7 14.Rd5-e5 Re7-f8 15.Re5-d5 Rf8-e7 16.Rd5-e5 Re7-f8 17.Re5-d5 Rf8-e7 18.Rd5-e5 Re7-f8 19.Re5-d5 Rf8-e7 20.Rd5-e5 Re7-f8

It's obviously wrong.

It seems giving 3-Repetition (and my program can detect it) but the evaluation is +1.58. Very strange.

what on earth is "Re1-f2"??? Certainly not a legal rook move...
User avatar
xsadar
Posts: 147
Joined: Wed Jun 06, 2007 10:01 am
Location: United States
Full name: Mike Leany

Re: Testing Transposition Tables

Post by xsadar »

bob wrote:
Samuele Giraudo wrote:Without Quiescent Search, I obtain the following PS :

0.Re1-f2 Re8-f7 1.Rf2-e3 Rf7-f6 2.Re3-d4 Rf6-e6 3.Pe2-e4 Re6-d6 4.Pe4-e5 Rd6-e6 5.Rd4-e4 Re6-e7 6.Re4-d5 Re7-f7 7.Pe5-e6 Rf7-f8 8.Rd5-e5 Rf8-e8 9.Re5-d5 Re8-e7 10.Rd5-e5 Re7-f8 11.Re5-d5 Rf8-e7 12.Rd5-e5 Re7-f8 13.Re5-d5 Rf8-e7 14.Rd5-e5 Re7-f8 15.Re5-d5 Rf8-e7 16.Rd5-e5 Re7-f8 17.Re5-d5 Rf8-e7 18.Rd5-e5 Re7-f8 19.Re5-d5 Rf8-e7 20.Rd5-e5 Re7-f8

It's obviously wrong.

It seems giving 3-Repetition (and my program can detect it) but the evaluation is +1.58. Very strange.

what on earth is "Re1-f2"??? Certainly not a legal rook move...
Not sure what his native language is, but in Spanish for example, that would be "Rey" from e1 to f2, where "Rey" means "King". And since the piece on e1 is indeed a king, R must mean king in his languange. English abbreviations are of course more standard for international purposes, particularly when communication is in English, and avoids a lot of confusion. I'm guessing he must have removed the piece abbreviations in his first post, to avoid confusion, but simply forgot in this other post, although a simple clarification would have probably done the trick without the extra effort.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Testing Transposition Tables

Post by bob »

Here is what I get (after adding the missing pawn). Note that this is run without _any_ endgame tablebases. Pure search:

Code: Select all

               18     0.18   7.67   1. Kd2 Kf7 2. Ke3 Ke7 3. Kf4 Kf6 4.
                                    e3 Ke6 5. Ke4 Kf6 6. Kd5 Kf5 7. e4+
                                    Kg5 8. e5 Kg4 9. Ke6 Kg5 10. Kd6
               18->   0.18   7.67   1. Kd2 Kf7 2. Ke3 Ke7 3. Kf4 Kf6 4.
                                    e3 Ke6 5. Ke4 Kf6 6. Kd5 Kf5 7. e4+
                                    Kg5 8. e5 Kg4 9. Ke6 Kg5 10. Kd6
               19     0.21   7.87   1. Kd2 Kf7 2. Ke3 Ke7 3. Ke4 Ke6 4.
                                    e3 Kf6 5. Kd5 Kf5 6. e4+ Kf6 7. Kd6
                                    Kg6 8. Ke7 Kg5 9. e5 Kf4 10. e6 Ke3
               19->   0.22   7.87   1. Kd2 Kf7 2. Ke3 Ke7 3. Ke4 Ke6 4.
                                    e3 Kf6 5. Kd5 Kf5 6. e4+ Kf6 7. Kd6
                                    Kg6 8. Ke7 Kg5 9. e5 Kf4 10. e6 Ke3

...

               33->   3.69   8.21   1. Kd2 Kd8 2. Kd3 Kd7 3. Ke3 Ke7 4.
                                    Kf3 Kf7 5. Ke3 <HT>
               34     3.78     +1   1. Kd2!!   &#40;5.3Mnps&#41;             
               34     4.31     +3   1. Kd2!!   &#40;5.2Mnps&#41;             
               34     4.71     +M   1. Kd2!!   &#40;5.3Mnps&#41;             
               34     8.71  Mat26   1. Kd2 Kd8 2. Kd3 Kd7 3. Ke4 Ke6 4.
                                    Kf4 Kf6 5. e3 Ke6 6. Ke4 <HT>
               34->   8.75  Mat26   1. Kd2 Kd8 2. Kd3 Kd7 3. Ke4 Ke6 4.
                                    Kf4 Kf6 5. e3 Ke6 6. Ke4 <HT>
               35     9.85  Mat24   1. Kd2 Kd8 2. Kd3 Kd7 3. Ke4 Ke6 4.
                                    e3 Kf6 5. Kd5 Ke7 6. Ke5 Kf7 7. Kd6
                                    Kf6 8. e4 <HT>
               35->   9.92  Mat24   1. Kd2 Kd8 2. Kd3 Kd7 3. Ke4 Ke6 4.
                                    e3 Kf6 5. Kd5 Ke7 6. Ke5 Kf7 7. Kd6
                                    Kf6 8. e4 <HT>
               36    10.61  Mat24   1. Kd2 Kd8 2. Kd3 Kd7 3. Ke4 Ke6 4.
                                    e3 Kf6 5. Kd5 Ke7 6. Ke5 Kf7 7. Kd6
                                    Kf6 8. e4 Kf7 9. e5 Ke8 10. Ke6 <HT>
               36->  10.68  Mat24   1. Kd2 Kd8 2. Kd3 Kd7 3. Ke4 Ke6 4.
                                    e3 Kf6 5. Kd5 Ke7 6. Ke5 Kf7 7. Kd6
                                    Kf6 8. e4 Kf7 9. e5 Ke8 10. Ke6 <HT>
               37    13.33  Mat24   1. Kd2 Kd8 2. Kd3 Kd7 3. Ke4 Ke6 4.
                                    e3 Kf6 5. Kd5 Ke7 6. Ke5 Kf7 7. Kd6
                                    Kf6 8. e4 Kf7 9. e5 Ke8 10. Ke6 <HT>
               37->  13.64  Mat24   1. Kd2 Kd8 2. Kd3 Kd7 3. Ke4 Ke6 4.
                                    e3 Kf6 5. Kd5 Ke7 6. Ke5 Kf7 7. Kd6
                                    Kf6 8. e4 Kf7 9. e5 Ke8 10. Ke6 <HT>
You should be able to find the mate here very quickly I would think, and find a +9 score almost instantly.
Samuele Giraudo

Re: Testing Transposition Tables

Post by Samuele Giraudo »

xsadar wrote:
bob wrote:
Samuele Giraudo wrote:Without Quiescent Search, I obtain the following PS :

0.Re1-f2 Re8-f7 1.Rf2-e3 Rf7-f6 2.Re3-d4 Rf6-e6 3.Pe2-e4 Re6-d6 4.Pe4-e5 Rd6-e6 5.Rd4-e4 Re6-e7 6.Re4-d5 Re7-f7 7.Pe5-e6 Rf7-f8 8.Rd5-e5 Rf8-e8 9.Re5-d5 Re8-e7 10.Rd5-e5 Re7-f8 11.Re5-d5 Rf8-e7 12.Rd5-e5 Re7-f8 13.Re5-d5 Rf8-e7 14.Rd5-e5 Re7-f8 15.Re5-d5 Rf8-e7 16.Rd5-e5 Re7-f8 17.Re5-d5 Rf8-e7 18.Rd5-e5 Re7-f8 19.Re5-d5 Rf8-e7 20.Rd5-e5 Re7-f8

It's obviously wrong.

It seems giving 3-Repetition (and my program can detect it) but the evaluation is +1.58. Very strange.

what on earth is "Re1-f2"??? Certainly not a legal rook move...
Not sure what his native language is, but in Spanish for example, that would be "Rey" from e1 to f2, where "Rey" means "King". And since the piece on e1 is indeed a king, R must mean king in his languange. English abbreviations are of course more standard for international purposes, particularly when communication is in English, and avoids a lot of confusion. I'm guessing he must have removed the piece abbreviations in his first post, to avoid confusion, but simply forgot in this other post, although a simple clarification would have probably done the trick without the extra effort.
Yes, I'm sorry, in French, the king is "R" ("Roi").