Bug with black/white command together with usebook and edit

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

Bug with black/white command together with usebook and edit

Postby what_no2000 » 16 Jul 2016, 15:10

(This issue is is slightly related to "Bug with usebook and edit position?" I guess, but I'll make a new thread to keep it clean and separated. By the way thanks for a quick response on that issue and an interesting insight into the internal workings of Winboard.)

In WinBoard 4.8.0b I manage to get Winboard and Fairy-Max 4.8 to disagree about which side the engine is to play.

The problem is caused by black and white commands (without a go command afterwards), in relation to edit/setboard command and book moves, causing the engine to leave force mode when it should not.

Steps to reproduce:
  • Winboard startup dialog
  • Select "Fairy-Max 4.8" -fcp fmax -fd "..\Fairy-Max" /firstXBook
  • Additional options: -debug
  • Options/Common engine
  • Select use book
  • Unselect first has own book
  • Unselect second has own book
  • Play e2e4
  • Wait for the black book move
  • Mode/edit position
  • Select a position that gives a book hint with black in the move: "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1". Do this by moving blacks piece back on the Board and select black to play. (Copying the FEN to the board will give a sligtly different error situation.)
  • Mode/machine black

Result: The engine will try to do a white move.

Looking at the debug log WinbBoard GUI sends the "white" and "black", this causes the engine to leave force mode and play white once the GUI sends the black book move to the engine.

Looking at the protocol specification "Idioms and backward compatibility features" part, the white and black command should only be sent with a go command afterwards.

Comparing with the log from "Bug with usebook and edit position?"-thread, there is also missing a "force" command before the book move is sent to the engine.

This is the relevant part of the debug log:

Code: Select all
13933 >first : .
EditPosDone
13934 >first : white
13934 >first : time 30000
13934 >first : otim 30000
13934 >first : black
book key = 823c9b50fd114196
book move field = 3299
book hit = d7d5
13935 >first : d7d5


If I paste the FEN onto the board I think the underlying issue is the same, but the behaviour on the board is a bit different: Trying to continue playing white will cause problems for the human player.

This is the full debug log where the edit has been done by hand on the board:
Code: Select all
recognized 'normal' (-1) as variant normal
recognized 'normal' (-1) as variant normal
shuffleOpenings = 0
Version: WinBoard 4.8.0b + fmax
Reset(1, 0) from gameMode 0
recognized 'normal' (-1) as variant normal
GameEnds(0, (null), 2)
shuffleOpenings = 0
StartChildProcess (dir="..\Fairy-Max") fmax
545 >first : xboard
protover 2
564 <first : tellics say     Fairy-Max 4.8V
564 <first : tellics say     by H.G. Muller
564 <first : tellics say Gothic Chess is protected by U.S. patent #6,481,716 by Ed Trice.
564 <first : tellics say Falcon Chess is protected by U.S. patent #5,690,334 by George W. Duke
565 <first : feature myname="Fairy-Max 4.8V"
565 >first : accepted myname
565 <first : feature memory=1
565 >first : accepted memory
565 <first : feature setboard=0 xedit=1 ping=1 done=0
565 >first : accepted setboard
565 >first : accepted xedit
566 >first : accepted ping
566 >first : accepted done
566 <first : feature variants="normal,nocastle,shatranj,asean,makruk,cambodian,ai-wok,courier,knightmate,capablanca,gothic,falcon,cylinder,berolina,super,seirawan,spartan,great,light-brigade,king-of-the-hill,bifurcator,team-mate,fairy"
566 >first : accepted variants
567 <first : feature option="Resign -check 0"
567 >first : accepted option
567 <first : feature option="Resign Threshold -spin 800 200 1200"
567 >first : accepted option
567 <first : feature option="Claim draw after -spin 50 0 200"
567 >first : accepted option
567 <first : feature option="Ini File -file fmax.ini"
567 >first : accepted option
568 <first : feature option="Multi-PV Margin -spin 0 0 1000"
568 >first : accepted option
568 <first : feature option="Variant fairy selects -combo FIDE-Clobberers /// Clobberers-FIDE /// FIDE-Nutters /// Nutters-FIDE /// Clobberers-Nutters /// Nutters-Clobberers /// FIDE-Rookies /// Rookies-FIDE /// Clobberers-Rookies /// Rookies-Clobberers"
569 >first : accepted option
569 <first : feature option="Makruk rules -combo makruk /// Cambodian /// Ai-wok"
569 >first : accepted option
569 <first : feature option="Dummy Slider Example -slider 20 0 100"
569 >first : accepted option
569 <first : feature option="Dummy String Example -string happy birthday!"
570 >first : accepted option
570 <first : feature option="Dummy Path Example -path ."
570 >first : accepted option
570 <first : feature option="Info -button"
570 >first : accepted option
570 <first : feature option="Clear Hash -button"
570 >first : accepted option
570 <first : feature done=1
570 >first : accepted done
591 >first : memory 68
591 >first : new
random
591 >first : level 40 5 0
591 >first : post
591 >first : hard
591 >first : ping 1
Impossible move , type = 0
630 <first : pong 1
nps: w=-1, b=-1
nps: w=-1, b=-1
2067 >first : time 30000
2067 >first : otim 30000
book key = 823c9b50fd114196
book move field = 3234
book hit = c7c5
2068 >first : force
2068 >first : e2e4
2068 >first : c7c5
silence
Interrupting first
6024 >first : force
13929 >first : memory 68
13929 >first : new
random
13929 >first : level 40 5 0
13929 >first : post
13929 >first : hard
13929 >first : ping 2
Impossible move c7c5, type = 0
13931 >first : force
13931 >first : a2a3
13931 >first : edit
13931 >first : #
13931 >first : Pe4
13931 >first : Pa2
13931 >first : Pb2
13931 >first : Pc2
13931 >first : Pd2
13931 >first : Pf2
13931 >first : Pg2
13931 >first : Ph2
13931 >first : Ra1
13931 >first : Nb1
13931 >first : Bc1
13932 >first : Qd1
13932 >first : Ke1
13932 >first : Bf1
13932 >first : Ng1
13932 >first : Rh1
13932 >first : c
13932 >first : Ra8
13932 >first : Nb8
13932 >first : Bc8
13932 >first : Qd8
13932 >first : Ke8
13932 >first : Bf8
13932 >first : Ng8
13932 >first : Rh8
13932 >first : Pa7
13932 >first : Pb7
13932 >first : Pc7
13933 >first : Pd7
13933 >first : Pe7
13933 >first : Pf7
13933 >first : Pg7
13933 >first : Ph7
13933 >first : .
EditPosDone
13934 >first : white
13934 >first : time 30000
13934 >first : otim 30000
13934 >first : black
book key = 823c9b50fd114196
book move field = 3299
book hit = d7d5
13935 >first : d7d5
nps: w=-1, b=-1
Undoing extra move from first, gameMode 2
Interrupting first
13935 >first : undo
13953 <first : pong 2
13954 <first : # times @ 9585497
13954 <first : # 16+16 pieces, centr = (1,1) R=40
13954 <first :  1    -10        0          3 e4d5
13956 <first :  1     -9        0          3 e4e5
13956 <first :  1     -6        0          3 d2d3
13957 <first :  1     13        0          3 f2f3
13957 <first :  1     15        0          3 b1c3
13958 <first :  1     18        0         13 f1d3
13958 <first :  2    -15        0         61 f1d3 b8c6
13959 <first :  2     -8        0        403 f1b5 c7c6 b5d3
13959 <first :  2     -6        0        469 d2d3 d5e4
13960 <first :  2      6        0        501 f2f3 b8c6
13960 <first :  2      7        1        644 b1c3 g8f6
13961 <first :  3      8        1       1231 b1c3 g8f6 f2f3
13962 <first :  3     12        1       1635 d1f3 c8e6 d2d4
13963 <first :  4    -13        1       5631 d1f3 g8f6 b1c3 c8e6
13968 <first :  4     -5        1      10794 f1d3 b8c6 b1c3 g8f6
13974 <first :  4     12        3      15450 f2f3 g8f6 b1c3 b8c6
13982 <first :  5      3        3      21005 f2f3 g8f6 b1c3 b8c6 f1d3
14003 <first :  5     17        6      43039 b1c3 g8f6 f1d3 b8c6 f2f4
14031 <first :  6      5        7      70693 b1c3 g8f6 f1b5 c7c6 b5d3 c6c5 f2f4
14183 <first :  7     20       23     225479 b1c3 g8f6 f1d3 c7c5 f2f4 b8c6 g1f3
14510 <first :  8     -7       56     562705 b1c3 g8f6 e4e5 f6g4 d2d4 b8c6 f2f3 g4h6
16734 <first :  9     14      279    2833500 b1c3 g8f6 e4e5 f6d7 d2d4 c7c6 c1f4 d8b6 a1b1
17838 <first : # times @ 9589381: real=3884 cpu=3884
17838 <first : # promo = 0 (`) GT = 0
17838 <first : move b1c3
17846 <first : # times @ 9589397
17846 <first : # 16+16 pieces, centr = (1,1) R=40
17846 <first :  1    -15        0          9 e4d5 d8d5
17847 <first :  1     -3        0         11 e4e5
17848 <first :  1     17        0         65 f2f3
17848 <first :  2     -8        0         95 f2f3 b8c6
17849 <first :  2      9        0        243 b1c3 g8f6
17849 <first :  3     27        0       1082 b1c3 g8f6 f2f3
17854 <first :  4      1        0       7363 b1c3 d5e4 c3e4 b8c6
17860 <first :  4      7        1      12936 f1b5 b8c6 f2f3 g8f6 b5d3
17881 <first :  5     -9        3      35194 f1b5 c7c6 b5d3 c8e6 f2f4 b8d7
17911 <first :  5      6        6      64408 f1d3 d5e4 d3e4 g8f6 e4d3
17937 <first :  5     24        9      90896 f2f3 b8c6 b1c3 g8f6 f1d3
17982 <first :  6      7       14     136729 f2f3 g8f6 b1c3 b8c6
18200 <first :  7     -4       35     356359 f2f3 c7c6 b1c3 c8e6 f1d3 b8d7 g1e2
18471 <first :  7     10       62     622624 b1c3 g8f6 d2d3 b8c6 c1g5 c8e6 g1f3
18820 <first :  8    -12       96     974533 b1c3 g8f6 e4e5 f6g4 d2d4 b8c6 f2f3 g4h6
19420 <first :  8     -7      157    1575666 d1e2 d5e4 e2e4 c7c6 d2d4 g8f6 e4f4 b8d7
19626 <first :  8     -3      177    1790830 f1b5 c7c6 b5d3 b8a6 e4d5 d8d5 f2f3 a6c5 d3e2
20392 <first :  8      0      254    2571649 e4d5 d8d5 b1c3 d5d8 d2d4 b8c6 c1e3 c8f5
21907 <first :  9     -6      405    4132616 e4d5 d8d5 b1c3 d5e6 g1e2 c7c6 d2d4 b8d7 c1f4 g8f6
22885 <first :  9     -3      503    5101509 e4d5 d8d5 b1c3 d5e6 d1e2 c7c5 f2f4 b8d7 g1f3 g8f6
24583 <first :  9      1      673    6833756 f2f3 g8f6 b1c3 c7c5 g1e2 b8c6 e2f4 d5e4 c3e4
25783 <first :  9     16      794    8017397 b1c3 g8f6 e4e5 f6d7 d2d4 c7c6 c1f4 d8b6 a1b1
25955 <first : # times @ 9597509: real=8112 cpu=8109
25955 <first : # promo = 0 (`) GT = 0
25955 <first : move b1c3
write FEN 50-move: 0 1 1
e1. p=-6
CopyTextToClipboard(): lock count 1
CopyTextToClipboard(): lock count 0
CopyTextToClipboard(): err 0 locked 0
GameEnds(29, xboard exit, 2)
107313 >first : result * {xboard exit}
107313 >first : force
107313 >first : ping 3
107313 >first : quit
name = '%APPDATA%\winboard48.ini', expanded name = 'C:\Users\AW\AppData\Roaming\winboard48.ini'


This is the full debug log where the edit has been done by pasting the FEN position on to the board:
Code: Select all
recognized 'normal' (-1) as variant normal
recognized 'normal' (-1) as variant normal
shuffleOpenings = 0
Version: WinBoard 4.8.0b + fmax
Reset(1, 0) from gameMode 0
recognized 'normal' (-1) as variant normal
GameEnds(0, (null), 2)
shuffleOpenings = 0
StartChildProcess (dir="..\Fairy-Max") fmax
546 >first : xboard
protover 2
564 <first : tellics say     Fairy-Max 4.8V
564 <first : tellics say     by H.G. Muller
564 <first : tellics say Gothic Chess is protected by U.S. patent #6,481,716 by Ed Trice.
565 <first : tellics say Falcon Chess is protected by U.S. patent #5,690,334 by George W. Duke
565 <first : feature myname="Fairy-Max 4.8V"
565 >first : accepted myname
566 <first : feature memory=1
566 >first : accepted memory
566 <first : feature setboard=0 xedit=1 ping=1 done=0
566 >first : accepted setboard
566 >first : accepted xedit
566 >first : accepted ping
566 >first : accepted done
566 <first : feature variants="normal,nocastle,shatranj,asean,makruk,cambodian,ai-wok,courier,knightmate,capablanca,gothic,falcon,cylinder,berolina,super,seirawan,spartan,great,light-brigade,king-of-the-hill,bifurcator,team-mate,fairy"
567 >first : accepted variants
567 <first : feature option="Resign -check 0"
567 >first : accepted option
567 <first : feature option="Resign Threshold -spin 800 200 1200"
567 >first : accepted option
568 <first : feature option="Claim draw after -spin 50 0 200"
568 >first : accepted option
568 <first : feature option="Ini File -file fmax.ini"
568 >first : accepted option
568 <first : feature option="Multi-PV Margin -spin 0 0 1000"
568 >first : accepted option
568 <first : feature option="Variant fairy selects -combo FIDE-Clobberers /// Clobberers-FIDE /// FIDE-Nutters /// Nutters-FIDE /// Clobberers-Nutters /// Nutters-Clobberers /// FIDE-Rookies /// Rookies-FIDE /// Clobberers-Rookies /// Rookies-Clobberers"
569 >first : accepted option
569 <first : feature option="Makruk rules -combo makruk /// Cambodian /// Ai-wok"
569 >first : accepted option
570 <first : feature option="Dummy Slider Example -slider 20 0 100"
570 >first : accepted option
570 <first : feature option="Dummy String Example -string happy birthday!"
570 >first : accepted option
570 <first : feature option="Dummy Path Example -path ."
570 >first : accepted option
570 <first : feature option="Info -button"
571 >first : accepted option
571 <first : feature option="Clear Hash -button"
571 >first : accepted option
571 <first : feature done=1
571 >first : accepted done
582 >first : memory 68
582 >first : new
random
582 >first : level 40 5 0
582 >first : post
582 >first : hard
582 >first : ping 1
Impossible move , type = 0
616 <first : pong 1
nps: w=-1, b=-1
nps: w=-1, b=-1
3166 >first : time 30000
3166 >first : otim 30000
book key = 823c9b50fd114196
book move field = 3234
book hit = c7c5
3166 >first : force
3167 >first : e2e4
3167 >first : c7c5
silence
Interrupting first
7082 >first : force
PasteTextFromClipboard(): lock count 0
PasteTextFromClipboard(): lock count 0
PasteTextFromClipboard(): err 0 locked 0
FEN castling rights: 7 0 4 7 0 4
PasteFenFromString(): fen 'rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1'
shuffleOpenings = 0
FEN castling rights: 7 0 4 7 0 4
18971 >first : memory 68
18972 >first : new
random
18972 >first : level 40 5 0
18972 >first : post
18972 >first : hard
18972 >first : ping 2
Impossible move c7c5, type = 0
18973 >first : force
18973 >first : a2a3
18973 >first : edit
18973 >first : #
18973 >first : Pa2
18973 >first : Pb2
18973 >first : Pc2
18974 >first : Pd2
18974 >first : Pe2
18974 >first : Pf2
18974 >first : Pg2
18974 >first : Ph2
18974 >first : Ra1
18974 >first : Nb1
18974 >first : Bc1
18974 >first : Qd1
18974 >first : Ke1
18974 >first : Bf1
18974 >first : Ng1
18974 >first : Rh1
18974 >first : c
18974 >first : Ra8
18974 >first : Nb8
18974 >first : Bc8
18975 >first : Qd8
18975 >first : Ke8
18975 >first : Bf8
18975 >first : Ng8
18975 >first : Rh8
18975 >first : Pa7
18975 >first : Pb7
18975 >first : Pc7
18975 >first : Pd7
18975 >first : Pe7
18975 >first : Pf7
18975 >first : Pg7
18975 >first : Ph7
18975 >first : .
EditPosDone
18976 >first : memory 68
18976 >first : new
random
18977 >first : level 40 5 0
18977 >first : post
18977 >first : hard
18977 >first : ping 3
Impossible move c7c5, type = 0
18978 >first : force
18978 >first : a2a3
18978 >first : edit
18978 >first : #
18978 >first : Pe4
18978 >first : Pa2
18978 >first : Pb2
18978 >first : Pc2
18978 >first : Pd2
18978 >first : Pf2
18978 >first : Pg2
18979 >first : Ph2
18979 >first : Ra1
18979 >first : Nb1
18979 >first : Bc1
18979 >first : Qd1
18979 >first : Ke1
18979 >first : Bf1
18979 >first : Ng1
18979 >first : Rh1
18979 >first : c
18979 >first : Ra8
18979 >first : Nb8
18979 >first : Bc8
18979 >first : Qd8
18979 >first : Ke8
18979 >first : Bf8
18980 >first : Ng8
18980 >first : Rh8
18980 >first : Pa7
18980 >first : Pb7
18980 >first : Pc7
18980 >first : Pd7
18980 >first : Pe7
18980 >first : Pf7
18980 >first : Pg7
18980 >first : Ph7
18980 >first : .
EditPosDone
18995 <first : pong 2
19010 <first : pong 3
22558 >first : white
22558 >first : time 30000
22558 >first : otim 30000
22558 >first : black
book key = 823c9b50fd114196
book move field = 3364
book hit = e7e5
22558 >first : e7e5
nps: w=-1, b=-1
silence
22651 <first : # times @ 13311705
22651 <first : # 16+16 pieces, centr = (1,1) R=40
22651 <first :  1     15        0          3 d2d4
22652 <first :  1     26        0          5 g1f3
22653 <first :  2     -6        0         67 g1f3 b8c6
22653 <first :  2     13        0        173 d2d3 d7d5
22654 <first :  3      7        0        971 d2d3 f8b4 b1c3 b8c6
22654 <first :  3      9        1       2153 d2d4 e5d4 d1d4
22654 <first :  3     24        1       2449 b1c3 b8c6 d2d3
22655 <first :  3     25        1       2753 g1f3 b8c6 d2d4
22655 <first :  4    -13        1       3508 g1f3 b8c6 d2d4 g8f6
22655 <first :  4     -2        1       5167 g1h3 d7d5 b1c3 g8f6
22656 <first :  4     13        3       9642 d2d4 b8c6 g1f3 e5d4
22656 <first :  5      9        4      25890 d2d4 e5d4 d1d4 b8c6 d4d3
22657 <first :  5     10        6      41111 d2d3 f8b4 b1c3 b8c6 d1g4 d8f6
22657 <first :  5     12        7      55422 f2f3 b8c6 f1d3 d8h4 g2g3 h4h5
22671 <first :  5     24       12      90535 f1d3 d7d5 b1c3 g8f6 g1f3
22710 <first :  6      2       15     128250 f1d3 d7d5 c2c4 d5c4 d3c4 b8c6
22752 <first :  6      4       20     168833 f1e2 b8c6 d2d3 g8f6 b1c3 d7d5
22819 <first :  6     12       26     235528 g1e2 d7d6 d2d4 b8c6 b1c3 c8e6
22962 <first :  7     -4       40     375839 g1e2 d7d6 d2d3 b8c6 b1c3 c8e6 c1e3
23299 <first :  7     24       74     707117 g1f3 d7d6 f1e2 f7f5 b1c3 g8f6 d2d3
23775 <first :  8     12      121    1177726 g1f3 g8f6 b1c3 f8d6 d2d4 e5d4 f3d4 e8g8
26890 <first :  9     23      433    4239357 g1f3 b8c6 b1c3 f8c5 f1d3 g8f6 c3a4 c5d6 e1g1
27510 <first : # times @ 13316666: real=4961 cpu=4950
27510 <first : # promo = 0 (`) GT = 0
27510 <first : move g1f3
Ignoring move out of turn by first, gameMode 2, forwardMost 2
Interrupting first
29134 >first : time 30000
29134 >first : otim 29342
book key = a6e050cf2a640274
book hit = (NULL)
29135 >first : d2d3
29135 >first : go
29244 <first : Illegal move:d2d3
29254 <first : # times @ 13318288
29254 <first : # 16+16 pieces, centr = (1,1) R=40
29254 <first :  1    -75        0          3 a7a5
29255 <first :  1    -66        0          3 a7a6
29256 <first :  1     -1        0          3 d7d5
29256 <first :  1      5        0          3 d7d6
29257 <first :  1      6        0          3 f7f6
29257 <first :  1     23        0          3 f8d6
29257 <first :  2      3        0         21 f8d6 d2d4
29258 <first :  3      8        0        337 f8d6 b1c3 h7h5
29258 <first :  4    -20        0        430 f8d6 b1c3 h7h5 d2d4
29259 <first :  4    -16        0       1693 g8f6 f1d3 d7d6 e1g1
29259 <first :  4    -15        0       2278 d7d6 f1d3
29259 <first :  5    -15        0       2850 d7d6 f1d3
29260 <first :  6    -19        3      11717 d7d6 f1e2 a7a5 d2d4 e5d4 f3d4
29260 <first :  7    -15        4      28183 d7d6 f1d3
29500 <first :  8    -19       35     328660 d7d6 f1e2 a7a5 d2d4 b8c6 b1c3 c8e6 e1g1
33692 >first : time 29989
33692 >first : otim 28897
book key = a6e050cf2a640274
book hit = (NULL)
33692 >first : d2d3
34228 <first :  9      7      508    4871184 d7d6 d2d3 g8f6 f1e2
38125 <first :  9      8      898    8672368 f8d6 b1a3 f7f6 a3c4 d6e7 d2d4 d7d6 c1e3 b8c6
38486 <first : # times @ 13327633: real=9345 cpu=9352
38486 <first : # promo = 0 (`) GT = 0
38486 <first : move f8d6
silence
38593 <first : # times @ 13327633
38593 <first : # 16+16 pieces, centr = (1,1) R=40
38593 <first :  1      6        0          3 a7a5
38594 <first :  1     11        0          9 c7c6
38594 <first :  1     15        0         15 d8f6
38595 <first :  2    -13        0         49 d8f6 b1c3
38595 <first :  2     -6        0         73 g8e7
38595 <first :  2      2        0        173 a7a6 b1d2
38596 <first :  2      4        0        197 f7f6 b1d2
38596 <first :  3      4        0        282 f7f6 f1e2 a7a5
38597 <first :  3     14        0        480 h7h5 b1c3 g8f6
38597 <first :  3     18        0        930 g8f6 b1c3 e8g8
38597 <first :  3     19        0       1254 a7a5 b1c3 b8c6
38598 <first :  4     -1        0       1754 a7a5 b1c3 b8c6 c1e3
38598 <first :  4      2        0       2010 f7f6 f1e2 g8e7 e1g1
38598 <first :  4      4        1       3175 b8c6 b1c3 f7f6 c1e3
38599 <first :  4     10        1       5468 g8e7 b1c3 e8g8 c1e3
38599 <first :  4     12        1       6005 g8f6 f1e2 e8g8 e1g1
38600 <first :  5      4        1      14989 g8f6 f1e2 e8g8 e1g1 b8c6
38600 <first :  5      5        1      16155 g8f6
38601 <first :  5     22        4      37078 g8h6 b1d2 e8g8 d2c4 d6b4
38601 <first :  6    -11        9      86213 g8h6 f1e2 e8g8 e1g1 f7f5 b1c3
38609 <first :  6     -8       12     115843 g8e7 b1d2 f7f6 d2c4 d6b4 c2c3 b4c5
38616 <first :  6      2       14     122485 g8f6 f1e2 e8g8 e1g1 b8c6 b1c3
38698 <first :  6     16       21     201941 f7f6 b1c3 g8e7 f1e2 e8g8 e1g1
38904 <first :  7      0       42     406430 f7f6 b1d2 g8e7 d2c4 e8g8 c4d6
39038 <first :  7      4       56     537999 h7h5 b1d2 f7f6 d2c4 d6e7 c1e3 b8c6
39151 <first :  7      7       67     649538 b8c6 b1d2 g8f6 d2c4 e8g8 c1d2 b7b5 c4d6 c7d6
39832 <first :  8      0      135    1313551 b8c6 b1d2 f7f6 d2c4 d6e7 c1e3 b7b5 c4d2
40473 <first :  8      3      199    1944689 a7a6 b1d2 f7f6 d2c4 d6e7 c1e3 b7b5 c4d2
41437 <first :  9      1      294    2884280 a7a6 b1d2 f7f6 f1e2 g8h6 d2c4 d6e7 e1g1 e8g8
Interrupting first
41620 >first : time 29509
41620 >first : otim 28584
book key = 6c09db7c55b43c21
book hit = (NULL)
41640 >first : f2f3
43370 <first : # times @ 13332516: real=4883 cpu=4883
43370 <first : # promo = 0 (`) GT = 0
43370 <first : move a7a6
silence
43473 <first : Illegal move:f2f3
GameEnds(29, xboard exit, 2)
write FEN 50-move: 0 5 1
e1. p=-6
e2. p=-3
e3. p=-3
e4. p=-6
e5. p=-3
62971 >first : result * {xboard exit}
62971 >first : force
62971 >first : ping 4
62971 >first : quit
name = '%APPDATA%\winboard48.ini', expanded name = 'C:\Users\AW\AppData\Roaming\winboard48.ini'
what_no2000
 
Posts: 5
Joined: 03 Nov 2009, 10:03

Re: Bug with black/white command together with usebook and e

Postby H.G.Muller » 16 Jul 2016, 22:02

Indeed, I also ran into this problem when preparing my Xiangqi engine for the Olympiad, when I tried to analyze positions with black to move. I guess Fairy-Max and HaQiKi D belong to the very few engines that still use the 'edit' command. It has todowith sending the 'force' and the 'black' command in the wrong order. When I added sending the 'black' command to set black to move, I had assumed 'edit' would always switch the engine to force mode. But in fact it should not alter what the engine plays.
User avatar
H.G.Muller
 
Posts: 3078
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Bug with black/white command together with usebook and e

Postby what_no2000 » 17 Jul 2016, 12:27

Actually Winboard do send the force command before the edit command, as the debug log shows.

The problem is that Fairy-Max interpret the white and black command as "...and leave force mode", and thus starts to play after getting the book move from the GUI. The protocol specification only says "Set White on move. Set the engine to play Black. Stop clocks.". It does not specifically say to leave force mode or not. So if the white and black command is not suppose to be interpreted as leave force mode, then this is actually a bug in Fairy-Max and not in Winboard.

On the other hand the "13. Idioms and backward compatibility features" chapter of the specification says that Winboard/Xbord only will use the black and white command with a go command afterwards. If that is always done, then it is not important if the black and white command should leave force mode or not. Maybe this limitation was specified because the white and black command was implemented differently by engines? In this case Winboard sends the black and white command without a go afterwards, so it is not following the specification in chapter 13.

The "missing" force command I mentioned was the following force command I saw in the debug log between Fruit and Winboard just before sending the book move to the engine (in the "Bug with usebook and edit position?" thread):

Code: Select all
100923 >first : time 30000
100923 >first : otim 30000
book key = 0844931a6ef4b9a0
book move field = 405
book hit = g1f3
100923 >first : force
100924 >first : usermove g1f3


Compared to the debug log with Fairy-Max, where the book move does not have a force in front of it:

Code: Select all
13934 >first : white
13934 >first : time 30000
13934 >first : otim 30000
13934 >first : black
book key = 823c9b50fd114196
book move field = 3299
book hit = d7d5
# No force command here
13935 >first : d7d5


Adding this force command would be one way of preventing Fairy-Max to play after getting the black command followed by a book move. In that case maybe the specification in chapter 13 also should be updated with a white/time/otime/black/force idom.
what_no2000
 
Posts: 5
Joined: 03 Nov 2009, 10:03


Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 6 guests