Basics

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

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

Re: Basics

Post by Henk »

Already found something. At ply 1 position history was not good updated. But I am not sure if it works fine now.
Henk
Posts: 7210
Joined: Mon May 27, 2013 10:31 am

Re: Basics

Post by Henk »

No three fold repetition. Just bad end game playing.

[pgn]
[Event "Computer Chess Game"]
[Site "HP"]
[Date "2016.03.20"]
[Round "-"]
[White "Fairy-Max 4.8S"]
[Black "SkipperWinb"]
[Result "1/2-1/2"]
[TimeControl "120"]
[Annotator "1. +0.13 1... -0.09"]

1. d4 {+0.13/8} d5 {-0.09/14 2.5} 2. Be3 {+0.16/8 4} Nc6 {+0.00/13 2.4} 3.
Qc1 {+0.03/8 2.6} Nh6 {+0.08/14 2.3} 4. c3 {+0.02/9 2.2} Ng4 {+0.08/14 2.3}
5. Bg5 {-0.08/9 4} f6 {+0.11/13 2.3} 6. Bd2 {-0.07/10 7} e5 {+0.09/14 2.2}
7. h3 {+0.10/10 3} Nh6 {+0.19/14 2.2} 8. Nf3 {+0.02/9 3} e4 {+0.20/12 2.2}
9. Nh4 {-0.20/9 2.3} f5 {+0.39/12 2.1} 10. g3 {-0.13/10 4} Nf7
{+0.23/12 2.1} 11. Ng2 {-0.14/10 3} Be7 {+0.23/13 2.1} 12. Ne3 {-0.08/9 3}
O-O {+0.24/14 2.0} 13. Bg2 {+0.11/9 1.3} b5 {+0.24/12 2.0} 14. Na3
{+0.15/9 1.2} b4 {+0.38/12 1.9} 15. Nb5 {+0.15/9 2.7} Ba6 {+0.81/12 1.9}
16. a4 {+0.05/8 1.0} Bb7 {+0.92/11 1.9} 17. Nxd5 {+0.49/8 1.4} Qxd5
{+0.93/13 1.9} 18. Nxc7 {+0.44/9 1.5} Qc4 {+1.05/12 1.8} 19. Nxa8
{+0.49/9 4} Bxa8 {+0.96/12 1.7} 20. cxb4 {+0.51/9 1.7} Qxc1+ {+0.94/13 1.6}
21. Rxc1 {+0.51/10 1.9} Nxd4 {+0.57/13 2.0} 22. Rc4 {+0.53/9 0.8} Rd8
{+0.57/11 2.0} 23. Rg1 {+0.48/8 1.6} Ne5 {+1.18/12 1.9} 24. Rc7
{-0.47/9 1.4} Bd6 {+1.55/12 1.9} 25. Rc1 {-0.65/10 1.0} Nb3 {+1.58/12 1.9}
26. Bg5 {-0.93/10 1.3} Bxb4+ {+2.16/13 1.8} 27. Kf1 {-1.07/9 1.7} Nxc1
{+2.25/13 1.8} 28. Bxd8 {-1.21/11 1.2} Nc4 {+2.07/15 1.8} 29. Rh1
{-1.34/11 1.6} Nb3 {+2.59/11 1.6} 30. e3 {-1.36/10 1.2} Nxb2 {+2.61/13 1.6}
31. a5 {-1.89/10 1.5} Nxa5 {+2.62/13 1.6} 32. g4 {-1.80/11 1.3} fxg4
{+2.82/12 1.5} 33. hxg4 {-2.06/12 1.6} Nac4 {+2.82/15 1.6} 34. Bh3
{-2.02/11 1.0} a5 {+3.03/11 1.4} 35. g5 {-2.18/10 1.2} Bd5 {+3.24/12 1.4}
36. Bf5 {-2.21/10 1.2} g6 {+3.23/12 1.4} 37. Bh3 {-2.84/11 1.3} Nd2+
{+3.26/12 1.3} 38. Kg2 {-2.39/10 0.6} a4 {+3.33/12 1.3} 39. Rc1
{-2.58/11 1.8} Nbc4 {+3.33/11 1.3} 40. Bg4 {-2.43/10 1.3} a3 {+3.63/12 1.3}
41. Bf6 {-2.56/10 0.6} a2 {+3.63/11 0.8} 42. Rd1 {-2.76/9 0.5} Kf7
{+3.65/10 0.8} 43. Rh1 {-1.74/9 1.6} Nb6 {+2.80/10 0.8} 44. Rxh7+
{-1.44/8 0.5} Ke8 {+2.23/10 0.9} 45. Rh8+ {-1.73/9 1.2} Bf8 {+2.23/10 0.7}
46. Bg7 {-1.74/9 0.5} Kf7 {+2.33/11 0.7} 47. Bf6 {-1.82/9 0.4} Nf3
{+2.40/11 0.7} 48. Rh7+ {-2.02/10 1.1} Ke8 {+2.41/12 0.7} 49. Rh1
{-2.24/10 0.6} Nxg5 {+3.02/11 0.7} 50. Bxg5 {-2.51/10 0.5} Bg7
{+3.40/12 0.7} 51. Bf4 {-2.58/11 0.5} Nc4 {+3.56/11 0.7} 52. Bg3
{-2.54/11 0.9} a1=Q {+3.60/14 0.7} 53. Rxa1 {-2.76/12 0.5} Bxa1
{+2.94/15 0.7} 54. Bh4 {-2.97/11 2.8} Bg7 {+2.99/12 0.7} 55. Bg5
{-2.72/9 0.3} Ne5 {+3.00/14 0.6} 56. Bh3 {-2.80/10 1.4} Bf8 {+2.98/14 0.6}
57. Bf4 {-2.75/10 0.8} Nd3 {+3.01/15 0.6} 58. Bg3 {-2.79/9 0.5} Bg7
{+2.99/12 0.6} 59. Kf1 {-2.72/8 0.4} g5 {+3.01/14 0.6} 60. Bf5
{-2.66/8 0.3} Ne5 {+3.02/13 0.6} 61. Ke2 {-2.78/9 0.4} Kf7 {+3.02/14 0.6}
62. Kd2 {-2.81/10 0.6} Kf6 {+3.02/13 0.6} 63. Bc8 {-2.76/9 0.3} Bf8
{+3.00/14 0.6} 64. Kc3 {-2.64/9 0.3} Bc5 {+3.00/14 0.6} 65. Bh3
{-2.57/9 0.3} Bb7 {+2.99/12 0.6} 66. Bf1 {-2.74/8 0.3} Ke6 {+3.00/13 0.6}
67. Bh3+ {-2.66/9 0.3} Kd6 {+3.00/13 0.6} 68. Bg4 {-2.66/9 0.3} Bd5
{+2.96/14 0.5} 69. Bf5 {-2.61/10 0.5} Ba8 {+2.97/13 0.5} 70. Kb3
{-2.88/10 0.6} Bb7 {+2.98/14 0.6} 71. Kc2 {-2.76/10 0.5} Kd5 {+2.99/14 0.5}
72. Kc3 {-2.74/9 0.3} Be7 {+2.99/13 0.5} 73. Kd2 {-2.77/9 0.3} Bb4+
{+2.99/12 0.5} 74. Kc2 {-2.81/9 0.3} Ba6 {+2.99/13 0.5} 75. Kd1
{-2.85/9 0.2} Bc5 {+2.99/13 0.5} 76. Kd2 {-2.75/9 0.3} Be7 {+2.99/12 0.5}
77. Kc3 {-2.81/9 0.3} Bd6 {+2.99/14 0.5} 78. Kc2 {-2.82/10 0.5} Nc4
{+2.97/13 0.5} 79. Bxd6 {-2.75/10 0.3} Nxd6 {+2.88/13 0.6} 80. Bg4
{-2.78/11 0.7} Nc4 {+2.95/14 0.4} 81. Kd1 {-2.80/11 0.7} Ne5 {+2.96/17 0.4}
82. Bf5 {-2.76/11 0.4} g4 {+2.99/13 0.4} 83. Kd2 {-2.79/11 0.4} Nd3
{+2.98/12 0.4} 84. Ke2 {-2.78/10 0.2} Kd6 {+2.99/12 0.4} 85. Kf1
{-2.77/11 0.3} Ne5+ {+2.99/14 0.4} 86. Kg2 {-2.73/11 0.3} Kd5
{+2.97/16 0.4} 87. Kg3 {-2.72/11 0.3} Be2 {+2.97/17 0.4} 88. Kf4
{-2.69/11 0.4} Nd3+ {+2.97/16 0.4} 89. Kg3 {-2.77/12 0.4} Bf3
{+2.97/16 0.4} 90. Bxg4 {-2.66/12 0.2} Bxg4 {+2.94/18 0.4} 91. Kxg4
{-3.25/14 0.2} Nxf2+ {+2.94/19 0.4} 92. Kg3 {-3.95/16 0.2} Nd1
{+3.74/19 0.3} 93. Kf4 {-4.63/16 0.2} Nc3 {+3.90/18 0.3} 94. Kf5
{-4.69/15 0.2} Kc4 {+3.92/17 0.3} 95. Ke5 {-11.01/15 0.2} Kd3
{+4.13/17 0.3} 96. Kf4 {-11.11/15 0.3} Ne2+ {+10.74/18 0.3} 97. Kf5
{-11.11/14 0.2} Kxe3 {+10.74/17 0.3} 98. Kg4 {-11.14/14 0.2} Kd2
{+10.74/15 0.3} 99. Kh4 {-11.15/14 0.2} e3 {+10.97/15 0.3} 100. Kg5
{-11.12/14 0.2} Nc3 {+10.97/13 0.3} 101. Kg4 {-11.16/12 0.2} e2
{+10.98/11 0.3} 102. Kf4 {-11.23/11 0.2} e1=Q {+10.98/10 0.3} 103. Kf5
{-11.37/10 0.2} Qf1+ {+10.98/7 0.3} 104. Ke6 {-11.38/10 0.2} Qh3+
{+10.98/7 0.3} 105. Kf6 {-11.37/10 0.2} Qf3+ {+10.98/7 0.3} 106. Ke6
{-11.38/10 0.1} Qg4+ {+10.98/7 0.3} 107. Kf6 {-11.39/10 0.3} Qh4+
{+10.98/7 0.2} 108. Ke5 {-11.37/10 0.2} Qh8+ {+10.98/7 0.2} 109. Kf5
{-11.36/10 0.2} Qc8+ {+10.98/8 0.2} 110. Ke5 {-11.36/10 0.2} Qc5+
{+10.98/7 0.3} 111. Kf6 {-11.41/10 0.1} Qf8+ {+10.98/7 0.3} 112. Ke6
{-11.40/10 0.2} Qh6+ {+10.98/8 0.2} 113. Ke7 {-11.46/11 0.7} Qg5+
{+10.98/7 0.2} 114. Kd6 {-11.43/10 0.1} Qf6+ {+10.98/6 0.2} 115. Kc7
{-11.51/9 0.1} Nd5+ {+10.98/6 0.2} 116. Kd7 {-79.96/10 0.2} Qe7+
{+10.13/7 0.2} 117. Kc6 {-79.96/10 0.1} Qe5 {+10.13/7 0.2} 118. Kc5
{-11.43/9 0.1} Nc3+ {+10.13/6 0.2} 119. Kc6 {-79.95/10 0.2} Ne4
{+10.13/7 0.2} 120. Kd7 {-11.41/9 0.2} Nc3 {+0.00/7 0.2} 121. Kc6
{-0.01/28 0.2} Nd1 {+10.10/7 0.2} 122. Kd7 {-11.42/10 0.2} Ne3
{+10.12/6 0.2} 123. Kc6 {-11.42/9 0.2} Ng4 {+10.12/7 0.2} 124. Kb6
{-11.41/10 0.2} Qb2+ {+10.12/7 0.2} 125. Kc5 {-11.30/10 0.2} Ne3
{+10.16/8 0.2} 126. Kd6 {-11.37/9 0.2} Nf5+ {+10.16/6 0.2} 127. Ke6
{-11.30/10 0.2} Nd4+ {+10.16/5 0.2} 128. Ke5 {-11.31/9 0.2} Kd3
{+10.16/6 0.2} 129. Kf6 {-11.32/9 0.1} Ke3 {+10.16/5 0.2} 130. Kg6
{-11.31/9 0.1} Qg2+ {+10.16/6 0.2} 131. Kf6 {-11.30/9 0.2} Kd2
{+10.16/6 0.2} 132. Ke5 {-11.29/10 0.1} Kd3 {+10.16/7 0.2} 133. Kf6
{-11.32/9 0.1} Ke3 {+10.16/6 0.2} 134. Kf7 {-11.31/9 0.1} Kd2
{+10.16/6 0.2} 135. Kf6 {-11.30/10 0.1} Qf2+ {+10.77/6 0.2} 136. Ke5
{-11.36/10 0.2} Kd3 {+10.16/6 0.4} 137. Kd6 {-11.37/9 0.1} Ke3
{+10.16/5 0.2} 138. Kd7 {-11.33/8 0.1} Kd2 {+10.16/6 0.2} 139. Kd6
{-11.35/9 0.1} Kd3 {+10.16/6 0.2} 140. Ke7 {-11.35/9 0.1} Qd2
{+10.16/6 0.3} 141. Kf6 {-11.34/8 0.1} Ke3 {+10.16/5 0.2} 142. Ke7
{-11.31/8 0.1} Qc2 {+10.16/7 0.2} 143. Kf7 {-11.31/8 0.1} Kd2
{+10.16/6 0.2} 144. Ke7 {-11.34/8 0.1} Kd3 {+10.16/5 0.1} 145. Kf6
{-11.30/8 0.1} Qg2 {+10.16/6 0.2} 146. Ke7 {-11.35/8 0.2} Qe2+
{+10.16/6 0.1} 147. Kd7 {-11.34/8 0.1} Ke3 {+10.16/6 0.1} 148. Ke7
{-11.32/8 0.1} Kd2+ {+10.16/5 0.1} 149. Kf6 {-11.32/9 0.1} Qe6+
{+10.76/5 0.2} 150. Kg5 {-11.36/8 0.1} Nf3+ {+10.98/6 0.3} 151. Kf4
{-11.35/7 0.2} Qe3+ {+10.13/6 0.1} 152. Kg4 {-11.33/7 0.2} Ne5+
{+10.13/6 0.1}
{Xboard adjudication: 50-move rule} 1/2-1/2
[/pgn]
User avatar
hgm
Posts: 27701
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Basics

Post by hgm »

It does look like Skipper is not aware that a King should better be centralized in the end-game, and consequently that the enemy King should better be driven into a corner. I remember that my first Chess program, which could only seach 3 ply ahead, had no problem at all driving a bare King to the corner when it had a Queen. In fact, to my dismay, it immediately stalemated it in the corner. Even though I was convinced I had programmed stalemate to be a draw. But because I had been a bit lazy I was testing with just white Q and black K on the board. And it turned out that being a King behind was no compensaton for being a Queen ahead. So it thought that a draw was a very good deal! :lol:

When I really played KQK it would left the bare King two squares breathing space in the corner, and then wander amlessly around with its own King in the center, where it would earn most PST points, as the mate at 3 ply was of course far beyond its horizon. So I added a term in the evaluation that penalized the distance between the Kings. This would draw the attacking King towards the corner where the bare King was trapped, so that mate-in-1 would come within the horizon. This was enough to make KQK a certain win.

In general mating a bare King can still be a problem when the mate can be far away, and it requires many pieces that themselves draw towards the center. The worst I have seen is KFFFK, where you need the King and all Ferzes to move to the corner where the bare King is trapped in order to get the mate in view even with search depth 10. So the latest Fairy-Max actually does have special code to recognize a bare King, and multiply its centralization weight by 5, so that it considers keeping the bare King in the corner more important even than keeping 4 pieces in the center. This is still problematic, however, because it could be able to confine the bare King in the corner with only two pieces, once it is there, and then move the other two pieces away from it, to the center. So attracting all pieces to the bare King works better.
kbhearn
Posts: 411
Joined: Thu Dec 30, 2010 4:48 am

Re: Basics

Post by kbhearn »

hgm wrote:It does look like Skipper is not aware that a King should better be centralized in the end-game, and consequently that the enemy King should better be driven into a corner. I remember that my first Chess program, which could only seach 3 ply ahead, had no problem at all driving a bare King to the corner when it had a Queen. In fact, to my dismay, it immediately stalemated it in the corner. Even though I was convinced I had programmed stalemate to be a draw. But because I had been a bit lazy I was testing with just white Q and black K on the board. And it turned out that being a King behind was no compensaton for being a Queen ahead. So it thought that a draw was a very good deal! :lol:
That was my first thought when looking at the game as well but it's also odd that skipper also doesn't want to make a second queen. It clearly knew to run one pawn all the way down the board for the queen, but it prefers no progress checks to advancing another pawn after that which left me wondering if it was something like a value-wrapping problem that being up a queen and a few pawns was so good that getting any more advantage would push it negative.
User avatar
hgm
Posts: 27701
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Basics

Post by hgm »

If we are talking about the same game Skipper did not advance that other Pawn because it was actually a Knight.
kbhearn
Posts: 411
Joined: Thu Dec 30, 2010 4:48 am

Re: Basics

Post by kbhearn »

yup was thinking of a different game posted in a different branch of this thread where skipper had Q+3P and neither centralised the king nor pushed any of the 3 pawns.
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Basics

Post by Daniel Anulliero »

kbhearn wrote:yup was thinking of a different game posted in a different branch of this thread where skipper had Q+3P and neither centralised the king nor pushed any of the 3 pawns.
I remember in the biginning of my expérience in chess programming , my first engine would never promote his pawns , because an overflow occurred ... the value of the position was outside the alfa - beta window 😊
Good old time 😊
Henk
Posts: 7210
Joined: Mon May 27, 2013 10:31 am

Re: Basics

Post by Henk »

Week ago I tested if a pawn was on an open file. (Not half open file.)
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Basics

Post by Daniel Anulliero »

Henk wrote:Week ago I tested if a pawn was on an open file. (Not half open file.)
Lol you guy are very funny !😅😅😅
A pawn on an open file ?
An open file is a file without pawns lol 😉