Some xboard issues

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Some xboard issues

Post by Evert »

I ran into a few minor issues with XBoard while adding features to Sjaak. I'll list these in no particular order.

XBoard 4.5.3a:
  • Sjaak can now load a variant description from a configuration file. It adds the variants it finds to a drop-down menu in the engine options menu, similar to Fairy-Max. The file can either be specified as part of the engine command (as a first argument), or it can be selected from a file selector in the options dialog box. In the latter case, the drop-down menu for the known variants needs to be updated. When I close and reopen the engine options dialog, the original drop-down menu is still there, and a second one appears beneath it.
    From the logfile:

    Code: Select all

    261 <first &#58; feature variants="normal,berolina,spartan,amazon,knightmate,maharaja,makruk,shatranj,capablanca,gothic,10x8+0_janus,courier,xiangqi,grand,10x8+0_fairy,10x10+0_fairy,8x8+1_fairy,fairy"
    261 >first &#58; accepted variants
    261 <first &#58; feature option="Variant configuration file -file "
    261 >first &#58; accepted option
    261 <first &#58; feature option="Variant fairy selects -combo Normal &#40;8x8&#41; /// Amazon &#40;8x8&#41; /// Grand &#40;10x10&#41; /// Indian Grand &#40;10x10&#41; /// Maharaja &#40;8x8&#41; /// Pocket Knight &#40;8x8+1&#41; "
    261 >first &#58; accepted option
    261 <first &#58; feature done=1
    261 >first &#58; accepted done
    262 >first &#58; new
    random
    263 >first &#58; level 40 5 0
    263 >first &#58; post
    263 >first &#58; hard
    263 >first &#58; ping 1
    264 <first &#58; pong 1
    19409 >first &#58; option Variant configuration file=/Users/eglebbk/Program/Sjaak/variants.txt
    19410 <first &#58; feature option="Variant fairy selects -reset"
    19410 >first &#58; accepted option
    19410 >first &#58; rejected option Variant fairy selects -reset
    19410 <first &#58; feature option="Variant fairy selects -combo Normal &#40;8x8&#41; /// Amazon &#40;8x8&#41; /// Grand &#40;10x10&#41; /// Indian Grand &#40;10x10&#41; /// Maharaja &#40;8x8&#41; /// Pocket Knight &#40;8x8+1&#41; /// FIDE Chess /// Legan's Chess /// Chancellor Chess /// Ninth Century Indian Chess "
    19410 >first &#58; accepted option
    19410 <first &#58; feature done=1
    19410 >first &#58; accepted done
    
    It seems to first accept and then reject the reset option...?
  • I added a variant "pocket knight"; this is like normal chess, but every player starts with an extra knight "in the pocket" that they can drop on the board whenever they want. Even if I select "fairy" with an 8x8 board and holdings of 1, the hodlings displayed by XBoard are empty. Depending on what I try to correct that I can make the black pieces disappear completely, or totally screw up the board. I have not been able to get the correct starting position setup.
XBoard-alien, latest from http://hgm.nubati.net/cgi-bin/gitweb.cg ... s/aliennew :
I suspect an uninitialised variable somewhere, since when I start a game the black clock jumps to 2187:06:02. This isn't just a display glitch, since the logfile says " >second: time 18897857102" (it's supposed to say "time 1000" for a 40/10" game).
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Some xboard issues

Post by hgm »

I don't think 4.5.3 supports -reset options yet. It is strange you get a double accepted/rejected response, though; probably the second is generated when parsing the option contents.

As to holdings: I guess you need tomake the size at least two, because XBoard uses a fixed mapping algorith between piece types and holding square (mapping all the pieces defined in the pieceToCharTabe in the orderthey occur there). For variant fairy (and normal; you could play this as variant normal) Knights map to the second holdings square, Pawns to the first.

To start with a Knight you would have to mentionit in the FEN:

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR [Nn] w KQkq - 0 1

Problem is that when you define holdings, by default holdings are crazyhouse-like, i.e. captured pieces will be put in it after color-reversal. Only in certain variants there are exceptions to this: super, great and grand suppress the color reversal as well as drops, but allow you to select apiece from it on promotion. This is hard-programmed for the variant, though, not user configurable. But variant seirawan is closest to what you want: there captured pieces are not put into the holdings, and you are allowed to drop or gate from it.

So best would be to play pocket knight as 8x8+2_seirawan (although regular seirawan would not be so bad either; it just has needlesly large holdings. But that is even true when you play variant seirawan, because I had to make the holdings large enough to contain Archbishop and Chancellor, which come only after PNBRQ in the pieceToCharTable).

So variant seirawan with above FEN as opening position would do a pretty good job,except that you can also 'gate in' the pocketed Knight Seirawan-style,and you can promote to H or E. The latter can be suppressed by specifying apieceToCharTablewithout them. (And the other stuff willhave to be refused by the engine, or you simply should not do it.)

The clock problem sounds vaguely familiar; I thought I already fixed something like that (but perhaps not in this branch). I will checkit out.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Some xboard issues

Post by Evert »

hgm wrote:I don't think 4.5.3 supports -reset options yet.
The page describing the protocol says it should be supported since 4.4...
The same thing happens with xboard-alien, by the way, not sure where that branched off.
As to holdings: I guess you need tomake the size at least two, because XBoard uses a fixed mapping algorith between piece types and holding square (mapping all the pieces defined in the pieceToCharTabe in the orderthey occur there). For variant fairy (and normal; you could play this as variant normal)
True, except that with the way I handle variants in Sjaak it'd require a bit of a hack to do that in the communication with XBoard (internally it does exactly that, of course: create a normal game, override the starting position and enable drops).
Anyway, setting the holding size to 2 does indeed work correctly.
Problem is that when you define holdings, by default holdings are crazyhouse-like, i.e. captured pieces will be put in it after color-reversal. Only in certain variants there are exceptions to this: super, great and grand suppress the color reversal as well as drops, but allow you to select apiece from it on promotion. This is hard-programmed for the variant, though, not user configurable. But variant seirawan is closest to what you want: there captured pieces are not put into the holdings, and you are allowed to drop or gate from it.
Right; I think we discussed that before in the context of Burmese chess.
Crazyhouse-like hodlings are of course not a problem in engine matches, nor human matches as long as you don't try to drop anything after that first knight (and get an illegal move claim).
It might be useful to have a way to specify that holdings are "frozen", meaning nothing goes into them and you can only drop from them. Not sure how to do that in a way that's not an ugly hack, but it might be worth thinking about.
So best would be to play pocket knight as 8x8+2_seirawan (although regular seirawan would not be so bad either; it just has needlesly large holdings. But that is even true when you play variant seirawan, because I had to make the holdings large enough to contain Archbishop and Chancellor, which come only after PNBRQ in the pieceToCharTable).

So variant seirawan with above FEN as opening position would do a pretty good job,except that you can also 'gate in' the pocketed Knight Seirawan-style,and you can promote to H or E. The latter can be suppressed by specifying apieceToCharTablewithout them. (And the other stuff willhave to be refused by the engine, or you simply should not do it.)
That should mostly work already then (Sjaak only sends a FEN if I also give it a piece-to-char string, otherwise it just uses it to initialise itself).
I'll give that a go, it may be a bit confusing for someone thinking Sjaak plays Seirawan Chess.
The clock problem sounds vaguely familiar; I thought I already fixed something like that (but perhaps not in this branch). I will checkit out.
Great!
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Some xboard issues

Post by hgm »

Evert wrote:XBoard-alien, latest from http://hgm.nubati.net/cgi-bin/gitweb.cg ... s/aliennew :
I suspect an uninitialised variable somewhere, since when I start a game the black clock jumps to 2187:06:02. This isn't just a display glitch, since the logfile says " >second: time 18897857102" (it's supposed to say "time 1000" for a 40/10" game).
What exactly do you do to get this? I could not reproduce it. Did you use the TC dialog in the session where this happened? Setting -st should overrule -tc, -mps and -inc options, so an uninitalized variable ending up there could cause this problem.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Some xboard issues

Post by Evert »

hgm wrote: What exactly do you do to get this? I could not reproduce it. Did you use the TC dialog in the session where this happened? Setting -st should overrule -tc, -mps and -inc options, so an uninitalized variable ending up there could cause this problem.
I never use dialog boxes if I can avoid it (in this case, I didn't even know there was one... is it new?)
The command I ran is

Code: Select all

$ xboard-alien -fcp ./xsjaak -scp ./xsjaak -size middling -tc 0&#58;10 -mg 2
and that reliably reproduces the problem every time. I don't have anything special set in the ~/.xboardrc (although I did use the "save settings" option there after turning off some of the more annoying defaults, like flip board).

EDIT By the way, the first "time" and "otime" commands sent (to the first engine) are correct, but the first time the second engine gets them the "time" is messed up, and so is "otime" the next time the first engine gets the "time" command.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Some xboard issues

Post by hgm »

Evert wrote:I never use dialog boxes if I can avoid it (in this case, I didn't even know there was one... is it new?)
Only about 4 years (in the Options menu since v4.3.15)...

I ask, because the clock bug I remembered (and fixed in the master branch after the alien fork) was in there: when you were using the dialog, and switched TC mode, the 'searchTime' variable was not initialized, and a non-zero value there overrules all other TC settings. But this could not happen if you don't use the dialog, and the -st option is not stored in the settings file,and has compiled-in default 0.
The command I ran is

Code: Select all

$ xboard-alien -fcp ./xsjaak -scp ./xsjaak -size middling -tc 0&#58;10 -mg 2
and that reliably reproduces the problem every time. I don't have anything special set in the ~/.xboardrc (although I did use the "save settings" option there after turning off some of the more annoying defaults, like flip board).
Does is also occur with fairymax? I could still not reproduce it, so it might be specific to use of xsjaak (or the compile of xboard). Uninitialized variables are of course notoriously sensitive to what has been going on before, using the stack.
EDIT By the way, the first "time" and "otime" commands sent (to the first engine) are correct, but the first time the second engine gets them the "time" is messed up, and so is "otime" the next time the first engine gets the "time" command.
OK, that is useful, because it suggests that the problem might occur in the routine GetTimeQuota, which is used every move to decide how much time is added to the clock (inc or next session). I haven't found anything suspect, though. Can you post the part of a logfile where it shows the first two moves? (Because it should print some extra info about 'TC strings' parsed by GetTimeQuota, and time-oddsfactors.)a
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Some xboard issues

Post by Evert »

hgm wrote:
Evert wrote:I never use dialog boxes if I can avoid it (in this case, I didn't even know there was one... is it new?)
Only about 4 years (in the Options menu since v4.3.15)...
Ok, so quite recent then. :P
I think I was stuck on 4.2 for a long while, and I don't think I used XBoard at all between 2001 and 2009 or so.
Does is also occur with fairymax?
Yes.
I could still not reproduce it, so it might be specific to use of xsjaak (or the compile of xboard). Uninitialized variables are of course notoriously sensitive to what has been going on before, using the stack.
I'm using a Mac, with the stock (ancient) Apple gcc, so that could be an issue. I didn't bother checking with the more recent gcc on my Linux box, but I could.
OK, that is useful, because it suggests that the problem might occur in the routine GetTimeQuota, which is used every move to decide how much time is added to the clock (inc or next session). I haven't found anything suspect, though. Can you post the part of a logfile where it shows the first two moves? (Because it should print some extra info about 'TC strings' parsed by GetTimeQuota, and time-oddsfactors.)
Sure, this is up to where black receives its first "go" command.

Code: Select all

locale = en_US.UTF-8
recognized 'normal' (-1&#41; as variant normal
recognized 'normal' (-1&#41; as variant normal
recognized 'normal' (-1&#41; as variant normal
shuffleOpenings = 0
Requested font set for list -*-helvetica-medium-r-normal--12-*-*-*-*-*-*-*,-misc-fixed-medium-r-normal--12-*-*-*-*-*-*-*,-*-*-*-*-*-*-12-*-*-*-*-*-*-*
 got list -*-helvetica-medium-r-normal--12-*-*-*-*-*-*-*,-misc-fixed-medium-r-normal--12-*-*-*-*-*-*-*,-*-*-*-*-*-*-12-*-*-*-*-*-*-*, locale en_US.UTF-8
 got charset -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1
 got charset -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1
 got charset -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-2
 got charset -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-3
 got charset -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-4
 got charset -misc-fixed-medium-r-normal--12-87-100-100-c-0-iso8859-5
 got charset -misc-fixed-medium-r-normal--12-87-100-100-c-0-koi8-r
 got charset -misc-fixed-medium-r-normal--12-87-100-100-c-0-iso8859-7
 got charset -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-9
 got charset -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-13
 got charset -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-14
 got charset -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-15
 got charset -misc-fixed-medium-r-normal--12-87-100-100-c-0-jisx0208.1983-0
 got charset -daewoo-gothic-medium-r-normal--12-87-100-100-c-0-ksc5601.1987-0
 got charset -isas-fangsong ti-medium-r-normal--12-87-100-100-c-0-gb2312.1980-0
 got charset -misc-fixed-medium-r-normal--12-87-100-100-c-0-jisx0201.1976-0
 got charset -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso10646-1
Requested font set for list -*-helvetica-bold-r-normal--24-*-*-*-*-*-*-*,-misc-fixed-bold-r-normal--24-*-*-*-*-*-*-*,-*-*-*-*-*-*-24-*-*-*-*-*-*-*
 got list -*-helvetica-bold-r-normal--24-*-*-*-*-*-*-*,-misc-fixed-bold-r-normal--24-*-*-*-*-*-*-*,-*-*-*-*-*-*-24-*-*-*-*-*-*-*, locale en_US.UTF-8
 got charset -adobe-helvetica-bold-r-normal--24-240-75-75-p-138-iso8859-1
 got charset -adobe-helvetica-bold-r-normal--24-240-75-75-p-138-iso8859-1
 got charset -adobe-helvetica-bold-r-normal--24-240-75-75-p-138-iso8859-2
 got charset -adobe-helvetica-bold-r-normal--24-240-75-75-p-138-iso8859-3
 got charset -adobe-helvetica-bold-r-normal--24-240-75-75-p-138-iso8859-4
 got charset -misc-fixed-bold-r-normal--24-173-100-100-c-0-iso8859-5
 got charset -misc-fixed-medium-r-normal--24-173-100-100-c-0-koi8-r
 got charset -misc-fixed-bold-r-normal--24-173-100-100-c-0-iso8859-7
 got charset -adobe-helvetica-bold-r-normal--24-240-75-75-p-138-iso8859-9
 got charset -adobe-helvetica-bold-r-normal--24-240-75-75-p-138-iso8859-13
 got charset -adobe-helvetica-bold-r-normal--24-240-75-75-p-138-iso8859-14
 got charset -adobe-helvetica-bold-r-normal--24-240-75-75-p-138-iso8859-15
 got charset -jis-fixed-medium-r-normal--24-170-100-100-c-240-jisx0208.1983-0
 got charset -daewoo-mincho-medium-r-normal--24-170-100-100-c-240-ksc5601.1987-0
 got charset -isas-song ti-medium-r-normal--24-240-72-72-c-240-gb2312.1980-0
 got charset -sony-fixed-medium-r-normal--24-170-100-100-c-120-jisx0201.1976-0
 got charset -adobe-helvetica-bold-r-normal--24-240-75-75-p-138-iso10646-1
Requested font set for list -*-helvetica-bold-r-normal--10-*-*-*-*-*-*-*,-misc-fixed-bold-r-normal--10-*-*-*-*-*-*-*,-*-*-*-*-*-*-10-*-*-*-*-*-*-*
 got list -*-helvetica-bold-r-normal--10-*-*-*-*-*-*-*,-misc-fixed-bold-r-normal--10-*-*-*-*-*-*-*,-*-*-*-*-*-*-10-*-*-*-*-*-*-*, locale en_US.UTF-8
 got charset -adobe-helvetica-bold-r-normal--10-100-75-75-p-60-iso8859-1
 got charset -adobe-helvetica-bold-r-normal--10-100-75-75-p-60-iso8859-1
 got charset -adobe-helvetica-bold-r-normal--10-100-75-75-p-60-iso8859-2
 got charset -adobe-helvetica-bold-r-normal--10-100-75-75-p-60-iso8859-3
 got charset -adobe-helvetica-bold-r-normal--10-100-75-75-p-60-iso8859-4
 got charset -misc-fixed-bold-r-normal--10-72-100-100-c-0-iso8859-5
 got charset -misc-fixed-medium-r-normal--10-100-75-75-c-60-koi8-r
 got charset -misc-fixed-bold-r-normal--10-72-100-100-c-0-iso8859-7
 got charset -adobe-helvetica-bold-r-normal--10-100-75-75-p-60-iso8859-9
 got charset -adobe-helvetica-bold-r-normal--10-100-75-75-p-60-iso8859-13
 got charset -adobe-helvetica-bold-r-normal--10-100-75-75-p-60-iso8859-14
 got charset -adobe-helvetica-bold-r-normal--10-100-75-75-p-60-iso8859-15
 got charset -jis-fixed-medium-r-normal--10-72-100-100-c-0-jisx0208.1983-0
 got charset -daewoo-gothic-medium-r-normal--10-72-100-100-c-0-ksc5601.1987-0
 got charset -isas-fangsong ti-medium-r-normal--10-72-100-100-c-0-gb2312.1980-0
 got charset -misc-fixed-medium-r-normal--10-72-100-100-c-0-jisx0201.1976-0
 got charset -adobe-helvetica-bold-r-normal--10-100-75-75-p-60-iso10646-1
xboard master-20110618 + xsjaak
Reset&#40;1, 0&#41; from gameMode 0
recognized 'normal' (-1&#41; as variant normal
GameEnds&#40;0, &#40;null&#41;, 2&#41;
shuffleOpenings = 0
TC string = '&#58;40/10'
mps=40 tc=10000 inc=0
TC string = '&#58;40/10'
mps=40 tc=10000 inc=0
743 >first &#58; xboard
protover 2
shuffleOpenings = 0
808 <first &#58; 
808 <first &#58; feature setboard=1 time=1 sigint=0 colors=0 highlight=1 analyze=1 ping=1 nps=1 myname="Sjaak 396M" myversion="&#91;396M Nov 26 2011&#93; &#40;x86_64&#41;"
808 >first &#58; accepted setboard
808 >first &#58; accepted time
808 >first &#58; accepted sigint
808 >first &#58; accepted colors
808 >first &#58; accepted highlight
808 >first &#58; accepted analyze
808 >first &#58; accepted ping
808 >first &#58; accepted nps
808 >first &#58; accepted myname
808 >first &#58; rejected myversion
808 <first &#58; feature variants="normal,berolina,spartan,amazon,knightmate,maharaja,makruk,shatranj,seirawan,capablanca,gothic,10x8+0_janus,courier,xiangqi,grand,10x8+0_fairy,10x10+0_fairy,8x8+2_fairy,fairy"
808 >first &#58; accepted variants
808 <first &#58; feature option="Variant configuration file -file "
808 >first &#58; accepted option
808 <first &#58; feature option="Variant fairy selects -combo Normal &#40;8x8&#41; /// Amazon &#40;8x8&#41; /// Grand &#40;10x10&#41; /// Indian Grand &#40;10x10&#41; /// Maharaja &#40;8x8&#41; /// Pocket Knight &#40;8x8+1&#41; "
808 >first &#58; accepted option
808 <first &#58; feature option="Variant seirawan selects -combo None /// Pocket Knight /// Burmese"
808 >first &#58; accepted option
808 <first &#58; feature done=1
808 >first &#58; accepted done
809 >first &#58; new
random
809 >first &#58; level 40 0&#58;10 0
809 >first &#58; post
809 >first &#58; hard
809 >first &#58; ping 1
Reset&#40;0, 1&#41; from gameMode 0
recognized 'normal' (-1&#41; as variant normal
GameEnds&#40;0, &#40;null&#41;, 2&#41;
824 >first &#58; force
824 >first &#58; ping 2
shuffleOpenings = 0
TC string = '&#58;40/10'
mps=40 tc=10000 inc=0
TC string = '&#58;40/10'
mps=40 tc=10000 inc=0
824 >first &#58; new
random
824 >first &#58; level 40 0&#58;10 0
824 >first &#58; post
824 >first &#58; hard
824 >first &#58; ping 3
831 >first &#58; force
833 >second&#58; xboard
protover 2
834 <first &#58; pong 1
834 <first &#58; pong 2
861 <second&#58; 
861 <second&#58; feature setboard=1 time=1 sigint=0 colors=0 highlight=1 analyze=1 ping=1 nps=1 myname="Sjaak 396M" myversion="&#91;396M Nov 26 2011&#93; &#40;x86_64&#41;"
861 >second&#58; accepted setboard
861 >second&#58; accepted time
861 >second&#58; accepted sigint
861 >second&#58; accepted colors
861 >second&#58; accepted highlight
861 >second&#58; accepted analyze
861 >second&#58; accepted ping
861 >second&#58; accepted nps
861 >second&#58; accepted myname
861 >second&#58; rejected myversion
861 <second&#58; feature variants="normal,berolina,spartan,amazon,knightmate,maharaja,makruk,shatranj,seirawan,capablanca,gothic,10x8+0_janus,courier,xiangqi,grand,10x8+0_fairy,10x10+0_fairy,8x8+2_fairy,fairy"
861 >second&#58; accepted variants
861 <second&#58; feature option="Variant configuration file -file "
861 >second&#58; accepted option
861 <second&#58; feature option="Variant fairy selects -combo Normal &#40;8x8&#41; /// Amazon &#40;8x8&#41; /// Grand &#40;10x10&#41; /// Indian Grand &#40;10x10&#41; /// Maharaja &#40;8x8&#41; /// Pocket Knight &#40;8x8+1&#41; "
861 >second&#58; accepted option
861 <second&#58; feature option="Variant seirawan selects -combo None /// Pocket Knight /// Burmese"
861 >second&#58; accepted option
861 <second&#58; feature done=1
861 >second&#58; accepted done
904 <first &#58; pong 3
906 >second&#58; new
random
906 >second&#58; level 40 0&#58;10 0
906 >second&#58; post
906 >second&#58; hard
906 >second&#58; ping 1
907 >second&#58; force
908 <second&#58; pong 1
New game &#40;1&#41;&#58; Sjaak 396M-Sjaak 396M &#40;w&#41;
918 >first &#58; computer
918 >second&#58; computer
TC string = '&#58;40/10'
mps=40 tc=10000 inc=0
TC string = '&#58;40/10'
mps=40 tc=10000 inc=0
time odds&#58; 1.000000 1.000000 
918 >first &#58; time 1000
918 >first &#58; otim 1000
book hit = &#40;NULL&#41;
918 >first &#58; go
nps&#58; w=-1, b=-1
923 <first &#58;   2   5     0        37  e2-e3 
924 <first &#58;   3   9     0       341 Ng1-f3 Ng8-h6 
924 <first &#58;   4  11     0       477 Ng1-f3 Ng8-f6 Nb1-c3 
929 <first &#58;   5  11     1      2003 Nb1-c3 Ng8-h6  e2-e3 Nb8-c6 
1013 <first &#58;   6   3     9     18296  d2-d4 Ng8-f6 Nb1-c3 Nf6-g4  h2-h3 
1054 <first &#58;   7   8    13     26089  d2-d4 Ng8-h6 Ng1-f3 Nb8-c6 Nb1-c3  d7-d5 
1054 <first &#58; move d2d4 
machine move 0, castling = 7 0 4 7 0 4
trial 3,2,3,4  type 2121
7 0 4 7 0 4 Legality test? d2d4
CoordsToAlgebraic, piece=0 &#40;3,1&#41;-&#40;3,3&#41; - PARTIAL-1=ffffffff
7 0 4 7 0 4 Legality test? d2d4
movetype=21, promochar=0=-
TC string = '&#58;40/10'
mps=40 tc=10000 inc=0
MateTest&#58; K=1, my=16, his=16
move&#58; d2d4
, parse&#58; d4 (
)
repeat test fmm=1 bmm=0 ep=-4, reps=6
1 ep=-3
0 ep=-4
time odds&#58; 1.000000 1.000000 
1055 >second&#58; time 18897857102
1055 >second&#58; otim 986
book hit = &#40;NULL&#41;
1055 >second&#58; d2d4
1055 >second&#58; go
AnimateMove&#58; piece 0 slides from 3,1 to 3,3 
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Some xboard issues

Post by Evert »

Another one, both with XBoard 4.5.3 and xboard-alien.
In variant Janus there's a problem with detecting long castling (which in Janus is king-side castling):
rjnbk4r/pppppnpppp/4bq1j2/5p4/5P4/4BQNJ2/PPPPP1PPPP/RJNB3RK1 b kq - 9 6
When I play to this position from the start of the game, I can play the castling move (king from e8 to i8). However, when I load the position from a file, the castling is not recognised. In actual engine-engine games, it (almost) always gets rejected, leading to faulty illegal move claims by the GUI.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Some xboard issues

Post by hgm »

It seems indeed that the new parser does not account for O-O-O in Janus meaning something different then usual. I made a quick fix, but now that I made it, I doubt that it is the correct one. In fact I am no longer certain what is desired behavior.

In all cases XBoard would recognize e1i1 as castling, and it would pass legality testing in variant janus. What gives trouble is OO castling.

I now made it such that O-O-O means e1i1 / e8i8 in Janus. O-O was already interpreted as e1b1 / e8b8, as a consequence (generalization) of the fact that it means d1b1 / d8b8 on an 8-wide board in variant wildcastle. O-O-O means d1f1 / d8f8 there.

What I doubt is whether we want O-O to mean short castling rather than king-side castling in Janus. Analogy with wildcastle gives the opposite result as analogy with FRC. There also is no consistency now: on output XBoard always prints Ki1 for e1i1, even if it was entered as O-O-O. And it would also accept this.

Perhaps we should consult Reinhard on this.

Another thing:

I just pushed a debug version to the aliennew branch. Could you try to run that for the clock problem? It should print some more info on the routine that adds the time quota.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Some xboard issues

Post by Evert »

Oops, I seem to have missed this before now.
hgm wrote:It seems indeed that the new parser does not account for O-O-O in Janus meaning something different then usual. I made a quick fix, but now that I made it, I doubt that it is the correct one. In fact I am no longer certain what is desired behavior.

In all cases XBoard would recognize e1i1 as castling, and it would pass legality testing in variant janus. What gives trouble is OO castling.

I now made it such that O-O-O means e1i1 / e8i8 in Janus. O-O was already interpreted as e1b1 / e8b8, as a consequence (generalization) of the fact that it means d1b1 / d8b8 on an 8-wide board in variant wildcastle. O-O-O means d1f1 / d8f8 there.

What I doubt is whether we want O-O to mean short castling rather than king-side castling in Janus. Analogy with wildcastle gives the opposite result as analogy with FRC. There also is no consistency now: on output XBoard always prints Ki1 for e1i1, even if it was entered as O-O-O. And it would also accept this.

Perhaps we should consult Reinhard on this.
Interesting. I remember reading that in Janus, O-O is the standard notation for "short" castling while "O-O-O" is "long" castling, but I can't find that now either on chessvariants.org or wikipedia. All I can find now is a note saying that king-side castling is "short" and queen-side castling is "long".
Might be good to have this cleared up. I would much prefer if "O-O" unambiguously meant "king side" (or h-side, or left side from white's perspective, or east-side - well, you know which side of the board I mean) and "O-O-O" meant "queen side" (or whatever, the other side).
It would mean I can remove the hack that swaps the notation for Janus.

I know I could send castle moves as long algebraic rather than SAN, but the reason I prefer always sending castle moves as SAN is that I then don't need special code to handle FRC/CRC...
I just pushed a debug version to the aliennew branch. Could you try to run that for the clock problem? It should print some more info on the routine that adds the time quota.
Will do!

A completely unrelated question/comment (I'd make a new post, but I'm writing this one anyway): is there any systematics in whether variants in XBoard use generic or variant-specific names for pieces? I originally had "ferz" in Makruk, but I changed it to "met", with the rationale that this is the actual name of the piece and it also happens to be the name that XBoard uses. For those exact same reasons, I changed to "Janus" rather than "Archbishop".
However, for Grand chess, the "proper" names for the pieces are "cardinal" and "marshal", but XBoard uses the generic names "Archbishop" and "Chancellor"...
Is it too late to apply some sort of standardisation? I think I would prefer consistently using variant-specific names rather than generic names (but otoh I do prefer "rook" to "chariot" or "boat"), but consistently using either scheme is preferable to things being different for every variant...
Or at the very least, is there some sort of documentation somewhere for the names of pieces across variants?
Or maybe the best solution is to not settle on either (given the already inconsistent set we have now and existing engines that use it) but allow an engine to say "look, this piece that moves like a knight+bishop and that you call an Archbishop, I call a Cardinal" and then XBoard would do some translation when talking to the engines. This could even be done implicitly if the engine sends the starting position using a setup command.
I know it's a relatively minor issue, but I find it annoying. ;)