Shogi engine invalid moves (Dan and HGM)

Discussion of chess software programming and technical issues.

Moderator: Ras

Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Shogi engine invalid moves (Dan and HGM)

Post by Ferdy »

While developing a shogi engine, winboard reported invalid moves by Shokidoki and Nebiyu.
I also tested TJShogi and winboard has not found any problem with it.

(1) Shokidoki, unclear notation.
Debug:

Code: Select all

11850099 <second: # start search
11850099 <second: # eval=29
11850099 <second:  1   5692      0        218 N@g;! h7i6+ eval = 46.68 (dif = 1128 cor=29)
11850099 <second:  2   5500      0        656 N@g;! R@f1
11850100 <second:  3   5380      0       6927 N@g;! R@f8 R@f7
11850125 <second:  4   5392      1      55213 N@g;! R@f8 S@e7 f9g9
11850462 <second:  5   5312     35     786340 N@g;! R@f8 f8g6 g8f8 g6f4 h7i6+
11850462 <second: # stop iterating (1:1010), time=359, tl=69, id=5 md=63 abort=0
11850462 <second: move N@g;
Impossible move f8f9, type = 35
GameEnds(25, Xboard: Forfeit due to invalid move: N@g; (_1_1) res=35, 4)
Game:

Code: Select all

[Event "Computer Chess Game"]
[Site "INTEL-PC"]
[Date "2013.11.10"]
[Round "143"]
[White "Siyam v0.16"]
[Black "Shokidoki Yokohama 2013"]
[Result "1-0"]
[TimeControl "40/300"]
[Variant "shogi"]
[Annotator "4. +0.00   4... +0.12"]

1. c4 g6 2. h4 f6 3. Sf2 Rf8 4. b4 {+0.00/12} Kd8 {+0.12/8 4:55} 5. a4
{+0.00/12 9} f5 {+0.56/7} 6. Bxh8= {+0.00/10 9} Sxh8 {+0.76/6 0.1} 7. B@d5
{+2.00/9 8} Ng7 {+0.92/5} 8. Bxb7+ {+2.00/9 8} B@e5 {+0.68/5} 9. La3
{+2.00/12 8} Ba1+ {+0.08/6} 10. Sc2 {+2.00/12 8} +Be5 {-0.40/7 0.1} 11. b5
{+2.00/11 8} Gc8 {+0.92/7} 12. +Bb6 {+2.00/10 8} f4 {+0.96/6} 13. fxf4
{+2.00/11 10} Rxf4 {+0.92/6 0.1} 14. +Bc5 {+2.00/10 7} P@f3 {+0.96/6 0.1}
15. Sg1 {+2.00/11 7} Sg9 {+0.56/5 0.1} 16. P@f2 {+2.00/10 8} Sf8 {+1.96/1}
17. h5 {+2.00/10 8} +Be6 {+1.16/2} 18. h6 {+2.00/10 8} hxh6 {+1.60/3} 19.
Rxh6 {+2.00/10 8} P@b2 {+0.96/4 0.1} 20. Rh8+ {+12.00/8 8} fxf2+
{-0.40/5 0.1} 21. Gxf2 {+11.00/8 8} bxb1+ {-0.20/6 0.1} 22. P@f3
{+9.00/7 8} Rxc4 {+1.88/7 0.2} 23. +Bxc4 {+13.00/8 8} +Bxc4 {+1.04/6 0.1}
24. +Rxi9 {+9.00/7 8} Ge9 {+1.76/5 0.2} 25. R@i4 {+11.00/5 8} +Ba2
{+3.36/5 0.1} 26. L@b6 {+5.00/6 8} +Pb2 {+3.80/6 0.1} 27. Sb1 {+5.00/7 8}
+Bxb1 {+6.80/5 0.1} 28. Lxb9+ {+2.00/7 8} +Pc2 {+5.76/5 0.2} 29. Kf1
{-1.00/6 8} B@h3 {+13.28/5 0.1} 30. Sg2 {-5.00/8 8} Bxi4+ {+13.32/4} 31.
ixi4 {-5.00/6 8} +Pxd1 {+13.92/4} 32. Kg1 {-6.00/5 8} R@e1 {+13.72/3} 33.
Gf1 {-2.00/6 8} Rxe3+ {+14.80/4 0.1} 34. B@c5 {-4.00/5 8} +Re5
{+15.84/5 0.2} 35. Bd4 {-12.00/6 8} +Rh5 {+16.12/5 0.2} 36. P@h4
{-2.00/5 8} +Rxb5 {+15.84/5 0.2} 37. P@e8 {-8.00/6 8} Gxe8 {+18.04/5 0.2}
38. N@b6 {+0.00/6 8} N@d9 {+18.16/3} 39. Nxc8+ {-11.00/7 8} Sxc8 {+19.36/5}
40. +Lxa9 {-11.00/6 10} +Rb4 {+19.60/5 0.2} 41. L@f6 {-8.00/6 7} +Bxd3
{+21.44/4} 42. Bxa7+ {-6.00/6 7} P@h3 {+21.56/4 0.2} 43. Sxh3 {-2.00/5 7}
N@e3 {+19.52/5 0.5} 44. Gf2 {-2.00/6 7} G@f1 {+20.44/5 0.1} 45. Kh2
{-5.00/6 7} S@g1 {+17.88/5 0.1} 46. Ki3 {+11.00/7 7} Sxf2+ {+13.64/6 0.1}
47. Lxf8+ {+11.00/6 7} Gxf8 {+13.60/4} 48. S@e9 {+11.00/5 7} Ke8 {+0.00/1}
49. G@d8 {+11.00/5 7} Kf7 {+0.00/1} 50. Sxf8+ {+11.00/6 7} Kxf8
{+10.24/5 0.1} 51. G@e8 {+11.00/5 7} Kf7 {+10.52/5 0.1} 52. +Rf9
{+11.00/6 7} Ke6 {+9.68/5 0.1} 53. Gxc8 {+12.00/6 7} +Rxa3 {+10.00/4 0.1}
54. +Bc5 {+21.00/5 7} +Rxa4 {+6.28/4 0.1} 55. S@d5 {+24.00/5 7} Ke5
{+0.00/1} 56. P@e4 {+26.00/6 7} +Rxe4 {+5.84/5 0.1} 57. Sxe4 {+27.00/6 7}
+Bxe4 {+3.80/5 0.3} 58. R@f7 {+26.00/4 7} G@f5 {+5.08/4 0.1} 59. +Rxd9
{+29.00/6 7} S@f6 {+4.40/3 0.1} 60. +Rxd7 {+35.00/5 7} +Sxf3 {+3.00/2} 61.
+Rd6 {+39.00/5 7} Kf4 {+0.00/1} 62. Rxf6+ {+41.00/5 7} +Sxg3 {+3.08/3} 63.
Nxg3 {+56.00/5 7} Kxg3 {-3.12/4} 64. P@g2 {+58.00/4 7} Kf2 {-2.16/4} 65.
+Rxg7 {+58.00/5 7} P@d3 {-3.24/3} 66. +Rgxg6 {+60.00/4 7} d2+ {-2.04/3} 67.
S@d5 {+83.00/5 7} +Be5 {-2.04/3} 68. +Rxe5 {+97.00/5 7} Gxe5 {-11.60/5 0.1}
69. +Rg3 {+97.00/5 7} Ke1 {-11.36/6 0.2} 70. +Rxe3 {+97.00/4 7} +Pe2
{-12.12/6 0.4} 71. +Rxe5 {+98.00/5 7} Gf2 {-11.80/4 0.2} 72. S@g3
{+103.00/4 7} Gf3 {-11.52/4 0.2} 73. B@f2 {+101.00/5 7} Kd2 {-10.44/4} 74.
+Bb4 {+99.00/5 7} Kc1 {-9.12/4 0.1} 75. Bd4 {+99.00/5 7} S@e3 {-9.52/4 0.2}
76. +Ba3 {+299.91/5 7} Kd2 {-10.68/5 0.2} 77. +Bb4 {+299.91/5 7} Kc1
{-10.48/5 0.2} 78. Ba7+ {+99.00/5 7} Gxg3 {-9.48/4 0.3} 79. gxg3
{+102.00/5 7} R@f1 {-9.56/4 0.2} 80. G@i2 {+102.00/5 10} Rf3+ {-8.96/4 0.4}
81. G@g2 {+103.00/5 7} +Rf7 {-9.80/4 0.1} 82. +Bxe7 {+104.00/5 7} +Rg6
{-11.40/5 0.2} 83. P@f6 {+105.00/5 7} S@f4 {-10.40/4 0.1} 84. +Rd6
{+105.00/6 7} Sxg3+ {-10.72/3 0.1} 85. Gxg3 {+111.00/6 7} +Rxg3 {-10.64/3}
86. f7+ {+111.00/4 7} P@e9 {-11.92/3 0.2} 87. +Rxc7 {+112.00/5 7} P@c2
{-12.88/4 0.1} 88. S@h2 {+111.00/5 7} +Rf2 {-11.56/4 0.1} 89. Gxe9
{+114.00/6 7} P@g3 {-11.52/4 0.1} 90. N@h5 {+115.00/5 7} g2+ {-8.28/2} 91.
+Ba3 {+125.00/5 7} Kd2 {-8.44/3} 92. +Bb4 {+125.00/5 7} Kc1 {-7.76/4} 93.
+Ba4 {+117.00/5 7} +Pdd2 {-6.32/4} 94. +Ba3 {+115.00/5 7} Kd1 {-5.64/4 0.1}
95. P@f1 {+111.00/5 7} +Rxf1 {-2.84/4 0.1} 96. Sg1 {+104.00/5 7} +Rxg1
{+1.56/4 0.1} 97. Sxg2 {+87.00/5 7} +Rxg2 {+3.68/4 0.2} 98. P@d3
{+82.00/5 7} +Pxd3 {+6.32/2} 99. +Bd6 {+80.00/5 7} N@g4 {+6.60/2} 100.
Nxi7+ {+82.00/5 7} Sd4+ {+7.52/2} 101. Se6 {+82.00/5 7} P@e4 {+6.56/3 0.1}
102. P@g6 {+83.00/5 7} e3+ {+7.88/3} 103. g7+ {+106.00/5 7} c1+ {+8.00/2}
104. P@d7 {+120.00/5 7} L@g3 {+8.32/3 0.1} 105. i5 {+118.00/5 7} S@h2
{+8.64/3 0.1} 106. Ki4 {+122.00/6 7} Sxi1= {+11.24/3 0.1} 107. Gxi1
{+122.00/5 7} P@a8 {+7.68/3 0.1} 108. +Bxa8 {+125.00/5 7} +Se4
{+4.44/3 0.1} 109. d8+ {+134.00/5 7} P@h3 {+4.00/2} 110. +Ba3 {+143.00/5 7}
+Pdd2 {+4.48/3} 111. S@h1 {+139.00/5 7} +Rg1 {+3.60/4 0.5} 112. +Ba4
{+138.00/5 7} Ke1 {+4.20/4 0.2} 113. Sd5 {+134.00/5 7} +Sf4 {+5.56/4 0.3}
114. +Rc4 {+137.00/6 7} +Pf3 {+6.48/3 0.1} 115. Se6 {+133.00/5 7} h2+
{+9.64/3 0.1} 116. P@g2 {+132.00/5 7} S@h3 {+11.40/2} 117. Kh5
{+137.00/6 7} +Pxi1 {+8.84/2 0.1} 118. gxg3 {+130.00/5 7} +Pxh1
{+8.80/4 0.1} 119. gxg4 {+137.00/5 7} G@d6 {+7.88/4 0.8} 120. Sd7+
{+139.00/5 10} S@c5 {+9.96/3 0.1} 121. +Rb5 {+139.00/5 7} G@b6 {+6.76/2}
122. +Rxb6 {+143.00/6 7} Sxb6 {+5.48/4 0.1} 123. +Sxd6 {+143.00/4 7} R@a6
{+4.32/3 0.1} 124. +Bd7 {+143.00/5 7} Sc5 {+1.12/3} 125. +Sc6 {+144.00/5 7}
+Pcd1 {+1.32/3} 126. G@a7 {+157.00/5 7} Ra5 {+4.24/3} 127. N@b3
{+158.00/5 7} Ra3+ {+0.96/4 0.1} 128. Nxc5 {+158.00/5 7} +Ph2 {-1.04/4 0.1}
129. Nb7+ {+162.00/5 7} Sxg4+ {+1.76/4 0.1} 130. N@g6 {+162.00/5 7} +Ph3
{+3.84/4 0.1} 131. Nf8+ {+164.00/5 7} P@i8 {+3.48/4 0.1} 132. +Nxi8
{+166.00/5 7} P@i9 {+2.40/4 0.1} 133. +Nxi9 {+168.00/5 7} +Pxh4
{-0.32/4 0.1} 134. Kg6 {+166.00/6 7} +Ra5 {-0.96/5 0.2} 135. L@c5
{+168.00/5 7} P@i4 {+0.36/5 0.2} 136. S@b6 {+169.00/5 7} +Rb4 {+1.20/6 0.2}
137. P@h8 {+168.00/6 7} i3+ {+1.68/6 0.1} 138. P@b3 {+190.00/6 7} +Rxb3
{+3.28/6 0.1} 139. h9+ {+189.00/6 7} +Pii4 {+3.88/5 0.1} 140. P@e7
{+190.00/6 7} +Pxi5 {+2.80/5 0.2} 141. e8+ {+199.00/6 7} P@a4 {+2.52/5 0.1}
142. Sc7+ {+200.00/6 7} a3+ {+3.04/6 0.1} 143. P@h6 {+213.00/6 7} +Pa4
{+5.40/5 0.1} 144. h7+ {+224.00/6 7} +Pih5 {+6.80/5 0.2} 145. Kf6
{+213.00/6 7} +Pb4 {+4.64/6 0.3} 146. +Be6 {+217.00/6 7} +Rc2 {+6.28/6 0.2}
147. +Be5 {+214.00/6 7} +Pc4 {+7.80/6 0.2} 148. G@b2 {+214.00/6 7} +Rc1
{+11.52/4} 149. +Pgg8 {+209.00/6 7} +Pxc5 {+14.08/6 0.1} 150. +Sd6
{+203.00/7 7} L@d4 {+14.88/6 0.2} 151. Gb3 {+198.00/7 7} +Rc2
{+13.36/6 0.2} 152. Ga4 {+198.00/7 7} +Rb3 {+15.20/6 0.1} 153. Ga5
{+198.00/7 7} +Re3 {+13.72/6 0.2} 154. +Se7 {+200.00/6 7} +Sg5
{+18.12/5 0.1} 155. +Pfg7 {+186.00/7 7} +Sgf5 {+27.88/6 0.4} 156. Kf7
{+171.00/8 7} +Rxe5 {+27.36/6 0.3} 157. +Se6 {+171.00/6 7} B@b3
{+29.72/6 0.3} 158. +Pe7 {+164.00/8 7} +Sf6 {+29.60/6 0.2} 159. Ke8
{+171.00/2} +Sxe6 {+29.12/6 0.4} 160. +Sd7 {+164.00/7 15} +Pb5
{+29.28/5 0.2} 161. N@a1 {+158.00/7 7} Bc2+ {+30.56/3} 162. +Pxe6
{+159.00/7 7} +Rxe6 {+30.24/4} 163. +Se7 {+153.00/7 7} +Rf5 {+30.04/5 0.1}
164. G5a6 {+155.00/7 7} Ld3+ {+31.00/4} 165. S@e6 {+155.00/6 7} +Rfg5
{+30.80/5 0.1} 166. +Pg6 {+152.00/7 7} +Rxg6 {+33.84/4} 167. +Phg7
{+149.00/7 7} +R6g5 {+34.24/6 0.2} 168. +Pg6 {+138.00/7 7} +Rxg6
{+37.72/6 0.2} 169. Sf7= {+138.00/7 7} +R6g5 {+38.92/5 0.1} 170. Se6+
{+123.00/8 7} +Bb2 {+39.60/6 0.2} 171. +Bb8 {+118.00/8 7} +Bxa1
{+40.28/6 0.2} 172. Gb9 {+118.00/8 7} S@f5 {+42.32/5 0.2} 173. +Sd6
{+117.00/8 9} +Be5 {+43.12/5 0.1} 174. +Sdd7 {+118.00/9 7} Se6
{+42.04/6 0.5} 175. +Sxe6 {+128.00/8 6} +Bxe6 {+43.24/4} 176. S@f7
{+128.00/7 7} +Bf5 {+45.16/3} 177. +Bd6 {+117.00/7 7} +Rf6 {+44.80/4 0.1}
178. +Be7 {+121.00/7 7} +Ri6 {+44.00/5 0.2} 179. +Sd6 {+117.00/8 7} S@f6
{+43.96/4 0.2} 180. +Bd7 {+117.00/9 7} Se5 {+43.56/3} 181. +Bxf5
{+126.00/7 8} +Sxf5 {+44.00/4} 182. B@c8 {+126.00/6 8} +Pg5 {+43.76/5 0.3}
183. +Se6 {+117.00/8 8} B@b2 {+44.16/4 0.1} 184. Bd7+ {+117.00/8 8} +Pc5
{+43.68/4 0.1} 185. +Pgh8 {+128.00/7 8} +Pd5 {+45.52/4 0.1} 186. +Sxe5
{+128.00/8 8} Bxe5+ {+44.00/6 0.9} 187. S@h7 {+128.00/7 8} +Rf6 {+48.16/3}
188. Sfg8+ {+128.00/7 6} +Pd6 {+49.00/4 0.1} 189. +Be7 {+119.00/7 8} +Rxe7
{+50.64/1} 190. Kxe7 {+119.00/6 8} B@c6 {+51.40/3} 191. +Ne8 {+120.00/7 7}
+Pe6 {+48.52/3} 192. Kf8 {+121.00/7 8} +Bd6 {+51.84/4} 193. Kf9
{+108.00/8 8}
{Xboard: Forfeit due to invalid move: N@g; (_1_1) res=35} 1-0
(2) Nebiyu, dropping a Lance at 1st rank by black is illegal.
Debug:

Code: Select all

1598706 <second: setup l2gkg2O/4g1s2/p2ppp1pp/1pNl2p2/P1pN5/1P1KS1P2/2G1S2PP/1uP6/LN1h1h2R[pppNl] b - - 0 40
1598706 <second: [search_time = 90ms, max_time = 90ms , moves_left 1, max_nodes 0]
1598706 <second: 3 1642 0 1466  d6d5  d4d5  l@f6 EBF=11.01
1598706 <second: 4 1830 0 10808  d6d5  d4d5  n@g1 L@d8 d9d8  c6d8+ e9d8  EBF=9.93
1598706 <second: 5 1830 0 23287  d6d5  d4d5  n@g1 L@d8 d9d8  c6d8+ e9d8  EBF=7.25
1598722 <second: 6 1830 1 29880  d6d5  d4d5  n@g1 L@d8 d9d8  c6d8+ e9d8  EBF=5.38
1598753 <second: 6 1912 4 73316  l@g1 b1a3  d6d5  e4d5  b2a1  d4c5  d1g4  i9i7  EBF=6.29
1598769 <second: 7 1942 6 99739  l@g1 N@c7 d6d5  d4d5  b2b1  c7d9+ e9d9  EBF=5.02
1598784 <second: 8 1810 7 129495  l@g1 N@c7 d6d5  d4d5  b2b1  c7d9+ e9d9  c6b8+ b1a1  b8a9  d1g4  d5c5  EBF=4.21
1598847 <second: nodes = 230197 <97 qnodes> time = 141ms nps = 1632602
1598847 <second: splits = 0 badsplits = 0
1598847 <second: move L@g1
LegalDrop: 26 @ 8,0)
Off-board move (-19,15)-(8,0) , type = 23
GameEnds(25, Xboard: Forfeit due to invalid move: L@g1 (_1_1) res=23, 4)
Game:

Code: Select all

[Event "Computer Chess Game"]
[Site "INTEL-PC"]
[Date "2013.11.09"]
[Round "24"]
[White "Siyam v0.12"]
[Black "NebiyuAlien_1.45"]
[Result "1-0"]
[TimeControl "40/300"]
[Variant "shogi"]
[Annotator "4. +0.00   4... +0.40"]

1. c4 b6 2. Sd2 g6 3. d4 Sd8 4. Sc3 {+0.00/12} Ng7 {+0.40/9 4:55} 5. d5
{+0.00/13 7} Gfe8 {+0.38/9 0.1} 6. c5 {+0.00/13 8} Rc8 {+0.56/9 0.1} 7. b4
{+0.00/11 9} c6 {+0.96/12 0.1} 8. cxc6 {+0.00/9 8} Rxc6 {+1.08/11 0.1} 9.
P@c2 {+0.00/9 8} Rc5 {+1.58/9 0.1} 10. Sd4 {+0.00/8 8} Rc4 {+0.56/10 0.1}
11. Sc3 {+0.00/9 8} Rc7 {+0.52/10 0.1} 12. a4 {+0.00/10 8} P@c5
{+0.64/8 0.1} 13. a5 {+0.00/10 8} Rc6 {+0.82/9 0.1} 14. g4 {+0.00/10 8} Nc7
{+1.08/8 0.1} 15. Sd4 {+0.00/10 8} Nf5 {+1.34/9 0.1} 16. Sf2 {+0.00/8 8}
Nxd5 {+2.46/7 0.1} 17. Gc1 {+4.00/7 8} Ndxe3+ {+0.70/9 0.1} 18. Sfxe3
{+4.00/7 8} Nxe3+ {+7.68/12 0.1} 19. Sxe3 {+4.00/5 8} Bxb2+ {+8.12/11 0.1}
20. Gxb2 {-6.00/5 8} B@e5 {+7.20/10 0.1} 21. N@d4 {-6.00/5 8} Bxh2+
{+5.90/9 0.1} 22. Nxc6 {-4.00/4 8} R@c1 {+5.80/8 0.2} 23. N@d1 {-4.00/5 8}
+Bxi1 {+4.88/8 0.2} 24. B@d2 {+2.00/4 8} +Bxh1 {+4.30/9 0.1} 25. Nxd8+
{-2.00/4 8} Kxd8 {+8.44/9 0.1} 26. Bxc1 {-2.00/4 8} N@d3 {+9.92/10 0.1} 27.
Kd2 {-4.00/5 8} Nxc1+ {+13.50/9 0.1} 28. Kxc1 {-8.00/3 8} N@d3
{+14.12/9 0.1} 29. Kd2 {-4.00/2} S@c1 {+14.22/9 0.1} 30. Kxd3 {-9.00/5 9}
B@c4 {+13.30/7 0.1} 31. Kd4 {-9.00/4 9} Bxf1+ {+14.58/8 0.1} 32. N@c6
{-9.00/3 9} Ke9 {+16.08/7 0.1} 33. R@h9 {-11.00/3 9} G@f9 {+16.24/7 0.1}
34. Gc3 {-10.00/3 9} L@d6 {+16.60/8 0.1} 35. N@d5 {-12.00/5 9} +Bxf3
{+17.12/8 0.1} 36. S@e4 {-12.00/4 9} +Bxd1 {+17.16/8 0.1} 37. Rxi9+
{-13.00/5 9} Sb2+ {+17.48/7 0.1} 38. L@g7 {-11.00/4 9} N@g8 {+15.14/8 0.1}
39. Lxg8+ {-11.00/4 9} Sxg8 {+16.86/8 0.1} 40. R@i1 {-13.00/4 11}
{Xboard: Forfeit due to invalid move: L@g1 (_1_1) res=23} 1-0
(3) Nebiyu, dropping a knight at 1st and 2nd rank by black is illegal.
Debug:

Code: Select all

5909054 <second: setup ln7/1r2gk2U/p1lppps1p/5n3/1pS6/5HP2/PP1PPP1PP/L1R1G1SK1/1hP2G1NL[PPPGn] b - - 1 32
5909054 <second: [search_time = 98ms, max_time = 470ms , moves_left 9, max_nodes 0]
5909054 <second: 3 -1838 0 818  c7c5  c2c5  s@d6 EBF=8.99
5909054 <second: 4 -1872 0 1377  c7c5  c2c5  f6g4  f4g4  b1a2  EBF=5.81
5909054 <second: 5 -1872 0 1733  c7c5  c2c5  f6g4  f4g4  b1a2  EBF=4.21
5909054 <second: 6 -2004 0 14328  c7c5  c2c5  n@c7 L@c6 s@d6 c6c7+ b9c7  EBF=4.74
5909054 <second: 6 -1782 0 17899  n@e6 f4g3  c7c5  c2c5  f6g4  g3g4  b1a2  EBF=4.92
5909069 <second: 7 -1782 1 44946  n@e6 f4g3  c7c5  c2c5  f6g4  g3g4  b1a2  EBF=4.46
5909100 <second: 7 -1702 4 85407  n@b2 c5c6  c7c6  c2b2  b1b2  f4b8  f6g4  EBF=4.90
5909116 <second: 7 -1806 6 91483  n@g6 f4g3  c7c5  c2c5  f6g4  g3g4  b1a2  EBF=4.95
5909116 <second: 7 -1702 6 98117  n@b2 c5c6  c7c6  c2b2  b1b2  f4b8  f6g4  EBF=5.00
5909132 <second: nodes = 124276 <95 qnodes> time = 78ms nps = 1593282
5909132 <second: splits = 0 badsplits = 0
5909132 <second: move N@b2
LegalDrop: 23 @ 3,1)
Off-board move (-17,15)-(3,1) , type = 23
GameEnds(25, Xboard: Forfeit due to invalid move: N@b2 (_1_1) res=23, 4)
Game:

Code: Select all

[Event "Computer Chess Game"]
[Site "INTEL-PC"]
[Date "2013.11.09"]
[Round "92"]
[White "Siyam v0.12"]
[Black "NebiyuAlien_1.45"]
[Result "1-0"]
[TimeControl "40/300"]
[Variant "shogi"]
[Annotator "12. +2.00   12... -2.28"]

1. c4 g6 2. Rd2 Sd8 3. Kf2 Kf8 4. Kg2 Kg8 5. Kh2 b6 6. Sg2 b5 7. Bxh8+ Kxh8
8. Sb2 Li8 9. Sc3 Ki9 10. Rb2 Sh8 11. Gde2 c6 12. B@d5 {+2.00/9} Gde8
{-2.28/10 4:55} 13. Bxc6 {+2.00/11 11} B@f6 {-2.28/9 0.2} 14. g4
{+2.00/10 8} Ng7 {-2.36/10 0.1} 15. c5 {+2.00/9 11} Sc7 {-1.96/9 0.1} 16.
Be4 {+2.00/10 9} Sd6 {-2.12/11 0.2} 17. Bxg6 {+2.00/8 10} Sxc5
{-1.48/10 0.1} 18. Rc2 {+2.00/7 10} h6 {-1.32/8 0.1} 19. La2 {+2.00/7 10}
P@c4 {-0.84/9 0.1} 20. Sxc4 {+2.00/7 10} Ba1+ {-2.14/9 0.1} 21. Sxc5
{+4.00/6 10} +Bxb1 {-2.80/9 0.1} 22. P@c1 {+4.00/5 10} N@f6 {-2.80/7 0.1}
23. S@h7 {+16.00/6 10} Kh9 {-10.62/8 0.1} 24. Sxi8+ {+22.00/7 10} Kg9
{-13.06/10 0.1} 25. L@h7 {+23.00/6 10} Sxh7 {-18.64/10 0.3} 26. Bxh7+
{+23.00/6 10} Kf8 {-19.08/8 0.1} 27. S@h8 {+23.00/5 10} Gg8 {-20.26/8 0.1}
28. Sxg7= {+23.00/6 10} Gxg7 {-18.90/12 0.1} 29. N@g6 {+23.00/5 10} Gxg6
{-18.90/11 0.1} 30. +Bxg6 {+21.00/5 10} L@c7 {-18.90/8 0.1} 31. +Bxh6
{+19.00/4 10} S@g7 {-17.82/8 0.1} 32. +Bf4 {+21.00/5 10}
{Xboard: Forfeit due to invalid move: N@b2 (_1_1) res=23} 1-0
This is Siyam's perft 4, not sure if this is correct? but so far I have not encountered winboard illegal move reports after couple of hundred game tests. Nebiyu's perfts 1 to 3 are the same to that of Siyam's.

Code: Select all

perft 4

9  l n s g k g s n l
8  . r . . . . . b .
7  p p p p p p p p p
6  . . . . . . . . .
5  . . . . . . . . .
4  . . . . . . . . .
3  P P P P P P P P P
2  . B . . . . . R .
1  L N S G K G S N L

   a b c d e f g h i


  a3a4 - 28015
  b3b4 - 25470
  c3c4 - 30406
  d3d4 - 25412
  e3e4 - 25467
  f3f4 - 25470
  g3g4 - 26319
  h3h4 - 26319
  i3i4 - 27168
  a1a2 - 25470
  i1i2 - 23772
  c1c2 - 23772
  c1d2 - 22923
  g1f2 - 20376
  g1g2 - 19527
  d1c2 - 22923
  d1d2 - 22923
  d1e2 - 21225
  f1e2 - 21225
  f1f2 - 21225
  f1g2 - 19527
  h2g2 - 24621
  h2f2 - 23772
  h2e2 - 23772
  h2d2 - 23772
  h2c2 - 24621
  h2i2 - 25470
  e1e2 - 22923
  e1d2 - 23772
  e1f2 - 22074

 Perft 4 Summary
 Count: 719731
User avatar
Ajedrecista
Posts: 2127
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Shogi engine invalid moves (Dan and HGM): perft.

Post by Ajedrecista »

Hello Ferdinand:
Ferdy wrote:This is Siyam's perft 4, not sure if this is correct? but so far I have not encountered winboard illegal move reports after couple of hundred game tests. Nebiyu's perfts 1 to 3 are the same to that of Siyam's.

Code: Select all

perft 4

9  l n s g k g s n l
8  . r . . . . . b .
7  p p p p p p p p p
6  . . . . . . . . .
5  . . . . . . . . .
4  . . . . . . . . .
3  P P P P P P P P P
2  . B . . . . . R .
1  L N S G K G S N L

   a b c d e f g h i


  a3a4 - 28015
  b3b4 - 25470
  c3c4 - 30406
  d3d4 - 25412
  e3e4 - 25467
  f3f4 - 25470
  g3g4 - 26319
  h3h4 - 26319
  i3i4 - 27168
  a1a2 - 25470
  i1i2 - 23772
  c1c2 - 23772
  c1d2 - 22923
  g1f2 - 20376
  g1g2 - 19527
  d1c2 - 22923
  d1d2 - 22923
  d1e2 - 21225
  f1e2 - 21225
  f1f2 - 21225
  f1g2 - 19527
  h2g2 - 24621
  h2f2 - 23772
  h2e2 - 23772
  h2d2 - 23772
  h2c2 - 24621
  h2i2 - 25470
  e1e2 - 22923
  e1d2 - 23772
  e1f2 - 22074

 Perft 4 Summary
 Count: 719731
I did a quick Google searh with the key words 'shogi perft'. I found the following pages:

https://groups.google.com/forum/#!topic ... 7hmtThbk1k

http://www.littlegolem.net/jsp/forum/to ... topic=2087

So Siyam seems to be right. FWIW:

Code: Select all

Shogi perft for the initial position:

Ply 1: 30
Ply 2: 900
Ply 3: 25470
Ply 4: 719731
Ply 5: 19861490
Ply 6: 547581517
Regards from Spain.

Ajedrecista.
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Shogi engine invalid moves (Dan and HGM): perft.

Post by Ferdy »

Code: Select all

Ply 5: 19861490 
Ply 6: 547581517
Thanks a lot, I also get a match on 5 and 6 :D .
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Shogi engine invalid moves (Dan and HGM)

Post by Daniel Shawul »

I didn't implement that rule. The problem is handling shogi in a general game playing engine requires too much special code that I am just glad it plays it at all. For instance, the rule that pawns should not be dropped on occupied file required additional code that I didn't like but was vital for the game. Anyway I will fix it and hopefully it gives siyam a run for its money. I am curious how much eval() will bring to a tactically dominated games such as shogi. TJshogi probably has the most eval among the existing shogi engines of chess programmers.

P.S: Sad news from phillipines, hope you are not affected.

P.P.S: Where the hell is HGM?
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Shogi engine invalid moves (Dan and HGM)

Post by Ferdy »

Daniel Shawul wrote:I didn't implement that rule. The problem is handling shogi in a general game playing engine requires too much special code that I am just glad it plays it at all. For instance, the rule that pawns should not be dropped on occupied file required additional code that I didn't like but was vital for the game. Anyway I will fix it and hopefully it gives siyam a run for its money. I am curious how much eval() will bring to a tactically dominated games such as shogi. TJshogi probably has the most eval among the existing shogi engines of chess programmers.

P.S: Sad news from phillipines, hope you are not affected.

P.P.S: Where the hell is HGM?
It is indeed not that easy to implement all these shogi rules, there is also this illegal pawn drop rule to give
immediate mate, but not for other pieces. Also this 4x repetition of position where the perpetual checker will lose but
draw if no perpetual check but this seldom happens because of drops. Siyam is pretty weak, it only has material in
evaluation so far. First attempt to add some bonus for square control all over empty squares as protection from drops
brings nothing in fact I lose some points. Speed-wise this is expensive and plan to revise this, probably
adding knowledge but gives up speed a little will work.

That was indeed a very nasty typhoon that so far hit us. Our country is regularly hit
by these typhoons. Most natural disasters are probably found here,
volcano erruptions, earth quake, floods and regular typhoons.

We are fortunate this time, we live in a northern part of the country close to the capital,
that typhoon path had passed in the middle part around 500km from our location.
We still experienced strong winds and moderate raining but not that serious.
User avatar
hgm
Posts: 28391
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Shogi engine invalid moves (Dan and HGM)

Post by hgm »

Just got back from a two-week vacation to La Palma!

Thanks for the bug report. I haven't looked at the code yet, but it seems there is a bug in Shokidoki's move generator for check drops. It tries to drop gote's Knight outside the board, to check sente's King on the edge. This seems weird at first, but slightly less so if you realize that Shokidoki uses an 18x12 board internally, where the 11th and 12th rank are used for the holdings. (Note that : and ; are the ASCII characters that follow 9, so N@g; is a drop on the 11th rank.) It probably just looks around from the King position with the inverse stride of any opponent piece, to see if there is an empty square on which it could drop to check, and a Knight jump brings it in the holdings rank (which likely is empty).

Fortunately this cannot happen in mini-Shogi, where the 6th to 9th rank are also inaccesible.

Speaking about mini-Shogi:

Next Sunday (Nov 24) will be the most important computer mini-Shogi tournament of the year in Tokyo, the 7th UEC Cup. It is organized by prof. Takeshi Ito. The past few years Shokidoki and TJshogi5x5 have been participating, and in the 6th UEC Cup they ended 4th and 5th place, respectively. Shokidoki was only one point behing the winner, though, and beat the latter in the direct confrontation. The Yokohama version is significantly stronger, and in my tests Nebiyu performs intermediate to this new Shokidoki and TJshogi5x5.

I think it would be a good idea to ask prof. Takeshi Ito if he would be willing to let Nebiyu participate through an operator (which he would provide), as he does for Shokidoki and TJshogi5x5. If Siyam can also do 5x5 Shogi, I think it should try to particpate as well.

If you are interested, I can give you Takeshi Ito's e-mail address, or give hin your e-mail addresses (although I don't think I have those). I am now preparing a WinBoard + Shokidoki install to send to him by e-mail, and I could easily include other engines, so that he can use the package for all of them.
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Shogi engine invalid moves (Dan and HGM)

Post by Daniel Shawul »

Just got back from a two-week vacation to La Palma!
Welcome back! You do know how to live your life :)

Please ask Prof. Takeshi if he can operate Nebiyu and i presume Siyam as well on our behalfs.
Or I can make a formal request if you PM me his email address.
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Shogi engine invalid moves (Dan and HGM)

Post by Ferdy »

What a nice vacation :) .
Siyam can only play on 9x9. But will try to create 5x5. I hope to make it work by november 22. I will pm my email.
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Shogi engine invalid moves (Dan and HGM)

Post by Ferdy »

Daniel Shawul wrote:
Just got back from a two-week vacation to La Palma!
Welcome back! You do know how to live your life :)

Please ask Prof. Takeshi if he can operate Nebiyu and i presume Siyam as well on our behalfs.
Or I can make a formal request if you PM me his email address.
I am still on it and hope to get a working version to participate.
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Shogi engine/winboard invalid moves (Dan and HGM)

Post by Ferdy »

I am testing my new mini-shogi engine and winboard 4.7.2c is flagging valid move as invalid.
When silver is captured it becomes a pawn, when that engine drops a silver, winboard will claim
that the move is invalid. This is the same for gold.

Sample games.

Code: Select all

[Event "Computer Chess Game"]
[Site "INTEL-PC"]
[Date "2013.11.20"]
[Round "1"]
[White "Lima v0.1"]
[Black "NebiyuAlien_1.45"]
[Result "1-0"]
[TimeControl "40/300"]
[Variant "shogi"]
[FEN "rbsgk/4p/5/P4/KGSBR[-] w 0 1"]
[SetUp "1"]

{--------------
r b s g k
. . . . p
. . . . .
P . . . .
K G S B R
white to play
--------------}
1. Bc2 {+0.00/12} Bc4 {+0.00/21 6} 2. Sd2 {+0.50/12 12} Sb4 {+0.00/22 6} 3.
Sd3 {+1.51/11 14} Bxd3 {+0.44/22 7} 4. Bxd3 {+0.05/10 12}
{Xboard: Forfeit due to invalid move: S@d4 (_1_1) res=24} 1-0

[Event "Computer Chess Game"]
[Site "INTEL-PC"]
[Date "2013.11.20"]
[Round "3"]
[White "Shokidoki Yokohama 2013"]
[Black "Lima v0.1"]
[Result "0-1"]
[TimeControl "40/300"]
[Variant "shogi"]
[FEN "rbsgk/4p/5/P4/KGSBR[-] w 0 1"]
[SetUp "1"]

{--------------
r b s g k
. . . . p
. . . . .
P . . . .
K G S B R
white to play
--------------}
1. Bc2 {+0.00/15} Sb4 {+0.00/12 11} 2. Rd1 {+0.20/14 6} Sc3 {+0.81/10 11}
3. Rxd5+ {+1.96/12 9} Kxd5 {+11.09/3 0.1} 4. Bb3 {+2.40/12 11} Kc5
{+11.85/7 8} 5. Sb2 {+2.04/12 8} Sxb2 {+13.40/6 7} 6. Gxb2 {+2.44/12 13}
R@e1 {+13.50/5 7}
{Xboard: Forfeit due to invalid move: G@d1 (_1_1) res=24} 0-1