Not reproducible

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Not reproducible

Post by Henk »

Don't understand. Skipper not able to win QKk endgame.
Only playing random moves with the queen.



[pgn]
[Event "Computer Chess Game"]
[Site "LAPTOP-1FK7MTIP"]
[Date "2021.07.21"]
[Round "-"]
[White "Skipper_8_17"]
[Black "Fairy-Max 4.8V"]
[Result "1/2-1/2"]
[TimeControl "120"]
[Annotator "1. +0.87 1... +0.24"]

1. d4 {+0.87/13} Nc6 {+0.24/7 2.3} 2. d5 {+1.91/13 2.0} Ne5 {-0.17/8 2.6}
3. Nc3 {+1.84/12 2.0} c6 {+0.09/8 2.0} 4. f4 {+1.80/13 1.9} Ng6 {-0.07/8 4}
5. f5 {+1.95/11 1.9} Ne5 {+0.05/9 3} 6. Bf4 {+2.57/12 1.9} d6 {+0.13/8 4}
7. e4 {+2.16/12 1.9} g6 {+0.10/7 5} 8. Qd4 {+2.39/11 1.8} Bg7 {+0.33/6 1.6}
9. O-O-O {+2.70/10 1.8} gxf5 {+0.58/6 5} 10. Be2 {+1.87/10 1.7} Bf6
{+0.76/6 6} 11. Qa4 {+0.83/10 1.7} Bd7 {+0.85/7 4} 12. exf5 {+1.24/11 1.7}
Bxf5 {+0.54/7 2.7} 13. Bxe5 {+1.24/9 1.6} Bxe5 {+0.50/9 2.0} 14. dxc6
{+0.95/11 1.6} bxc6 {+0.43/8 1.0} 15. Bf3 {-0.47/11 1.6} Bd7 {+0.28/8 2.1}
16. Bxc6 {-0.31/12 1.6} Nf6 {+0.36/8 1.8} 17. Nf3 {-0.08/11 1.6} Bf4+
{+0.24/9 1.9} 18. Qxf4 {+1.62/12 1.5} Bxc6 {+0.25/8 1.0} 19. Nd4
{+1.59/9 1.5} Bxg2 {+0.30/9 5} 20. Rhe1 {+0.45/12 1.5} Nd5 {-0.21/9 4} 21.
Nxd5 {+2.20/13 1.5} Bxd5 {-0.48/9 1.5} 22. Qg5 {+2.63/11 1.5} e5
{-0.46/8 1.0} 23. Rxe5+ {+1.07/11 1.4} dxe5 {-1.06/9 1.2} 24. Qxe5+
{+1.85/14 1.4} Qe7 {-1.13/8 2.2} 25. Qxh8+ {+2.31/13 1.4} Kd7 {-1.26/8 1.2}
26. Qxh7 {+2.40/12 1.4} Qe3+ {-1.30/8 2.8} 27. Kb1 {+2.57/11 1.3} Qe4
{-1.60/8 1.8} 28. Qh3+ {+3.65/10 1.3} Ke8 {-1.61/6 0.7} 29. Nf5
{+5.32/11 1.3} Rd8 {-1.60/7 0.8} 30. b3 {+5.92/11 1.3} a5 {-1.58/7 1.1} 31.
Ne3 {+6.43/12 1.3} Rd7 {-2.15/8 1.1} 32. Nxd5 {+8.47/11 1.2} Rxd5
{-2.54/10 0.9} 33. Qc8+ {+3.97/12 1.2} Ke7 {-2.53/9 1.1} 34. Qb7+
{+3.98/11 1.2} Kd6 {-2.25/8 0.8} 35. Rf1 {+3.79/11 1.2} f5 {-2.05/8 1.2}
36. a4 {+3.78/10 1.2} Qe5 {-1.75/7 0.7} 37. Qh7 {+3.83/10 1.1} Qe6
{-1.85/8 1.3} 38. Qh4 {+3.88/10 1.1} Kd7 {-1.87/8 2.4} 39. Qh8
{+3.89/10 1.1} Qg6 {-1.77/7 0.6} 40. c4 {+4.20/11 1.1} f4+ {-1.30/8 0.9}
41. Ka1 {+3.78/11 1.1} Rd3 {-1.60/8 1.7} 42. Qb2 {+4.15/11 1.0} f3
{-0.89/8 1.1} 43. c5 {+4.64/10 1.0} Qh6 {-0.90/7 0.8} 44. Qc2
{+4.77/11 1.0} Qf6+ {-0.62/9 2.0} 45. Kb1 {+3.39/11 1.0} Qc3 {-0.40/9 1.2}
46. Rd1 {+2.68/13 1.0} Qxc2+ {-0.73/10 0.5} 47. Kxc2 {+1.55/19 1.0} Rxd1
{-1.38/13 0.7} 48. Kxd1 {+1.54/17 1.0} Kc6 {-4.19/14 0.7} 49. h4
{+1.98/16 1.0} Kxc5 {-7.11/14 0.4} 50. h5 {+1.99/14 0.9} Kb4 {-7.69/15 0.3}
51. h6 {+10.03/19 0.9} Kxb3 {-7.74/15 0.6} 52. h7 {+9.76/17 0.9} f2
{-7.77/14 0.5} 53. Ke2 {+10.23/17 0.9} Kxa4 {-7.81/14 0.6} 54. h8=Q
{+10.23/14 0.9} Kb4 {-8.38/13 1.4} 55. Qb8+ {+10.27/12 0.9} Kc4
{-8.42/11 0.3} 56. Qc7+ {+11.42/14 0.9} Kb5 {-8.55/13 0.5} 57. Qb7+
{+11.65/15 0.8} Kc5 {-8.51/13 0.5} 58. Qa6 {+11.69/15 0.8} a4
{-8.57/12 0.4} 59. Qxa4 {+11.76/14 0.8} Kd5 {-8.64/13 0.8} 60. Kxf2
{+11.78/12 0.8} Ke6 {-9.28/13 0.7} 61. Qa6+ {+11.20/9 0.8} Kf7
{-9.76/12 0.3} 62. Qh6 {+11.22/11 0.8} Ke7 {-9.75/14 0.4} 63. Qg5+
{+11.22/10 0.7} Kd6 {-9.54/12 0.3} 64. Qh5 {+11.22/9 0.7} Ke6
{-9.70/13 0.4} 65. Qf3 {+11.78/12 0.7} Ke5 {-9.74/13 0.5} 66. Qh5+
{+11.78/12 0.7} Ke6 {-0.01/28 0.2} 67. Qg6+ {+11.22/9 0.7} Ke7
{-10.24/13 0.4} 68. Qg5+ {+11.22/10 0.7} Kd6 {-0.01/28 0.2} 69. Qc1
{+11.22/9 0.7} Kd5 {-10.20/12 0.3} 70. Qe1 {+11.78/12 0.7} Kd6
{-10.16/13 0.3} 71. Qc1 {+11.22/10 0.7} Kd5 {-0.01/28 0.2} 72. Qe1
{+11.78/11 0.7} Kd6 {-0.01/28 0.2} 73. Qb4+ {+11.22/10 0.7} Ke5
{-10.14/11 0.2} 74. Qb8+ {+11.22/9 0.6} Ke6 {-10.16/12 0.4} 75. Qe8+
{+11.22/10 0.6} Kd6 {-10.31/13 0.2} 76. Qe2 {+11.22/9 0.6} Kd5
{-10.80/14 0.6} 77. Qa6 {+11.78/12 0.6} Kc5 {-10.74/13 0.2} 78. Qa5+
{+11.78/9 0.6} Kd6 {-10.76/13 0.2} 79. Qb4+ {+11.22/9 0.6} Ke5
{-0.01/28 0.2} 80. Qb8+ {+11.22/10 0.6} Ke6 {-0.01/28 0.3} 81. Qe8+
{+11.22/10 0.6} Kd6 {-0.01/28 0.3} 82. Qd8+ {+11.22/10 0.6} Ke6
{-11.08/12 0.3} 83. Qh4 {+11.22/11 0.6} Ke5 {-10.74/11 0.2} 84. Qh7
{+11.22/9 0.5} Kd4 {-10.89/13 0.4} 85. Qa7+ {+11.23/9 0.5} Kc4
{-10.97/13 0.2} 86. Qa4+ {+11.23/9 0.5} Kd5 {-10.95/12 0.2} 87. Qb3+
{+11.23/9 0.5} Kd6 {-10.91/12 0.3} 88. Qg3+ {+11.22/9 0.5} Kd7
{-11.00/13 0.3} 89. Qg4+ {+11.22/9 0.5} Kc6 {-10.98/14 0.2} 90. Qe4+
{+11.23/9 0.5} Kc5 {-10.98/13 0.2} 91. Qe3+ {+11.23/9 0.5} Kd5
{-10.98/14 0.3} 92. Qh3 {+11.22/9 0.5} Kc6 {-10.97/13 0.2} 93. Qg2+
{+11.22/9 0.5} Kc5 {-10.98/14 0.3} 94. Qg7 {+11.22/10 0.5} Kd6
{-10.98/14 0.2} 95. Qf8+ {+11.23/10 0.5} Kc6 {-11.02/13 0.2} 96. Qc8+
{+11.23/10 0.5} Kd5 {-11.03/14 0.2} 97. Qd8+ {+11.23/10 0.4} Ke6
{-0.01/27 0.2} 98. Qf8 {+11.23/12 0.4} Ke5 {-11.03/14 0.4} 99. Qc8
{+11.23/10 0.4} Kd5 {-0.01/28 0.3} 100. Qg8+ {+11.23/10 0.4} Kd4
{-11.11/13 0.5} 101. Qf8 {+11.23/11 0.4} Ke5 {-0.01/24 0.2} 102. Qf3
{+11.23/11 0.4} Kd6 {-11.08/14 0.3} 103. Qd1+ {+11.23/10 0.4} Ke6
{-11.43/12 0.2} 104. Kf1 {+11.24/10 0.4} Ke5 {-11.41/12 0.2} 105. Qe2+
{+11.24/10 0.4} Kd5 {-11.28/10 0.2} 106. Qd1+ {+11.24/10 0.4} Ke5
{-0.01/28 0.2} 107. Qd2 {+11.24/13 0.4} Ke6 {-11.39/12 0.2} 108. Qd8
{+0.00/25 0.4} Ke5 {-11.40/13 0.2} 109. Qa5+ {+0.00/199 0.9} Ke6
{-11.32/11 0.2} 110. Ke2 {+0.00/199 0.7}
{Xboard adjudication: 50-move rule} 1/2-1/2
[/pgn]

But Skipper has no problem to win this position with 10 seconds on the clock:
[d]8/8/8/3k4/Q7/8/5K2/8 b - - 0 60

Maybe bug in fifty moves rule, three fold repetition detection, incorrect evaluation ?
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Not reproducible

Post by mvanthoor »

Just make an extra King PST with 0 for the king being in the center, and increasing penalties when it nears the edge and the corners. Make sure the penalties increase rapidly. So, center is 0; one file closer to the edge is -5, two files closer to the edge is -20, and so on.

Only use this table when material value of one of the sides is less than one pawn (or, one king at maximum). In the worst case, the winning side will whittle the other down to bare king before mating, but it _will_ win. (I solved this problem in Rustic Alpha 1 in this way.)
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Not reproducible

Post by Henk »

O wait it is reproducible now:

[pgn]
[Date "2021.07.22"]
[Round "-"]
[White "Skipper_8_17"]
[Black "Fairy-Max 4.8V"]
[Result "1/2-1/2"]
[TimeControl "120"]
[FEN "8/7P/8/p7/P7/1k3p2/8/3K4 b - - 0 1"]
[SetUp "1"]

{--------------
. . . . . . . .
. . . . . . . P
. . . . . . . .
p . . . . . . .
P . . . . . . .
. k . . . p . .
. . . . . . . .
. . . K . . . .
black to play
--------------}
1... f2 {-7.80/15 2.3} 2. Ke2 {+10.23/18 2.0} Kxa4 {-8.29/15 1.9} 3. h8=Q
{+9.95/14 1.9} Kb5 {-8.52/14 2.7} 4. Qe8+ {+10.24/13 1.9} Kb4
{-8.51/15 1.7} 5. Qe4+ {+10.34/13 1.9} Kb5 {-8.52/14 1.5} 6. Qb7+
{+11.65/16 1.8} Kc5 {-8.52/15 2.5} 7. Qa6 {+11.73/16 1.8} a4 {-8.61/15 2.1}
8. Qxa4 {+11.74/15 1.8} f1=Q+ {-8.73/15 2.0} 9. Kxf1 {+11.79/16 1.8} Kd6
{-9.43/16 1.8} 10. Qa3+ {+11.22/10 1.7} Kd7 {-9.99/16 1.7} 11. Qb2
{+11.79/13 1.7} Kc6 {-79.77/16 1.5} 12. Kg1 {+11.79/14 1.7} Kc5
{-79.81/17 3} 13. Kf2 {+11.22/10 1.6} Kc6 {-79.85/17 2.7} 14. Kg1
{+11.79/14 1.6} Kc5 {-0.01/28 0.1} 15. Qc2+ {+11.22/10 1.6} Kd6
{-79.84/16 1.4} 16. Qd1+ {+11.79/14 1.6} Kc7 {-79.82/16 1.8} 17. Qd4
{+11.79/12 1.5} Kc6 {-79.83/17 1.6} 18. Qf6+ {+11.20/9 1.5} Kc7
{-79.85/16 1.1} 19. Qb2 {+11.19/9 1.5} Kd7 {-79.86/17 1.3} 20. Qc3
{+11.19/9 1.5} Kd6 {-79.87/18 1.9} 21. Qg3+ {+11.20/9 1.4} Kd7
{-79.87/18 1.4} 22. Qc3 {+11.19/9 1.4} Kd6 {-0.01/28 0.2} 23. Kf2
{+11.21/10 1.4} Kd5 {-79.91/17 4} 24. Qa1 {+11.21/9 1.4} Kc6
{-79.88/15 1.2} 25. Qb2 {+11.21/9 1.3} Kc7 {-79.89/16 1.0} 26. Qg7+
{+11.20/9 1.3} Kd6 {-79.89/16 1.1} 27. Qa1 {+11.21/9 1.3} Kc6
{-0.01/28 0.2} 28. Qb2 {+11.21/9 1.3} Kc7 {-0.01/28 0.1} 29. Qg7+
{+11.20/9 1.3} Kd6 {-0.01/28 0.2} 30. Qh7 {+11.21/10 1.2} Kc6
{-79.88/15 1.1} 31. Qh1+ {+11.21/9 1.2} Kc7 {-79.88/15 1.4} 32. Qh7+
{+11.20/10 1.2} Kc6 {-0.01/28 0.2} 33. Qh1+ {+11.21/10 1.2} Kc7
{-0.01/28 0.2} 34. Qc1+ {+11.20/10 1.2} Kd6 {-79.87/14 1.0} 35. Qd1+
{+11.21/9 1.1} Kc6 {-79.87/15 1.0} 36. Qc1+ {+11.20/9 1.1} Kd6
{-0.01/28 0.1} 37. Qf4+ {+11.21/10 1.1} Kc6 {-79.86/15 1.1} 38. Qe4+
{+11.21/9 1.1} Kd6 {-79.86/14 0.9} 39. Qe8 {+11.21/9 1.1} Kc7
{-79.87/16 1.5} 40. Qf7+ {+11.20/9 1.1} Kc6 {-79.88/15 1.1} 41. Qh7
{+11.21/9 1.0} Kb6 {-79.88/15 0.9} 42. Qb1+ {+11.21/10 1.0} Kc6
{-79.86/15 0.9} 43. Kf1 {+11.22/10 1.0} Kc7 {-79.86/16 1.3} 44. Kf2
{+11.20/9 1.0} Kc6 {-0.01/28 0.1} 45. Qe4+ {+11.21/10 1.0} Kd6
{-0.01/28 0.1} 46. Qb4+ {+11.20/9 1.0} Kc6 {-79.87/15 0.9} 47. Kf1
{+11.20/9 0.9} Kd7 {-79.86/16 1.4} 48. Qb1 {+11.20/9 0.9} Kc7
{-0.01/28 0.2} 49. Qb4 {+11.19/10 0.9} Kd7 {-0.01/28 0.2} 50. Kf2
{+11.20/9 0.9} Kc6 {-0.01/28 0.1} 51. Kg3 {+11.20/9 0.9} Kc7
{-79.89/14 1.5} 52. Qc5+ {+11.20/9 0.9} Kb7 {-79.94/15 0.9} 53. Qe7+
{+11.22/10 0.8} Kc6 {-79.87/15 0.8} 54. Qb4 {+11.20/9 0.8} Kc7
{-0.01/28 0.2} 55. Qe7+ {+11.20/10 0.8} Kc6 {-0.01/28 0.2} 56. Kg2
{+11.19/10 0.8} Kd5 {-79.88/15 1.2} 57. Qc7 {+0.00/27 0.8} Ke6
{-79.93/16 1.1} 58. Kg1 {+0.00/199 0.3} Kd5 {-79.92/16 0.9} 59. Kf2
{+0.00/199 0.1}
{Xboard adjudication: 50-move rule} 1/2-1/2
[/pgn]

First find out if special end game evaluation is called or not.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Not reproducible

Post by Henk »

End game evaluation is called. So bug somewhere in that evaluation. Fills psqtable with values distance from corner. Also computes distance between kings. So something wrong there.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Not reproducible

Post by Henk »

Ok. I think I found it. Transposition table was not cleared so it contained old values of positions where special endgame evaluation is not used.
My engine only swiches to other evaluation function at start of the search. Not when bareking situation occurs.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Not reproducible

Post by Henk »

Ok now.

[pgn]
[Event "Computer Chess Game"]
[Site "LAPTOP-1FK7MTIP"]
[Date "2021.07.22"]
[Round "-"]
[White "Skipper_8_17"]
[Black "Fairy-Max 4.8V"]
[Result "1-0"]
[TimeControl "120"]
[FEN "8/7P/8/p7/P7/1k3p2/8/3K4 b - - 0 1"]
[SetUp "1"]

{--------------
. . . . . . . .
. . . . . . . P
. . . . . . . .
p . . . . . . .
P . . . . . . .
. k . . . p . .
. . . . . . . .
. . . K . . . .
black to play
--------------}
1... Kxa4 {-8.22/15 2.3} 2. h8=Q {+9.92/16 2.0} f2 {-8.43/15 2.4} 3. Ke2
{+10.21/14 1.9} Kb3 {-8.42/14 2.2} 4. Qe8 {+10.00/13 1.9} Kb4
{-8.54/15 2.8} 5. Qe4+ {+11.48/13 1.9} Kb5 {-8.54/14 1.6} 6. Qb7+
{+11.64/15 1.8} Kc5 {-8.51/15 2.3} 7. Qa6 {+11.69/16 1.8} a4 {-8.59/15 2.1}
8. Qxa4 {+11.76/16 1.8} Kd5 {-8.70/15 2.5} 9. Kxf2 {+11.79/14 1.8} Kc5
{-9.60/14 1.6} 10. Ke3 {+11.20/14 1.7} Kd5 {-79.92/15 1.7} 11. Qd7+
{+11.22/14 1.7} Kc4 {-79.95/16 1.3} 12. Qc6+ {+11.23/14 1.7} Kb3
{-79.96/19 1.3} 13. Kd3 {+327.59/16 1.6} Kb2 {-79.97/28 0.6} 14. Qb7+
{+327.61/16 1.6} Kc1 {-79.98/28 0.2} 15. Qb4 {+327.63/17 1.6} Kd1
{-79.99/28 0.2} 16. Qb1# {+327.65/18 1.6}
{Xboard adjudication: Checkmate} 1-0
[/pgn]