Sjaak updated (revision 506)

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

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

Sjaak updated (revision 506)

Post by Evert »

I seem to be in the process of releasing updated for all my various programs. Following Jazz and Leonidas, I have also updated Sjaak.

For those who don't know: Sjaak is a general variant engine, similar in spirit to Fairy-Max and Nebiyu. For list of variants, see http://www.eglebbk.dds.nl/program/chess-index.html and http://www.eglebbk.dds.nl/program/chess-variants.html

This is mainly a bug-fix release as far as Sjaak itself is concerned (some incorrect draw detections were fixed, as well as a number of bugs having to do with the propagation of mate scores). The main novelty, however, is only available in Linux (or other UNIX-like operating systems): the command-line referee program Sjef.

Sjef is similar in principle to cutechess-cli, but it is intended for chess variants. It relies on Sjaak internally for handling legality checking and mate detection, so it will only support variants that are supported by Sjaak.

A description of Sjef's various options is here: http://www.eglebbk.dds.nl/program/chess-sjef.html

Sjaak (and Sjef, included in the same download) can be downloaded from http://www.eglebbk.dds.nl/program/chess-download.html

As usual, please report any bugs/errors. As noted above, Sjef does not work on Windows. I will accept patches to remedy this, but I don't have the resources (or time) to do it myself.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Sjaak updated (revision 519)

Post by Evert »

I have released an updated version of Sjaak, revision 519. As usual it's available from http://www.eglebbk.dds.nl/program/chess-download.html

This release fixes a few problems with the previous release:
1. Castling should now work correctly in Fischer random chess (Chess960) as well as other shuffle variants (for instance Capablanca Random).
2. I fixed a crash due to misaligned data structures (affected variants on large boards in 32 bit mode)
3. Work around a compiler issue that caused crashes in the 64 bit version under Windows.

Many thanks to Ola Mikael Hansson, Alexander Schmidt and Daniel Shawul for helping to find bugs and testing whether I'd fixed them yet!

This version has one additional goody: [url = "http://www.chessvariants.org/index/msdi ... itzkychess"]Troitzky Chess[/url] was added as a variant. To play it, open the engine option dialog box in X/WinBoard, load "variants.txt" as the variant configuration file, then select it as the relevant fairy variant. You will need to switch legality testing off.

Included in the download is an updated version of the referee program Sjef (which inherits the above bug fixes from Sjaak). As mentioned earlier, Sjef currently does not work under Windows, but suggestions/help is welcome here.

As per usual, please report any bugs and issues you run into. But most of all: have fun!
enhorning
Posts: 342
Joined: Wed Jan 05, 2011 10:05 pm

Re: Sjaak updated (revision 519)

Post by enhorning »

I don't know if this is a Winboard bug or a Sjaak bug, but they seem to disagree on how to do promotion in Shatranj - two games showing it with Sjaak being both the promoting side and the non-promoting side:

[Event "Computer Chess Game"]
[Site "ENHORNING"]
[Date "2013.02.18"]
[Round "5"]
[White "Pulsar2009-9b"]
[Black "Sjaak 519"]
[Result "1-0"]
[TimeControl "40/1200"]
[Variant "shatranj"]
[Annotator "1. +0.02 1... -0.03"]

1. Nh3 {+0.02/4} Nc6 {-0.03/18 27} 2. Nc3 {-0.15/10 30} Be6 {-0.03/17 17}
3. Nf4 {-0.08/9 30} Bd6 {+0.08/15 22} 4. Nfd5 {-0.04/9 30} Ne5
{+0.09/15 17} 5. d3 {+0.01/9 30} Rc8 {+0.14/14 33} 6. f3 {+0.04/9 30} Nh6
{+0.13/15 31} 7. g3 {+0.08/9 30} f6 {+0.21/15 28} 8. h3 {+0.12/8 30} Qf7
{+0.34/13 17} 9. f4 {+0.18/9 30} Nc6 {+0.30/14 22} 10. a3 {+0.18/8 30} Bg8
{+0.41/12 22} 11. a4 {+0.20/9 30} Nd4 {+0.35/13 22} 12. Ne4 {+0.20/9 30}
Qe6 {+0.39/12 23} 13. Ndc3 {+0.23/9 30} Qf5 {+0.29/14 17} 14. Nd2
{+0.21/9 30} Bb4 {+0.25/16 33} 15. e3 {+0.25/9 30} Bxd2 {+0.30/17 18} 16.
exd4 {+0.29/9 30} Bb4 {+0.22/17 34} 17. a5 {+0.28/9 30} Bd6 {+0.22/16 34}
18. h4 {+0.30/9 30} c6 {+0.29/14 33} 19. Bh3 {+0.27/9 30} Qg4 {+0.82/14 28}
20. a6 {+0.30/9 30} Rb8 {+1.21/13 26} 21. axb7 {+0.53/9 30} Rxb7
{+1.08/15 30} 22. b3 {+0.52/9 30} Qxh3 {+1.01/14 24} 23. Rxh3 {+1.00/9 30}
Nf5 {+1.03/15 26} 24. Ra4 {+1.01/9 30} Be6 {+0.95/14 19} 25. Qf2
{+0.98/9 30} Kc7 {+1.05/14 27} 26. Ne4 {+1.01/8 30} Ra8 {+0.99/15 38} 27.
Nc5 {+1.01/9 30} Rb6 {+0.99/14 23} 28. Rh1 {+1.01/8 30} Bg4 {+0.96/14 39}
29. Na6+ {+1.01/9 30} Kd8 {+0.99/15 39} 30. Nc5 {+0.99/9 30} Bf8
{+0.99/16 39} 31. Rg1 {+0.96/8 30} d6 {+1.01/14 23} 32. Ne4 {+0.92/9 30} d5
{+0.99/15 32} 33. Nc5 {+0.99/9 30} Rb5 {+0.97/15 31} 34. c3 {+1.04/9 30}
Nd6 {+0.85/14 29} 35. Kd2 {+1.11/9 30} Nb7 {+0.88/14 21} 36. Nxb7+
{+1.06/10 30} Rxb7 {+0.86/18 47} 37. Kc2 {+1.06/9 30} Rc8 {+0.82/17 51} 38.
Be3 {+1.16/9 30} Rcc7 {+0.83/17 43} 39. Rga1 {+1.16/9 30} Kc8 {+0.85/18 36}
40. Bc5 {+1.14/9 30} Kb8 {+0.84/18 1:11} 41. b4 {+1.13/9 30} g6
{+0.86/18 23} 42. c4 {+1.09/9 30} Ka8 {+0.90/13 30} 43. Kc3 {+1.12/9 30}
Kb8 {+0.00/14 37} 44. Ra6 {+1.45/9 30} f5 {+0.84/13 26} 45. Bxe7
{+2.17/9 30} Rxe7 {+1.04/15 17} 46. Rxc6 {+2.24/9 30} dxc4 {+0.97/16 29}
47. dxc4 {+2.19/9 30} Re2 {+0.94/16 19} 48. Re1 {+2.19/10 30} Rbe7
{+1.01/16 19} 49. Rf1 {+2.19/10 30} Ra2 {+1.03/16 27} 50. Rf6 {+1.84/10 30}
Bh6 {+1.00/16 22} 51. Kb3 {+1.11/10 30} Ree2 {+1.02/16 22} 52. Qg1
{+1.05/10 30} Reb2+ {+1.94/14 20} 53. Kc3 {+0.13/11 30} Rg2 {+1.69/14 20}
54. Kb3 {+0.14/10 30} Rad2 {+2.07/15 21} 55. Kc3 {+0.12/10 30} Rde2
{+1.73/15 41} 56. Rf3 {-0.16/10 30} Ra2 {+2.32/15 33} 57. Kb3 {+0.16/10 30}
Rgb2+ {+2.27/15 47} 58. Kc3 {+0.20/10 30} Rb1 {+1.98/15 33} 59. Re3
{+0.14/10 30} Ra3+ {+3.05/16 25} 60. Kd2 {-0.92/11 30} Rb2+ {+3.05/17 33}
61. Kc1 {-1.00/12 30} Rxe3 {+3.05/18 46} 62. Kxb2 {-1.00/11 30} Rxg3
{+2.55/17 46} 63. h5 {-0.92/11 30} Kc8 {+2.15/15 34} 64. hxg6 {+0.92/11 30}
hxg6 {+2.07/15 21} 65. Rxg6 {+0.16/11 30} Rg2+ {+1.99/16 25} 66. Kb3
{+0.17/12 30} Bxf4 {+1.95/18 54} 67. Rf6 {+0.16/11 30} Rg3+ {+1.71/16 30}
68. Ka4 {+0.19/11 30} Rxg1 {+1.68/17 38} 69. Rxf5 {+0.21/11 30} Bh6
{+1.08/16 23} 70. Kb5 {+0.31/11 30} Be2 {+1.08/17 31} 71. Re5 {+0.36/11 30}
a6+ {+1.01/16 44} 72. Kc5 {+0.54/11 30} Bg4 {+1.07/16 17} 73. Kb6
{+0.55/11 30} Bf4 {+1.01/16 23} 74. Kxa6 {+0.99/11 30} Bd2 {+0.96/16 32}
75. Kb5 {+1.01/11 30} Kd7 {+0.81/17 48} 76. Kc5 {+1.04/11 30} Rg2
{+0.83/16 23} 77. b5 {+1.12/11 30} Bf4 {+0.84/15 17} 78. Kd5 {+1.15/11 30}
Rg1 {+0.49/16 31} 79. b6 {+1.27/11 30} Bd2 {+0.00/16 47} 80. Rg5
{+1.45/11 30} Ke7 {+0.00/18 20} 81. b7 {+1.82/11 30} Kf6 {+0.44/17 17} 82.
Rg8 {+1.87/12 30} Kf5 {+0.42/16 15} 83. Rf8+ {+1.90/11 30} Kg5
{+0.39/16 29} 84. b8=Q {+1.91/11 30}
{False illegal-move claim} 1-0

[Event "Computer Chess Game"]
[Site "ENHORNING"]
[Date "2013.02.18"]
[Round "6"]
[White "Sjaak 519"]
[Black "Pulsar2009-9b"]
[Result "0-1"]
[TimeControl "40/1200"]
[Variant "shatranj"]
[Annotator "1. +0.03 2... -0.07"]

1. Bd3 {+0.03/17} Bd6 2. f3 {+0.05/17 20} Nf6 {-0.07/10 30} 3. Nc3
{+0.12/17 26} Nc6 {-0.11/9 30} 4. Be3 {+0.09/16 26} h6 {+0.02/9 30} 5. Nh3
{+0.12/16 16} b6 {-0.02/8 30} 6. f4 {+0.15/15 26} a6 {+0.07/9 30} 7. Qf2
{+0.10/14 16} e6 {+0.10/9 30} 8. Rf1 {+0.08/14 24} h5 {+0.12/9 30} 9. Rc1
{+0.14/13 26} h4 {+0.19/8 30} 10. Qg1 {+0.06/13 18} b5 {+0.18/8 30} 11. Ng5
{+0.00/12 26} g6 {+0.17/8 30} 12. Nh3 {+0.13/12 27} b4 {+0.25/8 30} 13. Na4
{+0.09/14 24} a5 {+0.24/9 30} 14. Ke1 {+0.06/13 33} Bf8 {+0.25/8 30} 15. b3
{+0.15/13 21} Ne4 {+0.25/9 30} 16. Nc5 {+0.19/12 18} Nxc5 {+0.26/9 30} 17.
Bxc5 {-0.08/15 21} a4 {+0.27/9 30} 18. Nf2 {-0.20/14 21} d6 {+0.31/9 30}
19. Be3 {-0.15/15 22} axb3 {+0.32/9 30} 20. axb3 {-0.16/16 51} Nd4
{+0.31/9 30} 21. Ng4 {-0.08/15 25} h3 {+0.32/9 30} 22. g3 {-0.02/15 22} Ra2
{+0.16/9 30} 23. Kd1 {-0.05/16 37} Ra5 {+0.12/9 30} 24. Re1 {+0.00/16 37}
Bh6 {-0.03/8 30} 25. Nf2 {+0.60/14 25} Bxf4 {+0.29/9 30} 26. gxf4
{+1.08/15 29} Rh4 {+0.01/9 30} 27. Bf1 {+1.34/14 22} Rxf4 {-0.02/8 30} 28.
Nd3 {+1.21/17 43} Rh4 {-0.07/9 30} 29. Nxb4 {+1.32/14 21} Ra8 {-0.09/9 30}
30. Nd3 {+1.64/15 23} e5 {-0.09/8 30} 31. Qf2 {+1.47/17 45} e4 {-0.64/9 30}
32. Qg3 {+1.66/18 34} exd3 {-0.69/9 30} 33. Qxh4 {+1.65/19 22} dxc2+
{-0.89/10 30} 34. Rxc2 Nxc2 {-0.71/10 30} 35. Kxc2 {+1.72/19 34} Ra5
{-0.71/10 30} 36. Qg3 {+1.67/19 44} Rh5 {-0.72/10 30} 37. Ra1 {+1.66/19 58}
f6 {-0.74/10 30} 38. Ra4 {+1.66/18 53} g5 {-1.06/10 30} 39. Qf4
{+1.69/19 44} gxf4 {-0.54/10 30} 40. Rxf4 {+1.65/19 43} Ke7 {-0.54/10 30}
41. Rf3 {+1.66/17 19} c6 {-0.54/10 30} 42. Rxh3 {+1.78/17 17} Rf5
{-0.52/11 30} 43. Rf3 {+1.84/17 22} Rxf3 {-0.21/11 30} 44. exf3
{+1.77/20 24} Ke6 {-0.19/12 30} 45. Kd3 {+1.78/20 20} Ke5 {-0.11/12 30} 46.
Bc1 {+1.76/20 18} f5 {-0.07/13 30} 47. Ke3 {+1.78/20 22} f4+ {-0.11/13 30}
48. Kd3 {+1.78/21 25} c5 {-0.10/13 30} 49. h3 {+1.79/22 34} Qf7
{-0.10/13 30} 50. Kc3 {+1.81/22 29} d5 {-0.09/13 30} 51. Ba3 {+1.91/21 31}
Kd6 {-0.08/13 30} 52. d3 {+1.97/20 25} Be6 {-0.02/13 30} 53. d4
{+1.96/23 21} cxd4+ {+0.06/13 30} 54. Kxd4 {+2.26/24 33} Qe8 {-0.32/13 30}
55. Bd3 {+2.26/25 18} Qd7 {-0.37/13 30} 56. h4 {+2.46/24 20} Qe8
{-0.43/13 30} 57. b4 {+2.54/26 23} Bc4 {-0.72/14 30} 58. h5 {+2.51/27 35}
Qf7 {-0.76/14 30} 59. b5 {+2.54/27 37} Qg8 {-0.76/14 30} 60. b6
{+2.56/26 18} Qh7 {-0.76/14 30} 61. b7 {+2.57/26 38} Qg8 {-0.76/14 30}
{Xboard: Forfeit due to invalid move: b7b8f (a1a1) res=24} 0-1
User avatar
hgm
Posts: 27811
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Sjaak updated (revision 519)

Post by hgm »

This is a Sjaak problem. The Shatranj General is represented by Q, not by F. (And the Elephants by B). This was a pre-existing standard, in use by ICC and Pulsar (and perhaps other egines that could play Shatranj on ICC), so I had to conform to it, no matter how much I dislike it.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Sjaak updated (revision 519)

Post by Evert »

Ah, right, I remember that now. I think people have used "inbetween" or somesuch to work around the problem before.

I'll think about a work-around that I'm happy with (the easiest one I'm unfortunately not happy with).
enhorning
Posts: 342
Joined: Wed Jan 05, 2011 10:05 pm

Re: Sjaak updated (revision 519)

Post by enhorning »

Any solution for the Shatranj promotions yet? I was hoping to start the tournament in the coming week.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Sjaak updated (revision 519)

Post by Evert »

Ok, revision 523 (from http://www.eglebbk.dds.nl/program/chess-download.html) has a work-around for Shatranj (and a few evaluation changes; hopefully these are ok, quick tests suggests they are). It's otherwise the same as the previous version (it adds Embassy chess as a supported variant, but there are no other new features).
User avatar
geots
Posts: 4790
Joined: Sat Mar 11, 2006 12:42 am

Re: Sjaak updated (revision 519)

Post by geots »

Evert wrote:Ok, revision 523 (from http://www.eglebbk.dds.nl/program/chess-download.html) has a work-around for Shatranj (and a few evaluation changes; hopefully these are ok, quick tests suggests they are). It's otherwise the same as the previous version (it adds Embassy chess as a supported variant, but there are no other new features).




Evert, can you help me here a moment. Heading to get some sleep shortly. So I probably won't see your answer till after I wake. So let me go ahead now and thank you in advance.

I need to be sure I state this the correct way and not confuse you with what I am after. I have 5.06 and 5.19 loaded. Haven't really had a chance to test them much yet, and it looks like I will be going with the new one r524. I am fully aware of the different games they play other than chess. Before I spend time testing it good, I need to know your take on it. (And this is where I need to get it right)

I don't know if the other games are more important to you than its chess game. And if you are actually putting more emphasis on the other games it plays- and not nearly as concerned about how it does in chess. Or, OTOH- are you going all out to improve its chess play, and that it is just as much, or more important to you than the other games. I say this because,maybe I am wrong, but I get the impression that its chess game is kind of an afterthought- for lack of a better term. Do you want and hope testing groups will test Sjaak, and are you really serious about improving it over the
long run. I know it is not a 2500 or 2700 engine, but I test lots of them around 2100 and 2200.

Or maybe you would rather Leonidas be tested instead. That is not really as inviting- as you seem to come out with more Sjaak updates. So tell me- if you are seriously committed to improving its chess game over the long haul- then I am just as serious about testing it for you. I just need to know.



Best regards,

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

Re: Sjaak updated (revision 519)

Post by Evert »

Hi George,
geots wrote: I don't know if the other games are more important to you than its chess game. And if you are actually putting more emphasis on the other games it plays- and not nearly as concerned about how it does in chess. Or, OTOH- are you going all out to improve its chess play, and that it is just as much, or more important to you than the other games. I say this because,maybe I am wrong, but I get the impression that its chess game is kind of an afterthought- for lack of a better term. Do you want and hope testing groups will test Sjaak, and are you really serious about improving it over the
long run. I know it is not a 2500 or 2700 engine, but I test lots of them around 2100 and 2200.
Long answer follows directly below, but the short summary is this: for the purpose of testing Sjaak's strength compared to other chess engines, just ignore that it plays other variants. It is a chess engine, and my goal with it is really not that different from most other programs out there: to improve the strength over time and make newer (and stronger) versions available.

There is an important philosophical difference to the design of Sjaak though:
I try to keep Sjaak very neutral with respect to which variants are more "important", so to say. Chess is certainly not an afterthought, but neither are any of the other variants.

For me, it's partly an experiment: how strong can I make it play Chess, without explicitly putting in any chess-specific knowledge? To put that into perspective: Sjaak knows that material combinations like KBK and even KNNK are drawn, and I can easily make it realise that KRKB is drawn as well (in fact, I thought it already did know, but it seems not). Jazz and Leonidas know this too, but they have a line of code that says "if KNNK, then draw". Sjaak derives that (and similar) knowledge from the rules of the game (the way the pieces move).

Of course how it knows these things is not so interesting for someone running a test match, but hopefully this gives you an idea of what I'm aiming for with respect to Sjaak's chess playing ability. There is no doubt that I could make it much stronger by simply adding chess-specific knowledge by hand, but that's an "easy" path I will not take.

Having said all that, I actually use regular chess games during development to test how well it plays and whether new evaluation parameters are an improvement or not, on the assumption that if it plays better chess, it will play better Spartan, Capablanca, Gothic, Knightmate, etc. In that sense chess is more important than the other variants, and most of my testing is to make it stronger at regular chess.

I do hope that people will test it, but I can understand if they feel somewhat reluctant: Sjaak is not very strong, and very probably never will be. Disappointing for me, but there you go: to each his (or her) hobby. It's not up to me to make demands on other people's time.
Or maybe you would rather Leonidas be tested instead. That is not really as inviting- as you seem to come out with more Sjaak updates. So tell me- if you are seriously committed to improving its chess game over the long haul- then I am just as serious about testing it for you. I just need to know.
I find it hard to make a personal decision on which of my programs should be tested, and I prefer to leave that up to the testers themselves. If it were up to me, I'd have all of them tested (Jazz, Leonidas and Sjaak). I'm serious about improving all of them (and just so there is no confusion on the point: leaving aside the issue of variants, they're not simply different versions of the same program with slightly differently tuned parameters).

The main trigger for the cascade of recent Sjaak versions have to do with (critical) bug fixes for particular variants though (specifically Fischer random and Shatranj). For regular chess, there will be no difference at all, so these more frequent releases don't indicate "improvement" in terms of strength.

Specifically regarding Leonidas, however: I don't know when I'll release an updated version for that, but the development version I have is much stronger than the last release. Competing in the Spartan Chess tournament revealed some annoying bugs that I have since fixed. I don't want to come out with new versions every other day though, so I'd rather wait until it has seen some further improvements.
User avatar
geots
Posts: 4790
Joined: Sat Mar 11, 2006 12:42 am

Re: Sjaak updated (revision 519)

Post by geots »

Thank you, Evert. A very good detailed answer to a "not so easy to answer question". It deserves to be tested based on what you have said here. Only one thing- please let us know when releases are just "bug fixes", or primarily strength improvements. IOW, the version you prefer to be tested, if that is possible.



Thanks again,

george