Symbolic vs KingSlayer

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Symbolic vs KingSlayer

Post by sje »

I've started a Symbolic vs KingSlayer 100 game match with a 5 minute SD time control. I note that KingSlayer reports itself to xboard as Simple 0.0 via the feature response, so that's what shows up in the PGN output.

After six rounds, Symbolic has scored 1 win / 3 lose / 2 draw (1-3-2) for -120 elo.

A couple of games:
[pgn][Event "XBoard Event"]
[Site "gail"]
[Date "2015-10-01"]
[Round "1"]
[White "Symbolic 2015-09-30"]
[Black "Simple 0.0"]
[Result "0-1"]
[FinalFEN "5R2/1k2p3/8/4q1K1/6P1/8/7r/1q6 w - - 4 61"]
[Termination "White resigns"]

1. d4 d5 2. c4 dxc4 3. e4 b5 4. a4 c6 5. Nc3 b4 6. Nb1 Be6 7. Nf3 h6 8. Be3 Nf6 9. e5 Nd5 10. Bd2 g5 11. Bxc4 g4 12. Ng1 a5 13.
h3 gxh3 14. Nxh3 Rg8 15. g3 Qb6 16. Bc1 Nd7 17. Qd3 O-O-O 18. Nd2 c5 19. Qf3 Qb7 20. Nb3 cxd4 21. Bf4 Bg7 22. Nxa5 Qa8 23. Bxd5
Bxd5 24. Rc1+ Kb8 25. e6+ Ne5 26. Bxe5+ Bxe5 27. Qe2 Qxa5 28. Qxe5+ Ka8 29. exf7 b3+ 30. Kf1 Bg2+ 31. Kxg2 Qxe5 32. fxg8=N Rxg8
33. Rhd1 h5 34. Re1 Qd5+ 35. Kg1 d3 36. Rc3 d2 37. Rd1 Qe4 38. Kf1 Qg4 39. Rxd2 Qxh3+ 40. Kg1 Qe6 41. Rd4 Qe5 42. Rdc4 Rd8 43.
Rc5 Qe1+ 44. Kg2 Qe4+ 45. Kh2 Qxa4 46. Kg2 Qe4+ 47. f3 Rd2+ 48. Kh3 Qe6+ 49. g4 hxg4+ 50. fxg4 Rxb2 51. Ra5+ Kb7 52. Rb5+ Ka6
53. Rbc5 Qh6+ 54. Rh5 Qf6 55. Rf5 Qxc3+ 56. Kh4 Rh2+ 57. Kg5 b2 58. Rf8 b1=Q 59. Ra8+ Kb7 60. Rf8 Qe5+ 0-1[/pgn]

[pgn][Event "XBoard Event"]
[Site "gail"]
[Date "2015-10-01"]
[Round "6"]
[White "Simple 0.0"]
[Black "Symbolic 2015-09-30"]
[Result "0-1"]
[FinalFEN "3K3k/8/2q2b2/6p1/5r2/p4P2/8/8 w - - 6 74"]
[Termination "White is checkmated"]

1. e4 d6 2. Nc3 e5 3. Nf3 c5 4. Bd3 Be6 5. O-O Nc6 6. Kh1 Nf6 7. Ng5 Qd7 8. Nxe6 fxe6 9. a3 Be7 10. g4 h6 11. Rg1 O-O 12. Rg2
Nh7 13. b3 Bh4 14. Qe1 Ng5 15. Nd1 Nd4 16. Bb2 Ngf3 17. Qf1 Nxd2 18. Qe1 N2f3 19. Qf1 Qc7 20. Nc3 a6 21. Ne2 Kh8 22. Bc3 b5 23.
Bb2 Qb7 24. Nxd4 exd4 25. Bc1 c4 26. bxc4 bxc4 27. Bxc4 Qxe4 28. Bd3 Qe1 29. Bb2 Qxf1+ 30. Rxf1 d5 31. a4 e5 32. Bf5 Rf6 33. a5
Rc6 34. Rd1 Rb8 35. Ba1 Rc5 36. h3 Rcb5 37. c4 dxc4 38. Be4 Ng5 39. f3 Nxh3 40. Rf1 Rxa5 41. Bf5 Nf4 42. Rh2 Bg3 43. Rc2 Nd5
44. Rb2 Rxb2 45. Bxb2 Ne3 46. Rg1 Bf2 47. Rc1 Nxf5 48. gxf5 c3 49. Bxc3 dxc3 50. Rxc3 Rc5 51. Rb3 a5 52. Kg2 Rc2 53. Kh3 a4 54.
Ra3 Rc4 55. Ra2 Bd4 56. Kg3 Bc5 57. Rh2 Rf4 58. Rc2 Bf8 59. Kf2 Rxf5 60. Ke3 a3 61. Ke4 Rf4+ 62. Kxe5 g5 63. Kd5 Bg7 64. Ra2
Bb2 65. Kc6 h5 66. Kd6 h4 67. Kc6 h3 68. Kd6 h2 69. Ra1 Bxa1 70. Ke7 h1=Q 71. Kd7 Qh6 72. Ke7 Qc6 73. Kd8 Bf6# 0-1[/pgn]
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Symbolic vs KingSlayer

Post by hgm »

Ah yes, I still have to change the name in the source itself. The name Simple was already used by Remi Coulom.

I am now trying KingSlayer - FairyMax games with King Slayer's drawishness detection switched on. (So it knows that KNK is not +3 etc.) This seems to hardly have any effect in 40/1min games; they are almost all decided in the middle game, and hardly ever reach the stage where the leading side only has a single Pawn. Of the 30 games I watched so far I only saw one KRNPKRN game where King Slayer (the KRN side) without hesitation traded Rooks and then gave N for P to draw. Not sure it would have lost otherwise, but its King was pretty far from the passer's path. I guess I need either longer TC or a better opponent to get enough near-equal end-games that this evaluation term starts to matter.

GNU Chess 5.07 might be a good opponent, because IIRC it randomizes its moves. (And it used to be about the strength of Joker.) Can that still be obtained somewhere?
Last edited by hgm on Thu Oct 01, 2015 5:34 pm, edited 1 time in total.
User avatar
Guenther
Posts: 4606
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: Symbolic vs KingSlayer

Post by Guenther »

hgm wrote:Ah yes, I still have to change the name in the source itself. The name Simple was already used by Remi Coulom.
Will KingSlayer be a follow-up of Joker?
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Symbolic vs KingSlayer

Post by hgm »

I have not decided that yet. If it would get stronger than Joker it would automatically count as successor, I suppose. The primary design goal was not strength but a code without any frills that only served to speed it up. It was basically an answer to the question "is there a simple engine that can beat Fairy-Max". I had not intended it to go much beyond that. And as it is meant more as a code example, I had not really planned on tuning its eval parameters.

My original successor of Joker was Spartacus, but I haven't worked on that for about 5 years now, and the source code seems to have forked somehow, as I now have different executables that show different erroneous behavior, and I cannot match them to any source code that I can find. Spartacus was intended to be an attack-map-based engine that could handle a variety of board sizes, from 12x8 to 10x10. The attack map once worked for 8x8 boards, but quickly after that changing the board size broke it. And by now my ideas for how to do an attack map have evolved a lot, and I don't like the original system anymore.

King Slayer is very much based on an 8x8 board, so it cannot really replace Spartacus. To make its creation not a complete waste of time I build one unvommon feature in it, however: every move can specify an e.p. victim, and this victim can be handled in addition to the normal victim on its to-square. That would make it suitable for playing variants that have double capture, such as Might-Lion Chess or Werewolf Chess. This could be an incentive to develop it further.
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Symbolic vs KingSlayer

Post by Daniel Anulliero »

hgm wrote:Ah yes, I still have to change the name in the source itself. The name Simple was already used by Remi Coulom.

I am now trying KingSlayer - FairyMax games with King Slayer's drawishness detection switched on. (So it knows that KNK is not +3 etc.) This seems to hardly have any effect in 40/1min games; they are almost all decided in the middle game, and hardly ever reach the stage where the leading side only has a single Pawn. Of the 30 games I watched so far I only saw one KRNPKRN game where King Slayer (the KRN side) without hesitation traded Rooks and then gave N for P to draw. Not sure it would have lost otherwise, but its King was pretty far from the passer's path. I guess I need either longer TC or a better opponent to get enough near-equal end-games that this evaluation term starts to matter.

GNU Chess 5.07 might be a good opponent, because IIRC it randomizes its moves. (And it used to be about the strength of Joker.) Can that still be obtained somewhere?
http://ftp.gnu.org/gnu/chess/
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Underpromotion

Post by sje »

In the following position:
[d]k2r2r1/4pP2/7p/4q3/P2p4/1p4PN/1P3PK1/2R4R w - - 0 32[/d]
Symbolic played 32. fxg8=N and KingSlayer replied with 32... Rxg8. But looking at the code, KingSlayer was fortunate to have captured the knight as it can't correctly parse an underpromotion; if it had left the knight alone then the program possibly would have eventually lost by making an illegal move or refusing a legal move by Symbolic.
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: Underpromotion

Post by Robert Pope »

sje wrote:In the following position:
[d]k2r2r1/4pP2/7p/4q3/P2p4/1p4PN/1P3PK1/2R4R w - - 0 32[/d]
Symbolic played 32. fxg8=N and KingSlayer replied with 32... Rxg8. But looking at the code, KingSlayer was fortunate to have captured the knight as it can't correctly parse an underpromotion; if it had left the knight alone then the program possibly would have eventually lost by making an illegal move or refusing a legal move by Symbolic.
Is there some actual search/evaluation logic that caused it to promote to knight instead of queen here, or was it just random ordering of the promotions?
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Underpromotion

Post by sje »

Robert Pope wrote:Is there some actual search/evaluation logic that caused it to promote to knight instead of queen here, or was it just random ordering of the promotions?
Most likely, the program considered all promotions to have the same value here, so it didn't matter which promotion was chosen.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Underpromotion

Post by hgm »

Indeed, that is still one of the TODOs. I guess at the stage where I am now much more important than debugging more eval terms. But of course when King Slayer would have the option to not capture the Knight, Symbolic would not have promoted to Knight. It could of course choose topromote to Knight because it would promote with check then, rather than using it as a "don't care".

King Slayer performs moves at game level by comparing the from- and to-square of moves coming from the move generator with those of the input move. The 'flags' field of the generated moves is not compared, because in general it would be quite tedious to derive the correct value of it. (As e.p.captures, double pushes and castlings would also have non-zero flags, while they are already uniquely determined by their from- and to-square.) In addition currently not all under-promotions are generated by King Slayer, so there might not be an exact match.

I guess the best way out would be to let King Slayer generate all under-promotions, and in the input promotion suffic determine the desired flags code, and consider the flags code only when inputFlags is non-zero. That seems simpler than substituting the Queen in the firs-matching move for the chosen piece (which requires adjustment of the hash key and incremental pstEval).
PK
Posts: 893
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Underpromotion

Post by PK »

just for the record: promised simple engine based on Sungorus is available at https://github.com/nescitus/Rodent_II (source code only). I guess it is 2500+ if You need an opponent in this range.