Symbolic vs KingSlayer

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Underpromotion

Post by hgm »

I pushed a commit now that will handle input of under-promotions, and will consider all promotions in search (was only Q and N). So King Slayer can now also solve the following position:

[d]5q2/4P2k/8/5N1K/8/8/8/8 w - - 0 1
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Underpromotion

Post by sje »

[d]5q2/4P2k/8/5N1K/8/8/8/8 w - - 0 1[/d]
[pgn][Event "Unknown event"]
[Site "gail"]
[Date "2015-10-01"]
[Round "-"]
[White "Unknown player"]
[Black "Unknown player"]
[Result "1-0"]
[FEN "5q2/4P2k/8/5N1K/8/8/8/8 w - - 0 1"]
1. exf8=B Kg8 2. Ba3 Kf7 3. Kg4 Ke6 4. Ne3 Kd7 5. Kf5 Kc6 6. Ke6 Kb5 7. Kd5 Kb6 8. Bd6 Ka6 9. Kc6 Ka7 10. Bc7 Ka8 11. Nc4 Ka7 12. Nb6 Ka6 13. Bb8 Ka5 14. Nd5 Ka4 15. Be5 Ka5 16. Bd4 Ka6 17. Nb4+ Ka5 18. Kc5 Ka4 19. Kc4 Ka5 20. Ba7 Ka4 21. Bb6 Ka3 22. Nd3 Ka4 23. Nb2+ Ka3 24. Kc3 Ka2 25. Bc5 Ka1 26. Kb3 Kb1 27. Be3 Ka1 28. Nc4 Kb1 29. Na3+ Ka1 30. Bd4#[/pgn]
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Symbolic vs KingSlayer

Post by sje »

The match has completed. Symbolic scored 15 wins 72 losses 13 draws for -225 elo.

The games: https://dl.dropboxusercontent.com/u/316 ... 001.pgn.gz
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

The 100th game

Post by sje »

The 100th game:
[pgn][Event "XBoard Event"]
[Site "gail"]
[Date "2015-10-01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+ 122. Ke1 Kc3 123. Qc6+ Kb2 124. Qb6 Kb1 125. Qg1 b2 126. Qa7 Kc2 127. Qa4+ Kc1 128. Qc6+ Kb1 129. Qa8 Qd4 130. Ke2 Kc2 131. Qc6+ Kb3 132. Qb5+ Ka3 133. Qa5+ Qa4 134. Qc5+ Ka2 135. Qd5+ Ka1 136. Qe5 Qb4 137. Kf1 Qc4+ 138. Kg1 Qa4 139. Kf1 Qc6 140. Kg1 Qf3 141. Qa5+ Kb1 142. Qd2 Qg4+ 143. Kh2 Qe4 144. Kh3 Ka2 145. Qa5+ Kb3 146. Qb5+ Kc2 147. Qc5+ Kd1 148. Qh5+ Ke1 149. Qa5+ Kf2 150. Qa2 Qe2 151. Kh4 Kf1 152. Kg3 Qd3+ 153. Kf4 b1=Q 154. Qxb1+ Qxb1 155. Ke5 Ke2 156. Kd5 Kd3 157. Kc5 Ke4 158. Kc4 Qb6 159. Kc3 Qb5 160. Kc2 Kd4 161. Kd1 Kd3 162. Kc1 Kc3 163. Kd1 Qf1#
User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Symbolic vs KingSlayer

Post by hgm »

sje wrote:The match has completed. Symbolic scored 15 wins 72 losses 13 draws for -225 elo.
That is a better result for King Slayer than I had expected. The results they both had against Fairy-Max suggested a difference of only about 100 Elo. And I had expected the King Slayer vs Fairy-Max result to be exaggerated because they have very similar search trees and evaluation. This shows how unreliable test results against a much weaker opponent are. (Although it has also been claimed that losses against a weaker opponent are very useful for discovering blind spots and bugs in an engine.) There were 5 promotions to Knight, and in two cases the Knight survived! (In game 1 and 99, where the Knight was immediately captured, this occurred in the same position.)

King Slayer is really only playing by game-phase-interpolated PST here. Its Pawn structure, King safety, mobility eval, end-game knowledge have all been switched off by default (and might not yet work when you switch them on). The PST are generated from a few parameters per piece: centralization, forward pushing, 6th- and 7th-rank bonuses, rook-file penalty. So it does know about Rook-on-7th (which Fairy-Max doesn't), and the Knights have some forward push (while they just centralize in Fairy-Max). King Slayer is not particularly fast: it has no piece list, so it has to scan the board to find its own pieces. (It reliably keeps track of the location of pieces of which it only has one copy, though, such as Kings, which helps in check detection.) Its eval is not as fast is it could be, considering it is PST only, as the Pawn-structure and King-shield eval is still calculated, (and hashed), even if it is not used. So it is not yet the utmost one could do with a PST-only engine.

Btw, the PGN saved by Symbolic does not contain a result comment, so it is difficult to see why the result was what it was (e.g. checkmate, illegal move, false claim or time forfeit for 1-0, and rep-draw, 50-move or insufficient material for 1/2-1/2). Perhaps you should rely on XBoard saving the games, as this very useful info would then be added.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

The PGN Termination tag

Post by sje »

hgm wrote:Btw, the PGN saved by Symbolic does not contain a result comment, so it is difficult to see why the result was what it was (e.g. checkmate, illegal move, false claim or time forfeit for 1-0, and rep-draw, 50-move or insufficient material for 1/2-1/2). Perhaps you should rely on XBoard saving the games, as this very useful info would then be added.

Code: Select all

sje$ grep Termination 20151001.pgn
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "Black draws by the fifty move rule"]
[Termination "White draws by the fifty move rule"]
[Termination "White resigns"]
[Termination "White is checkmated"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White draws by position repetition"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "White draws by the fifty move rule"]
[Termination "Black is checkmated"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "Black is checkmated"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "Black is checkmated"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "Black is checkmated"]
[Termination "White draws by insufficient material"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "Black is checkmated"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White wins on time"]
[Termination "White is checkmated"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "Black is checkmated"]
[Termination "White is checkmated"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White draws by position repetition"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "White is checkmated"]
[Termination "Black draws by insufficient material"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "Black draws by the fifty move rule"]
[Termination "Black resigns"]
[Termination "White draws by the fifty move rule"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "Black is checkmated"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "Black draws by the fifty move rule"]
[Termination "Black resigns"]
[Termination "Black draws by the fifty move rule"]
[Termination "Black resigns"]
[Termination "Black is checkmated"]
[Termination "Black resigns"]
[Termination "Black draws by the fifty move rule"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "Black draws by insufficient material"]
[Termination "White resigns"]
[Termination "Black resigns"]
[Termination "Black is checkmated"]
[Termination "Black resigns"]
[Termination "White resigns"]
[Termination "White is checkmated"]
User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: The PGN Termination tag

Post by hgm »

Ah, you have a termination tag. Is that standard? Currently it is not on the XBoard menu for displying in the header lines of a multi-game PGN file. Should it be there?
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: The PGN Termination tag

Post by sje »

hgm wrote:Ah, you have a termination tag. Is that standard? Currently it is not on the XBoard menu for displying in the header lines of a multi-game PGN file. Should it be there?
It's better that once-per-game information appear in a tag pair than in a comment. This allows better usage of PGN tools which are equipped to operate with tags and not with comments.
User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: The PGN Termination tag

Post by hgm »

Agreed. But if Symbolic is the only program that saves information in a tag with this name it would not be very useful. It is more important that everyone does it the same way than that some do it in the best way...

The PGN-creating tools I am aware of write this as a comment. XBoard does allow you to display that comment in the header lines of the game list. But it does not allow you to display the Termination tag there. I don't know which GUIs would.

Breaking 95% of all existing software just because that would be more convenient for the 3% of the tools that know how to handle tags, but not comments, would not be a very good idea...
mvk
Posts: 589
Joined: Tue Jun 04, 2013 10:15 pm

Re: Underpromotion

Post by mvk »

PK wrote: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.
Mini Rodent 0.13 is very simple and strong. Very impressive, well done! +9-0=1 against kingslayer.

I had to change one thing to make it run on my Mac:

eval.cpp

Code: Select all

static const int phase_value[7] = { 0, 1, 1, 2, 4, 0, 0 };
^^^^^^ remove this
Without that, the compiler gives an error that phase_value was first declared global and then static. It appears to me that non-static is what you wanted, because this array is used in several files.
[Account deleted]