Page 1 of 1

Xiangqi - king moves validation error

PostPosted: 20 Apr 2020, 04:43
by tvt2020
Hi,
I found problem with King move validation algorithm, King moved outside of the nine squares of the palace.

recognized 'xiangqi' (-1) as variant xiangqi
recognized 'xiangqi' (-1) as variant xiangqi
shuffleOpenings = 0
Version: WinBoard 4.8.0b + IBnewGG
Reset(1, 0) from gameMode 0
recognized 'xiangqi' (-1) as variant xiangqi
GameEnds(0, (null), 2)
shuffleOpenings = 0
StartChildProcess (dir=".") UCI2WB "IBnewGG.exe" "..\newgg"
nice engine proc to 10
690 >first : xboard
protover 2
700 <first : feature setboard=1 usermove=1 debug=1 ping=1 name=1 reuse=0 exclude=1 pause=1 sigint=0 sigterm=0 done=0
700 >first : accepted setboard
700 >first : accepted usermove
700 >first : accepted debug
700 >first : accepted ping
700 >first : accepted name
700 >first : accepted reuse
700 >first : accepted exclude
700 >first : accepted pause
700 >first : accepted sigint
700 >first : accepted sigterm
700 >first : accepted done
700 <first : feature option="UCI2WB debug output -check 0"
700 >first : accepted option
700 <first : feature option="ponder always -check 0"
700 >first : accepted option
700 <first : feature variants="normal,xiangqi"
710 >first : accepted variants
710 <first : feature smp=1 memory=0 done=1
710 >first : accepted smp
710 >first : accepted memory
710 >first : accepted done
720 >first : cores 8
720 >first : new
random
720 >first : variant xiangqi
720 >first : level 30 5 0
720 >first : post
720 >first : hard
720 >first : easy
720 >first : ping 1
Impossible move , type = 0
720 <first : Error (unknown command): cores
720 <first : feature myname="GGchess 24042017_MAXCPU:36 (UCI2WB)"
730 >first : accepted myname
730 <first : feature option="Write Debug Log -check 0"
730 >first : accepted option
730 <first : feature option="Contempt -spin 0 -100 100"
730 >first : accepted option
730 <first : feature option="Clear Hash -button"
730 >first : accepted option
730 <first : feature option="MultiPV -spin 1 1 500"
730 >first : accepted option
730 <first : feature option="Skill Level -spin 20 0 20"
730 >first : accepted option
730 <first : feature option="Move Overhead -spin 20 0 5000"
730 >first : accepted option
730 <first : feature option="Minimum Thinking Time -spin 20 0 5000"
730 >first : accepted option
730 <first : feature option="Slow Mover -spin 89 10 1000"
730 >first : accepted option
730 <first : feature option="nodestime -spin 0 0 10000"
730 >first : accepted option
730 <first : feature variants="normal,xiangqi"
730 >first : accepted variants
730 <first : feature smp=1 memory=1 done=1
730 >first : accepted smp
730 >first : accepted memory
730 >first : accepted done
730 <first : pong 1
nps: w=-1, b=-1
21327 >first : name tong
nps: w=-1, b=-1
21327 >first : time 30000
21327 >first : otim 30000
book hit = (NULL)
21327 >first : usermove 21327 >first : e0e1
21347 <first : 1 185 0 357 b9c7
21347 <first : 2 219 0 1249 h7e7 a3a4 e7e3
21347 <first : 3 234 0 1514 h7e7 a3a4 e7e3
21357 <first : 4 229 0 2098 h7e7 i3i4 a6a5 a3a4
21357 <first : 5 203 0 5443 h7e7 e3e4 b9c7 c0e2 e7e4 e1d1
21357 <first : 6 171 0 24649 b7e7 h2d2 b9c7 h0g2 a9b9 b0c2
21357 <first : 7 152 1 44576 h7e7 h0i2 b9c7 i0h0 h9g7 b0c2 i9h9
21357 <first : 8 131 2 119574 h9g7 b2e2 b9a7 b0c2 b7b1 a0b0 a9b9 h0g2
21377 <first : 9 90 4 223012 h9i7 h0g2 b9c7 b0c2 i9i8 e1e0 i8f8 h2i2 h7e7
21387 <first : 10 88 6 281180 b9c7 h0g2 h9g7 e1e0 c6c5 h2i2 h7h1 b0c2 i9h9 i0h0
21447 <first : 11 117 11 569887 b9c7 h0g2 a9a8 e1e0 a8d8 b0c2 h7e7 i0h0 d8d3 h2h7 h9g7 h7e7 b7e7
21507 <first : 12 92 18 874873 b9c7 h0g2 a9a8 e1e0 a8d8 b0c2 d8d3 b2a2 b7b5 g3g4 d3c3 a0b0 b5e5 f0e1 h9g7
21587 <first : 13 91 25 1245008 b9c7 h0g2 a9a8 e1e0 a8d8 b2e2 d8d1 b0c2 d1g1 g2e1 h9i7 i3i4 h7e7 a0b0
21787 <first : 14 104 45 2346757 b9c7 h0g2 a9a8 b0c2 a8f8 b2a2 b7b5 a0b0 b5e5 g0e2 e5g5 i0g0 h9g7 e1e0 f8f3 g3g4
22127 <first : 15 81 79 4095856 b9c7 h0g2 a9a8 b0c2 a8f8 b2a2 h7e7 a0b0 h9g7 i0h0 i9h9 e1e0 h9h4 b0b6 c6c5
23700 <first : 16 86 237 12084034 b9c7 h2e2 h9g7 h0g2 i9h9 b0c2 h7i7 i0h0 h9h0 g2h0 c6c5 a0a1 g6g5 a1d1 i7i3 h0i2
24720 <first : 17 90 338 17398032 h7e7 h0g2 h9g7 i0h0 b9c7 e1e0 c6c5 b0c2 a9a8 b2b6 a8d8 b6c6 c9a7 a0b0 i9h9 b0b6 d8d3
25980 <first : 18 108 464 23970756 b9c7
26740 <first : 18 90 540 27911596 b9c7 h0g2
27390 <first : 18 94 605 31202215 b9c7 h0g2 h9i7 g3g4 i9i8 e1e0 i8f8 i0i1 a9a8 i1d1 a8d8 d1d8 f8d8 b0a2 h7h3 b2c2 b7b2 g0e2 d8d2 c2c6 h3c3
28690 <first : 19 112 735 38038155 b7e7
29680 <first : 19 94 835 43089263 b7e7 h0g2
31640 <first : 19 107 1031 53001432 h7e7 b0c2 h9g7 h0i2 i9h9 i0h0 g6g5 e1e0 g7f5 a0a1 f5d4 a1c1 b7b3 d0e1 b9c7 h2h7 e7e3 c2e3 b3e3 e0d0 a9b9
33060 <first : 20 125 1172 60328174 h7e7
33760 <first : 20 118 1242 63700994 b7e7 h0g2 b9c7 b0a2 c6c5 h2i2 h9i7 i0h0 i9h9 h0h5 a9b9 h5c5 h7g7 a0b0 h9h3 e1e0 h3g3 g0e2 g3f3 i2i6
35140 <first : 21 100 1380 70682248 b7e7 h0g2
36590 <first : 21 118 1525 77894497 h7e7
36860 <first : 21 119 1552 79210831 h7e7 b0c2 h9g7 h0i2 i9h9 i0h0 g6g5 e1e0 g7f5 d0e1 b9c7 c3c4 h9h4 c0e2 b7a7 a0b0 a9b9 b2b6 e7e3 h2g2 h4h0 i2h0 e3e5 e0d0 f5g3
39301 <first : 22 101 1796 91414416 h7e7 b0c2
46791 <first : 22 93 2545 128973671 h7e7 b0c2 h9g7 h0i2 i9h9 e1e0 g6g5 i0h0 b9c7 c0e2 g7f5 d0e1 b7a7 a0b0 c6c5 b2b6 h9h3 b6i6 h3i3 i6g6 a9a8 h2f2 f5d4 h0h9 a8d8 h9g9
46791 <first : 23 119 2545 128973821 h7e7 b0c2 h9g7 h0i2 i9h9 i0h0 g6g5 e1e0 g7f5 d0e1 b9c7 c3c4 h9h4 c0e2 b7a7 b2b4 h4h3 b4b6 a9b9 a0b0 e7e3 h2g2 h3h0
46791 <first : move h7e7
silence
46971 <first :
46971 <first : Hint: b0c2
48104 >first : time 27453
48104 >first : otim 29868
book hit = (NULL)
48104 >first : usermove 48104 >first : e1d1
48124 <first : 1 258 0 230 b7d7
48124 <first : 2 217 0 576 b9c7 h0g2 h9g7
48134 <first : 3 277 0 957 b9c7 d0e1 a9a8
48134 <first : 4 212 0 2180 i9i8 h0g2 h9g7 b0c2 i8d8 d1e1
48134 <first : 5 197 0 4948 i9i8 h0g2 h9g7 b0a2 e7d7
48134 <first : 6 249 0 12993 i9i8 h0g2 b9c7 b0c2 h9g7 i0h0
48134 <first : 7 235 0 21749 i9i8 b0a2 b9c7 h2e2 i8d8 b2d2 b7b1 h0g2
48144 <first : 8 283 1 79592 h9g7 h0i2 i9i8 b0c2 i8f8 h2e2 f8f0 i0h0
48144 <first : 9 255 3 164824 h9g7 h0i2 b9c7 b0c2 a9a8 d1e1 i9h9 e1e0 a8d8 h2e2
48154 <first : 10 255 4 224609 h9g7 h0i2 b9c7 b0c2 a9a8 d1e1 i9h9 e1e0 a8d8 h2e2 d8d3
48184 <first : 11 242 8 397242 b7d7 h0g2 h9g7 d1e1 b9c7 b0c2 a9b9 a0b0 i9h9 i0h0 h9h3 e1e0 h3g3
48224 <first : 12 244 12 588479 h9g7 h0g2 b9c7 i0h0 a9a8 d1e1 a8d8 b0c2 i9h9 h2h6 d8d3 c0e2 c6c5 a0c0
48254 <first : 13 257 14 724256 h9g7 h0g2 i9h9 i0h0 h9h3 b0c2 b9c7 d1e1 a9a8 e1e0 a8f8 c3c4 h3g3 h2h7
48304 <first : 14 256 19 959592 h9g7 d1e1 i9h9 b0c2 b9c7 h0i2 a9a8 i0h0 a8d8 h2e2 h9h0 i2h0 g6g5 h0i2 d8d3
48534 <first : 15 278 42 2127922 h9g7 h0g2 i9h9 i0h0 h9h3 d1e1 h3g3 b0c2 b9a7 e1e0 b7c7 c3c4 a9b9 a0b0 c7c4
48754 <first : 16 273 65 3304763 h9g7 h0g2 i9h9 i0h0 h9h3 b0c2 b9c7 h2i2 h3g3 h0h8 b7b5 h8c8 b5c5 c3c4 a9b9 c4c5 b9b2
49504 <first : 17 250 139 7237794 h9g7 b0c2 i9h9 h0i2 b7b5 c3c4 h9h4 c0a2 a9a8 d1e1 b5e5 h2e2 e5e2 b2e2 a8d8 e1e0 d8d2 a0c0 e7e3 d0e1 b9c7 i0h0 h4h0 i2h0
49804 <first : 18 283 170 8853593 h9g7 b0c2 i9h9 h0i2 b7b5 c3c4 h9h4 c0a2 b5e5 h2e2 e5e2 b2e2 a9a8 d0e1 a8d8 e2d2 d8d3 a0d0 d3e3
50194 <first : 19 289 208 10947440 h9g7 b0c2 i9h9 h0i2 b7b5 c3c4 h9h4 c0a2 b5e5 h2e2 e5e2 b2e2 a9a8 d0e1 a8d8 e2d2 d8d3 i0h0 h4h0 i2h0 d3c3 a0b0 e7d7 d2e2 c3c2 b0b9 c2a2
50854 <first : 20 289 274 14463836 h9g7 b0c2 i9h9 h0i2 b7b5 c3c4 h9h4 c0a2 b5e5 h2e2 e5e2 b2e2 a9a8 d0e1 a8d8 e2d2 d8d3 i0h0 h4h0 i2h0 d3c3 a0b0
52284 <first : 21 271 418 21739103 h9g7 b0c2
55964 <first : 21 289 785 40811415 e7e3
57655 <first : 21 316 955 49596146 e7e3
70125 <first : 21 354 2201 113676146 e7e3
79416 <first : 21 323 3130 161918364 e7e3 b2d2
83756 <first : 21 364 3565 184276379 e7e3
90416 <first : 21 331 4231 218316203 e7e3 b2d2 e3e5 d0e1 h9g7 d1d0 i9h9 h2e2 b9a7 h0g2 a9b9 b0a2 b7d7 d0e0 g6g5 g2e3 d7e7 e3c4 c6c5 c4e5 e7e5
90416 <first : 21 383 4231 218316336 e7e3 h0g2 e3e5 g2e3 i9i8 e3g4 i8d8 b2d2 d8d3 g4e5 e6e5 a0a2 b9a7 h2e2 c9e7 d1e1 a9b9 i0h0 b7d7 d2d7 b9b0 h0h8 d3d7 h8h9 d7d0
90426 <first : move e7e3
silence
90606 <first :
90606 <first : Hint: h0g2
91719 >first : time 23221
91719 >first : otim 29739
book hit = (NULL)
91719 >first : usermove 91719 >first : d1c1
91739 <first : 1 -132 0 350 i0i1 i9i8
91739 <first : 2 -285 0 938 d0e1 b7d7
91739 <first : 3 -284 0 1483 b2d2 b7d7 d2e2 e3e5
91739 <first : 4 -257 0 2205 d0e1 b7d7 b2e2 b9a7
91749 <first : 5 -280 0 3719 d0e1 i9i8 d1d0 i8d8 h2d2 d8d5
91749 <first : 6 -327 0 5141 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 b0c2
91749 <first : 7 -353 0 7453 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 c0e2 b7d7
91749 <first : 8 -353 0 8267 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 c0e2 b7d7 b0d1
91749 <first : 9 -361 0 19797 d0e1 i9i8 d1d0 i8d8 h2d2 d8d5 d2d1 b7d7 b2d2 e3d3 d1d3 d5d3 d0e0 d7d2 e1d2 d3d2 b0a2 h9g7
91749 <first : 10 -353 0 22598 d0e1 i9i8 d1d0 i8d8 h2d2 d8d5 c0e2 b7d7 b0d1 d7d2 e1d2 d5d2 f0e1
91749 <first : 11 -343 1 62050 d0e1 i9i8 d1d0 i8d8 h2d2 d8d5 d2d1 b7d7 b2d2 e3d3 d1d3 d5d3 d0e0 d7d2 e1d2
91759 <first : 12 -343 1 68656 d0e1 i9i8 d1d0 i8d8 h2d2 d8d5 d2d1 b7d7 b2d2 e3d3 d1d3 d5d3 d0e0 d7d2 e1d2 b9c7 b0a2 a9a8 h0i2
91759 <first : 13 -337 1 98167 d0e1 i9i8 d1d0 i8d8 h2d2 d8d5 d2d1 b7d7 b2d2 e3d3 d1d3 d5d3 d0e0 d7d2 e1d2 b9c7 b0a2 a9b9 d2e1 d3g3 h0i2 g3d3 i0h0 h9g7
91769 <first : 14 -327 4 232963 d0e1 i9i8 d1d0 i8d8 h2d2 d8d5 d2d1 b7d7 b2d2 e3d3 d1d3 d5d3 d0e0 d7d2 e1d2 b9a7 b0a2 a9b9 f0e1 d3g3 h0i2 g3i3 i0h0 h9i7
91909 <first : 15 -341 19 1082470 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 d2d1 b7d7 b2d2 e3d3 d1d3 d4d3 d0e0 d7d2 e1d2 b9c7 b0a2 a9b9 d2e1 h9i7 h0i2 c9e7 i0h0 b9b2 h0h7 d3c3 g0e2 c3d3
91969 <first : 16 -339 25 1402259 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 d2d1 b7d7 b2d2 e3d3 d1d3 d4d3 d0e0 d7d2 e1d2 b9c7 b0a2 a9b9 d2e1 d3g3 h0i2 g3d3 i0h0 h9i7 h0h4 c6c5
92039 <first : 17 -322 31 1754981 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 d2d1 b7d7 b2d2 e3d3 d1d3 d4d3 d0e0 d7d2 e1d2 b9c7 b0a2 a9b9 d2e1 h9i7 h0i2 e6e5 i0h0 e5e4 a0a1 e4e3 a1c1 c7e6 h0h6 b9b2
92429 <first : 18 -340 70 3829497 d0e1 i9i8 d1d0 i8d8 b2d2 d8d4 d2d1 b7d7 h2d2 e3d3 d1d3 d4d3 d0e0 d7d2 e1d2 b9c7 b0a2 a9b9 d2e1 c6c5 a0a1 e6e5 h0i2 h9g7 i0h0 e5e4 h0h6 g7e6 h6g6
92879 <first : 19 -341 115 6321898 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 d2d1 b7d7 b2d2 e3d3 d1d3 d4d3 d0e0 d7d2 e1d2 b9c7 b0a2 a9b9 d2e1 c6c5 a0a1 e6e5 h0i2 h9g7 i0h0 e5e4 h0h6 g7e6
93119 <first : 20 -328 139 7585794 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 d2d1 b7d7 b2d2 e3d3 d1d3 d4d3 d0e0 d7d2 e1d2 b9c7 b0a2 a9b9 d2e1 c6c5 h0i2 b9b1 i0h0 h9i7 h0h6 b1b2 g0e2 b2b1 a0b0 b1b0 a2b0 d3c3 h6i6
93909 <first : 21 -329 218 11798248 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 d2d1 b7d7 b2d2 e3d3 d1d3 d4d3 d0e0 d7d2 e1d2 b9c7 b0a2 a9b9 d2e1 h9g7 h0i2 e6e5 i0h0 e5e4 h0h6 c7e6 h6g6 b9b1 a0b0 b1b0 a2b0 d3c3 c0e2 c3a3
95619 <first : 22 -331 389 20639930 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 d2d1 b7d7 b2d2 e3d3 d1d3 d4d3 d0e0 d7d2 e1d2 b9c7 b0a2 a9b9 d2e1 h9g7 h0i2 e6e5 i0h0 g7e6 h0h4 d3e3 a2c1 b9b1 c1e2 e5e4 a3a4
96559 <first : 23 -349 484 25648603 d0e1 i9i8
98899 <first : 23 -349 718 38119471 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 d2d1 b7d7 b2d2 e3d3 d1d3 d4d3 d0e0 d7d2 e1d2 b9c7 b0a2 a9b9 d2e1 h9g7 h0i2 e6e5 i0h0 g7e6 h0h4 d3e3 a2c1 e5e4 c1e2 e6f4 i3i4 b9b1
99719 <first : 24 -331 799 42432566 d0e1
100759 <first : 24 -334 903 47910339 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 d2d1 b7d7 b2d2 e3d3 d1d3 d4d3 d0e0 d7d2 e1d2 b9c7 b0a2 a9b9 f0e1 h9g7 h0i2 e6e5 i0h0 c7e6 h0h6 e5e4 h6g6 b9b1 a0b0 b1b0 a2b0
105889 <first : 25 -346 1416 75275553 d0e1 i9i8 d1d0 i8d8 h2d2 d8d4 d2d1 b7d7 b2d2 e3d3 d1d3 d4d3 d0e0 d7d2 e1d2 b9c7 f0e1 a9b9 b0a2 h9g7 h0i2 e6e5 i0h0 c7e6 h0h6 g6g5 a0a1 b9b5 h6g6 e5e4 a1c1 e4e3 c3c4
105889 <first : move d0e1
105889 <first :
105889 <first : Hint: i9i8
GameEnds(29, xboard exit, 2)
111705 >first : result * {xboard exit}
111705 >first : quit
Process 14480 still alive after timeout, killing... result=0

Re: Xiangqi - king moves validation error

PostPosted: 21 Apr 2020, 08:35
by H.G.Muller
Indeed, this is a known WinBoard 4.8 bug. In that version I completely rewrote the move generator, but I forgot to put the Palace and River restrictions on Ferz, Wazir and Elephant when the variant is Xiangqi. Most annoying aspect is that it interferes with mate detection. It was subsequently fixed, but version 4.9 was only officially released as XBoard.

You can use the development version at http://hgm.nubati.net/WinBoard-AA.zip to get rid of this problem.