Testposition for Glaurung

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
Eelco de Groot
Posts: 4702
Joined: Sun Mar 12, 2006 2:40 am
Full name:   Eelco de Groot

Testposition for Glaurung

Post by Eelco de Groot »

[d]8/2k5/1p5R/p7/3K1PP1/8/r6P/8 w - -

In this postion advancing pawn g4 should win I think, but Glaurung prefers to push h2-h4. In spite of astronomical evaluations which are entirely my own fault, Glaurung Mjolnir managed to actually lose from this position :( It was such a promising game up to this point :)

I'm trying to improve the passed pawn eval here a bit but it is not yet correct. The weight for passed pawns was 125 which may be over the top also.


[Event "12 Minutes/Game + 6 Seconds/Move"]
[Site "Engine Match"]
[Date "2008.04.26"]
[Round "2"]
[White "Glaurung 080422 Mjolnir 004 Build 3"]
[Black "Strelka 2.0 B"]
[Result "0-1"]

1. c4 {book 0s} e5 {book 0s} 2. Nc3 {book 0s} Nc6 {book 0s}
3. g3 {book 0s} g6 {book 0s} 4. Bg2 {book 0s} Bg7 {book 0s}
5. e4 {book 0s} d6 {book 0s} 6. d3 {book 0s} f5 {book 0s}
7. Nf3 {-0.29/14 1:04m} Nf6 {-0.26/15 21s} 8. O-O {-0.29/14
29s} O-O {-0.27/15 34s} 9. Qb3 {+0.03/14 36s} fxe4
{-0.29/15 57s} 10. dxe4 {0.00/15 29s} Na5 {-0.32/15 56s}
11. Qa4 {-0.13/14 33s} b6 {-0.16/14 21s} 12. Nd5 {-0.15/14
1:17m} Bg4 {-0.12/13 18s} 13. Bg5 {-0.17/14 21s} Qd7
{-0.15/15 1:21m} 14. Qxd7 {+0.03/15 23s} Bxd7 {-0.12/16
31s} 15. Nxc7 {-0.17/14 33s} Rac8 {0.00/16 13s} 16. Nd5
{-0.03/16 28s} Rxc4 {-0.02/15 8s}
{[d]5rk1/p2b2bp/1p1p1np1/n2Np1B1/2r1P3/5NP1/PP3PBP/R4RK1 w - - }

17. b3 { ! }{The present version plays this also but does not see that this is a really good move

5rk1/p2b2bp/1p1p1np1/n2Np1B1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Bh3 21.Nxg5 Bxg2 22.Kxg2 Re2
23.Nh3 Rf7 24.Re6 Kg7 25.Kf1 Rc2
26.Rxe5 Nc6 (55.193.464) 291

18.01 6:28 +0.72 17.b3 Rxe4 18.Nxf6+ Bxf6 19.Rfd1 Bxg5
20.Rxd6 Bg4 21.Nxg5 Rd4 22.Bd5+ Kg7
23.Rc1 Rc8 24.Rxc8 Bxc8 25.Rd8 Bf5
26.Rg8+ Kf6 27.Nxh7+ Ke7 28.Rg7+ Kd6
29.Nf6 Rxd5 30.Nxd5 (113.399.127) 291

best move: b2-b3 time: 8:43.516 min n/s: 291.363 nodes: 152.520.000 }
{+0.50/15 22s} 17... Rxe4 {-0.47/15 11s} 18. Nxf6+ {+0.62/15 14s} Bxf6 {-0.50/17 18s} 19. Rfd1 {+0.82/16 20s} Bxg5 {-0.53/16 13s} 20. Rxd6 {+0.68/16 16s} Bf5 {-0.76/16 36s} 21. Nxg5 {+0.76/16 19s}
Rd4 {-0.70/17 25s} 22. Rxd4 {+0.78/16 46s} exd4 {-0.77/17
5s} 23. b4 {+0.74/16 20s} h6 {-0.54/17 4s} 24. Nf3
{+0.45/17 18s} Nc6 {-0.70/19 17s} 25. b5 {+0.78/17 12s} Bg4
{-1.18/18 21s} 26. bxc6 {+1.43/18 11s} Bxf3 {-1.31/18 4s}
27. Bxf3 {+1.54/20 14s} Rxf3 {-1.19/19 4s} 28. Rc1
{+1.64/20 12s} Rf8 {-1.05/20 16s} 29. Kf1 {+1.64/19 10s}
Rc8 {-1.25/20 21s} 30. c7 {+1.98/20 15s} Kf8 {-1.32/20 18s}
31. Ke2 {+1.54/18 12s} Ke8 {-1.86/21 2:04m} 32. Rc6
{+2.23/17 11s} h5 {-1.89/20 27s} 33. f4 {+2.90/17 12s} Kd7
{-1.80/19 9s} 34. Rxg6 {+2.86/18 14s} Kxc7 {-1.90/18 16s}
35. Kd3 {+3.15/16 14s} a5 {-1.80/17 10s} 36. Rh6 {+3.49/16
12s} Re8 {-1.90/17 15s} 37. Rxh5 {+3.45/16 15s} Re3+
{-1.74/16 6s} 38. Kxd4 {+3.47/17 13s} Ra3 {-1.72/16 7s}
39. g4 {+3.47/15 25s} Rxa2 {-1.49/14 5s} 40. Rh7+ {+3.47/14
12s} (40. Rb5) 40... Kd6 {-1.48/15 8s} 41. Rh6+ {+3.43/14
14s} Kc7 {-1.39/14 2s} 42. h4 {+3.37/14 18s} a4 {-1.47/15
9s} 43. Rh7+ {+3.41/13 7s} Kb8 {-1.41/16 10s} 44. Re7
{+3.31/14 26s} Rf2 {-1.30/16 8s} 45. f5 {+3.11/14 9s} a3
{-1.60/15 8s} 46. Re1 {+3.19/14 24s} Kc7 {-1.92/15 12s}
47. Ke5 {+3.37/14 10s} a2 {-1.36/14 6s} 48. Rc1+ {+2.29/14
17s} Kd7 {-1.64/16 7s} 49. h5 {+2.09/14 11s} b5 {0.00/15
6s} 50. g5 {+0.84/13 14s} b4 {+3.49/15 15s} 51. Rd1+
{-0.56/12 7s} Kc7 {+5.04/16 11s} 52. Rc1+ {-1.54/13 7s} Kb6
{+5.84/15 14s} 53. h6 {-2.31/13 7s} b3 {+5.85/14 6s} 54. h7
{-6.19/12 12s} b2 {+7.37/14 17s} 55. h8=Q {-5.60/12 5s}
Re2+ {+7.20/14 17s} 56. Kd5 {-10.15/13 20s} bxc1=Q
{+9.19/14 7s} 57. Qb8+ {-9.09/13 8s} Ka5 {+10.76/14 7s}
58. Qa7+ {-10.50/13 7s} Kb4 {+12.46/14 13s} 59. Qb6+
{-10.50/13 8s} Kc3 {+13.20/14 15s} 60. Qc5+ {-12.41/12 6s}
Kd2 {+15.46/14 44s} 61. Qd4+ {-15.47/12 7s} Kc2 {+16.19/14
37s} 62. Qa4+ {-17.82/12 14s} Kb1 {+16.19/14 12s} 63. Qb3+
{-17.82/12 7s} Ka1 {+16.32/14 7s} 64. g6 {-80.26/12 12s}
Rd2+ {+M12/12 1s} 65. Ke5 {-80.26/12 7s} Qb2+ {+M11/11 0s}
66. Qxb2+ {-80.31/11 0s} Kxb2 {+M10/12 0s} 67. g7
{-86.66/13 7s} a1=Q {+M9/11 0s} 68. g8=Q {-93.11/12 4s}
Kc2+ {+M8/9 0s} 69. Ke6 {-M7/13 2s} Qa2+ {+M7/8 0s} 70. Kf6
{-M6/9 0s} Qxg8 {+M5/6 0s} 71. Ke7 {-M5/7 0s} Qg7+ {+M3/3
0s} 72. Ke6 {-M3/8 0s} Rd4 {+M2/2 0s} 73. f6 {-M2/6 0s}
Qd7+ {+M2/1 0s} 74. Ke5 {-M1/6 0s} Qd5# {+M1/1 0s} 0-1

Strelka output:


8/2k5/1p5R/p7/3K1PP1/8/r6P/8 w - -

Engine: Strelka 2.0 B (64 MB)
by Vasik Rajlich, Jury Osipov

8.00 0:00 +1.56 42.g5 a4 43.g6 a3 44.Rh7+ Kd6 45.g7 Rg2
46.h4 a2 47.Rh6+ Ke7 (58.321) 1240

9.00 0:00 +1.57 42.h4 a4 43.Rh7+ Kd6 44.h5 Rb2
45.Rh6+ Ke7 46.g5 a3 47.g6 Rd2+
48.Kc4 (147.767) 859

10.00 0:00 +1.51 42.g5 a4 43.g6 a3 44.g7 Rd2+ 45.Kc4 a2
46.g8Q a1Q 47.Rh7+ Rd7 48.Rxd7+ Kxd7
49.Qf7+ Kc6 50.Qe6+ Kc7 (290.424) 1029

11.22 0:00 +1.44 42.g5 a4 43.g6 a3 44.Rh7+ Kd6 45.Ra7 Rg2
46.Rxa3 Rxg6 47.h4 Rg8 (565.336) 881

12.22 0:01 +1.43 42.g5 a4 43.g6 a3 44.g7 Rd2+ 45.Kc4 a2
46.g8Q a1Q 47.Rh7+ Rd7 48.Rxd7+ Kxd7
49.Qf7+ Kd6 50.Qg6+ Kd7 51.Qh7+ Kd6
52.Qd3+ Ke6 53.Qd5+ Kf6 (1.162.963) 791

13.22 0:04 +1.45 42.g5 a4 43.Rh7+ Kd6 44.Ra7 a3 45.g6 Rg2
46.Rxa3 Rxg6 47.Rb3 Ke7 48.Re3+ K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+ Kd6 44.h4 Ke6 45.g6 Rf2
46.Ke4 Re2+ 47.Kf3 Re1 48.Rb7 Rf1+
49.Ke3 a3 50.Rxb6+ Kf5 51.Ra6 Re1+
52.Kd4 Re4+ 53.Kd5 Re7 54.h5 Kxf4
55.h6 (1.007.199.581) 730

best move: g4-g5 time: 25:12.203 min n/s: 727.996 nodes: 1.100.833.568

This is my best output, both engines were calculating in parallel:


8/2k5/1p5R/p7/3K1PP1/8/r6P/8 w - -

Engine: Glaurung 080422 Mjolnir 004 Build 6 (64 MB)
by Tord Romstad

2.00 0:00 +3.50 42.h4 b5 (301) 1

3.00 0:00 +3.70 42.h4 Ra4+ 43.Ke5 b5 (835) 3

4.00 0:00 +3.88 42.h4 b5 43.Rh7+ Kd6 44.h5 Rd2+
45.Ke4 (1.961) 7

5.00 0:00 +3.92 42.h4 Rd2+ 43.Kc3 Rg2 44.g5 b5 (5.350) 20

5.00 0:00 +4.09 42.g5 Rd2+ 43.Ke4 Rg2 44.h4 b5 (8.305) 29

6.00 0:00 +4.33 42.g5 Rg2 43.h4 Rg4 44.Ke5 b5 (17.581) 53

7.00 0:00 +4.03 42.g5 Rd2+ 43.Ke3 Rd7 44.f5 b5 45.h4 a4 (29.341) 75

8.00 0:00 +4.11 42.g5 Rd2+ 43.Ke3 Rd8 44.f5 a4 45.g6 Re8+
46.Kd4 a3 (50.729) 111

9.00 0:00 +3.82 42.g5 a4 43.f5 a3 44.h4 Rf2 45.Rh7+ Kd6
46.Ra7 Rd2+ 47.Kc4 (148.015) 178

9.00 0:01 +4.07 42.h4 Rd2+ 43.Kc3 Rf2 44.f5 b5
45.Ra6 b4+ 46.Kd3 Rf3+ 47.Ke4 Ra3 (220.985) 202

10.01 0:01 +3.92 42.h4 a4 43.Rh7+ Kd6 44.Rh6+ Ke7
45.Rxb6 a3 46.Rb7+ Kd6 47.Rb6+ Ke7
48.f5 Rf2 (431.103) 226

11.01 0:04 +3.86 42.h4 a4 43.Rh7+ Kd6 44.h5 b5 45.h6 Rd2+
46.Ke3 Rg2 47.Kf3 Rh2 48.g5 (1.064.626) 249

12.01 0:08 +3.76 42.h4 a4 43.Rh7+ Kd6 44.Ra7 Rh2
45.h5 Rh4 46.Rxa4 Rxg4 47.Ke4 Rh4
48.Rd4+ Ke6 (2.070.264) 255

13.01 0:21 +3.80 42.h4 a4 43.Rh7+ Kd6 44.h5 Rd2+
45.Ke3 Rh2 46.Ra7 b5 47.h6 Rxh6
48.Ra6+ Kd5 49.Rxh6 b4 (5.482.385) 261

14.01 0:39 +3.70 42.h4 a4 43.Rh7+ Kd6 44.Ra7 Rh2
45.h5 Rh4 46.Rxa4 Rxg4 47.Ke4 Rh4
48.Rd4+ Ke6 49.Rd5 Kf6 50.Rd6+ Kg7 (10.295.685) 261

14.07 1:07 +3.94 42.g5 Rd2+ 43.Ke3 Rd7 44.h4 a4
45.Rh8 b5 46.h5 a3 47.f5 Rg7 48.Kf4 a2
49.Ra8 (17.806.421) 262

15.01 1:27 +3.90 42.g5 Rd2+ 43.Ke3 Rd7 44.h4 a4
45.Rh8 b5 46.h5 b4 47.Ra8 a3 48.f5 Kd6
49.h6 Rf7 (22.977.449) 262

16.01 3:28 +3.98 42.g5 a4 43.Rh7+ Kd6 44.h4 b5 45.h5 b4
46.g6 Rd2+ 47.Ke3 Rh2 48.g7 Rg2
49.h6 a3 50.Rh8 Ke6 (54.579.302) 262

17.01 5:56 +4.11 42.g5 a4 43.Rh7+ Kd6 44.h4 a3 45.h5 Rf2
46.Ke3 Rh2 47.h6 a2 48.Ra7 Ke6
49.Ke4 Re2+ 50.Kd3 Rg2 51.Kc3 (93.630.478) 262

18.01 14:08 +4.41 42.g5 a4 43.Rh7+ Kd6 44.h4 b5 45.h5 b4
46.Rb7 b3 47.h6 Rf2 48.Ke4 b2 49.h7 Re2+
50.Kd4 Re7 51.Rxb2 Rxh7 52.f5 (222.623.564) 262

best move: g4-g5 time: 25:12.172 min n/s: 261.417 nodes: 395.280.000

The eval for 42. g5 seems right :roll: but was too high for 42. h4. I believe at least Glaurung 2.0.1 also plays 42. h4

Eelco
User avatar
Eelco de Groot
Posts: 4702
Joined: Sun Mar 12, 2006 2:40 am
Full name:   Eelco de Groot

Re: Testposition for Glaurung

Post by Eelco de Groot »

Build No.8:

[d]8/2k5/1p5R/p7/3K1PP1/8/r6P/8 w - -

Engine: Glaurung 080422 Mjolnir 004 Build 8 (64 MB)
by Tord Romstad

9.00 0:00 +3.94 42.g5 a4 43.f5 a3 44.f6 Rf2 45.Ke3 a2
46.Kxf2 a1Q (97.278) 151

10.00 0:01 +3.86 42.g5 a4 43.f5 Rd2+ 44.Kc3 Rd5
45.Rf6 a3 46.h4 a2 47.Kb2 Rd2+
48.Ka1 (230.756) 202

11.01 0:03 +3.84 42.g5 a4 43.f5 Rf2 44.f6 a3 45.Rh7+ Kd6
46.Rb7 Ke6 47.Rxb6+ Kf5 48.h4 Rf4+
49.Kd5 Rxh4 (830.635) 242

11.03 0:04 +3.92 42.h4 a4 43.Rh7+ Kd6 44.h5 a3 45.Ra7 Rf2
46.Rxa3 Rxf4+ 47.Kc3 Rxg4 48.h6 Rg3+
49.Kb4 (1.057.644) 248

12.01 0:06 +3.96 42.h4 a4 43.Rh7+ Kd6 44.Ra7 a3 45.f5 b5
46.g5 b4 47.Kc4 Rb2 48.h5 (1.686.110) 253

13.01 0:12 +3.98 42.h4 a4 43.Rh7+ Kd6 44.Ra7 Rh2
45.h5 Rh4 46.Rxa4 Rxg4 47.Ke4 Rh4
48.Rd4+ Ke6 49.Rd5 (3.153.399) 259

13.03 0:18 +4.09 42.g5 a4 43.f5 a3 44.Rh7+ Kd6 45.f6 Rg2
46.h4 Rg4+ 47.Kd3 b5 48.Ra7 Rg3+
49.Kd4 b4 50.Ra6+ Kd7 (4.759.046) 260

14.01 0:27 +4.17 42.g5 a4 43.f5 a3 44.Rh7+ Kd6 45.f6 Rg2
46.h4 Rg4+ 47.Kd3 b5 48.Ra7 Rg3+
49.Ke4 Rg4+ 50.Kf5 Ra4 (7.268.739) 260

15.01 1:00 +4.25 42.g5 a4 43.Rh7+ Kd6 44.Ra7 a3 45.f5 Rxh2
46.f6 Ke6 47.f7 Rd2+ 48.Ke4 Rd8
49.g6 Kf6 50.Rxa3 Kxg6 (16.042.942) 263

16.01 2:02 +4.25 42.g5 a4 43.Rh7+ Kd6 44.Ra7 a3 45.f5 Rxh2
46.f6 Ke6 47.f7 Rd2+ 48.Ke4 Rd8
49.g6 Kf6 50.Rxa3 Kxg6 (32.261.503) 262

17.01 4:09 +4.33 42.g5 a4 43.Rh7+ Kd6 44.Ra7 b5
45.Ra6+ Ke7 46.f5 Rxh2 47.f6+ Kf7
48.Ra7+ Ke6 49.f7 Rh8 50.Kc5 a3
51.g6 Kf6 52.Ra6+ Kg7 53.Kxb5 (65.218.853) 261

18.01 11:07 +4.66 42.g5 a4 43.Rh7+ Kd6 44.h4 b5 45.h5 b4
46.h6 b3 47.Rb7 Rf2 48.g6 Rxf4+
49.Kc3 Ke6 50.g7 Rf3+ 51.Kb2 Rf2+
52.Ka3 Rg2 53.Kxa4 (173.472.822) 259

19.01 32:02 +5.23 42.g5 a4 43.Rh7+ Kd6 44.h4 b5 45.h5 b4
46.Rb7 b3 47.h6 Rf2 48.g6 Rxf4+
49.Kc3 Kc6 50.Rb8 Rf3+ 51.Kb4 Kc7
52.Rb5 Rf6 (500.537.812) 260

best move: g4-g5 time: 35:43.718 min n/s: 259.769 nodes: 556.860.000


h4 is played later on move 44 but I am gambling that a transposition with h4 as first move is not the same. Anyway for the moment I think I will leave it like this. The PV is in good agreement with that of Strelka and the eval seems good :P

This is now my version of the first part of Glaurung's passed pawn evaluation:

Code: Select all

  // evaluate_passed_pawns() evaluates the passed pawns for both sides.

  void evaluate_passed_pawns(const Position& pos, EvalInfo& ei) {
    bool hasUnstoppable[2] = {false, false};
    int movesToGo[2] = {100, 100};
    int blockerCount, attackedsquareCount, defendedsquareCount;

    for(Color c = WHITE; c <= BLACK; c++) {
      Square ourKingSq = pos.king_square(c);
      Square theirKingSq = pos.king_square(opposite_color(c));
      Bitboard b = ei.pi->passed_pawns() & pos.pawns_of_color(c), b2;

      while(b) {
        Square s = pop_1st_bit(&b);
        assert(pos.piece_on(s) == pawn_of_color(c));
        assert(pos.pawn_is_passed(c, s));

        int r = int(pawn_rank(c, s) - RANK_2);
        int tr = Max(0, r * (r-1));
        Square blockSq = s + ((c == WHITE)? DELTA_N : DELTA_S);

        // Base bonus based on rank:
        Value mbonus = Value(20 * tr);
        Value ebonus = Value(r * r * 25);
        // [EdG: Edge pawns are less likely to promote:]
		if (square_file(s) == FILE_A || square_file(s) == FILE_H) {
			mbonus -= Value(20);
			ebonus -= Value(20);
		}
        // Adjust bonus based on king proximity:
        ebonus -= Value(square_distance(ourKingSq, blockSq) * 3 * tr);
        ebonus += Value(square_distance(theirKingSq, blockSq) * 6 * tr);

        // If the pawn is free to advance, increase bonus.  Note that the
        // use of pos.see() below causes occasional symmetry problems,
        // because the static exchange evaluator is not always symmetrical
        // in positions with complicated X-ray attacks.
        b2 = squares_in_front_of(c, s);
        blockerCount =
          count_1s_max_15( b2 & pos.occupied_squares());
        attackedsquareCount =
          count_1s_max_15( b2 & ei.attackedBy[opposite_color(c)][0]);
        defendedsquareCount =
          count_1s_max_15( b2 & ei.attackedBy[c][0]);
        mbonus += Value(40 + tr - 10 * blockerCount - 8 * attackedsquareCount + 4 * defendedsquareCount);
        ebonus += Value(40 + tr - 10 * blockerCount - 8 * attackedsquareCount + 4 * defendedsquareCount);
        if(pos.square_is_empty(blockSq) && pos.see(s, blockSq) == 0) {
          
          if((pos.pieces_of_color(opposite_color(c)) & b2) == EmptyBoardBB)
            ebonus += Value(8 * tr);
          if((pos.pieces_of_color(c) & b2) == EmptyBoardBB)
            ebonus += Value(tr);
          if((~ei.attackedBy[c][0] & ei.attackedBy[opposite_color(c)][0] & b2)
             == EmptyBoardBB)
            ebonus += Value(6 * tr);
        }
Edit: I noticed a serious bug, I put in twice FILE_A instead of FILE_H :oops:
I changed the code now. Still, it seemed to work as it is, but I now have to test of course what happens if I penalize pawn h which is what the change was meant for...
User avatar
Eelco de Groot
Posts: 4702
Joined: Sun Mar 12, 2006 2:40 am
Full name:   Eelco de Groot

Re: Testposition for Glaurung

Post by Eelco de Groot »

Eelco de Groot wrote:Edit: I noticed a serious bug, I put in twice FILE_A instead of FILE_H :oops:
I changed the code now. Still, it seemed to work as it is, but I now have to test of course what happens if I penalize pawn h which is what the change was meant for...
With the corrected version I get a comparable result. This version still does not play the endgame correctly later on I think but the score for 42. g5 does keep going up, if it is a draw this version would have seen it by now I think. I checked a very little bit with ChessTiger that also thinks White is still good here, but on move 47 it was already a draw only.

Build No. 9 after more than twelve hours:


[d]8/2k5/1p5R/p7/3K1PP1/8/r6P/8 w - -

Engine: Glaurung 080422 Mjolnir 004 (64 MB)
by Tord Romstad


10.00 0:00 +3.80 42.g5 a4 43.f5 a3 44.f6 Rg2 45.Rh7+ Kd6
46.Ra7 Rg4+ 47.Kc3 Ke6 (286.645) 436

11.00 0:01 +3.78 42.g5 a4 43.f5 Rd2+ 44.Ke3 Rg2 45.g6 a3
46.Rh7+ Kd6 47.Ra7 a2 48.h4 (642.270) 478

11.02 0:01 +3.96 42.h4 a4 43.f5 a3 44.Rh7+ Kd6 45.Ra7 Ra1
46.f6 a2 47.f7 Rf1 48.Rxa2 Rf4+
49.Ke3 Rxf7 (967.017) 487

12.01 0:03 +3.86 42.h4 a4 43.f5 a3 44.Rh7+ Kd6 45.Ra7 Rg2
46.g5 Rg4+ 47.Kc3 b5 48.Kb3 b4 (1.608.019) 497

13.01 0:07 +3.74 42.h4 a4 43.Rh7+ Kd6 44.Ra7 Rh2
45.h5 Rh4 46.g5 Rxf4+ 47.Ke3 Ke5
48.g6 Re4+ 49.Kd3 Rh4 (3.769.146) 501

13.03 0:13 +4.05 42.g5 a4 43.f5 a3 44.g6 Rd2+ 45.Kc3 a2
46.Rh7+ Kd6 47.Ra7 Rxh2 48.f6 Ke6
49.f7 Rf2 (6.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Ke5 a4 44.Rh3 b5 45.g6 Rd8
46.f5 b4 47.Rh4 Re8+ 48.Kd5 Rd8+
49.Ke6 Re8+ 50.Kf7 Rb8 51.g7 a3
52.Rh8 Rb7 53.g8Q Kc6+ 54.Kf6 b3
55.Qc4+ (3.110.325.407) 509

22.01 195:43 +5.33 42.g5 Rd2+ 43.Ke5 a4 44.Rh3 b5 45.g6 Rd8
46.f5 b4 47.Rh4 Re8+ 48.Kd5 Rd8+
49.Ke6 Re8+ 50.Kf7 Rb8 51.g7 a3
52.Rh8 Rb7 53.Kf6 b3 54.g8Q Kc6
55.Qc4+ (5.975.159.528) 508

23.01 824:37 +5.78 42.g5 Rd2+ 43.Ke5 a4 44.Rh3 b5 45.g6 Rd8
46.f5 b4 47.Rh4 Re8+ 48.Kd5 Rd8+
49.Ke6 Re8+ 50.Kf7 Rb8 51.g7 a3
52.Rxb4 Rxb4 53.g8Q Ra4 54.Qg3+ Kc6
55.Qc3+ (25.090.032.436) 507

best move: g4-g5 time: 837:50.594 min n/s: 506.978 nodes: 25.486.110.000


Chess Tiger 2007.1 in Gambit Style after 47... a2 in the game continuation and after some forward analysis thinks now it should clearly be a draw:

[d]8/2k5/1p6/4KP2/6PP/8/p4r2/4R3 w - - 0 1

00:00:04.9 0,49 8 44410 Ra1 b5 g5 b4 g6 b3 g7 b2 Rxa2 Rxf5+ Kxf5 b1Q+ Kf6
00:00:09.9 0,74 8 62938 Rc1+ Kd7 g5 Re2+ Kd4 Rc2 Ra1 Ke7 f6+ Kf7 Kd5 Kg6 Ke5
00:00:10.0 1,20 9 121474 Rc1+ Kd7 g5 b5 g6 Re2+ Kd4 Rc2 Ra1 Ke7 h5 Kf6 h6 Kxf5 h7
00:00:15.0 0,92 10 286790 Rc1+ Kd7 h5 Re2+ Kf6 Rh2 Kg6 Rb2 Ra1 Rg2 g5
00:00:34.9 0,20 11 855348 Rc1+ Kd7 g5 b5 g6 Re2+ Kf6 b4 Rg1 Rg2 Rd1+ Kc6 Ra1 b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