Winboard 4.8.0b and atomic chess variant

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

Moderator: Ras

Ferdy
Posts: 4848
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Winboard 4.8.0b and atomic chess variant

Post by Ferdy »

I am developing an engine to play this variant using WB as test gui.
In one of those tests I encountered a situation where WB adjudicates the game as draw (bare king) even if one side's king was already captured and the other side still has a king.

Code: Select all

id                    engine   games     pts   pct  fwc   bk  ilc  imo   tf
 1             Mabagsik v1.4      72    53.5  74.3    0    1    0    0    1
 2                  OLITHINK      24     9.5  39.6    0    1    0    0    0
 3      Pulsar2009-9b atomic      24     7.0  29.2    2    0    0    0    0
 4           KKFChess v2.6.6      24     2.0   8.3    2    0    5    0    0

:: Legend ::
fwc   : False win claim
bk    : King destroyed but bare king
ilc   : False illegal-move claim
imo   : Forfeit due to invalid move
tf    : Time forfeit

games : 72
file  : atom_tour2.pgn
Black to play and captures the king. Is it right that the result is a draw?
[d]8/8/8/8/5k2/8/1qK5/8 b - - 5 60

GUI setting:

Code: Select all

Test legality is on
Verify engine claims is on
Detect mates is on
The game record.

Code: Select all

[Event "Computer Chess Game"]
[Site ""]
[Date "2015.12.15"]
[Round "21"]
[White "OLITHINK"]
[Black "Mabagsik v1.4"]
[Result "1/2-1/2"]
[TimeControl "180+3"]
[Variant "atomic"]
[Annotator "2. +0.47   1... +0.52"]

1. e4 Nf6 {+0.52/13 9} 2. f3 {+0.47/9 6} Nc6 {+0.05/12 9} 3. Nh3
{+0.66/10 6} g5 {-0.74/12 8} 4. Nc3 {+0.69/9 6} Bg7 {-1.37/11 8} 5. e5
{+3.00/9 7} Nb4 {-0.76/11 8} 6. e6 {+3.19/10 7} fxe6 {-2.50/12 8} 7. Nd5
{+3.27/10 7} e6 {-2.23/12 7} 8. Nxc7 {+3.29/10 7} Nxc2 {-2.70/14 7} 9. Bb5
{+3.38/11 7} O-O {-2.70/12 7} 10. Bd3 {+3.25/10 7} h6 {-2.48/13 7} 11. Bh7
{+3.24/11 7} Kh8 {-2.27/14 7} 12. d4 {+3.19/10 8} g4 {-2.19/12 7} 13. Ng1
{+3.08/10 8} e5 {-0.53/12 6} 14. f4 {+1.40/10 8} Rfe8 {+1.15/12 6} 15. d5
{+0.62/10 8} exf4 {+2.03/14 6} 16. Be4 {-0.09/10 8} Bxb2 {+1.84/12 6} 17.
Ne2 {+0.15/11 7} Rac8 {+2.10/13 6} 18. O-O {+0.90/10 7} Rf8 {+2.07/12 6}
19. Rf7 {+1.00/11 7} Rxf7 {+2.15/12 6} 20. d6 {+0.97/11 7} g3 {+2.12/11 6}
21. hxg3 {+1.05/12 7} Rg8 {+2.05/10 6} 22. g4 {+1.08/12 7} Rf8 {+1.84/8 6}
23. Bf5 {+1.03/12 6} Kg7 {+1.71/11 6} 24. Nd4 {+1.06/11 6} a6 {+1.97/9 6}
25. Kf2 {+1.09/12 6} h5 {+1.86/9 6} 26. gxh5 {+1.06/12 6} Kf6 {+1.95/6 5}
27. Ne6 {+1.07/11 6} Rg8 {+2.05/5 5} 28. Ng5 {+1.04/10 6} Rh8 {+1.95/6 5}
29. Nf3 {+1.06/11 6} Rh1 {+1.94/6 5} 30. Ne5 {+1.05/10 6} Rf1 {+2.06/6 5}
31. Ke3 {+1.05/11 5} Rf3 {+2.12/3 5} 32. Kd4 {+1.02/12 5} Rd3 {+2.19/7 5}
33. Ke4 {+0.95/12 5} Rd4 {+2.17/5 5} 34. Kf3 {+1.04/11 5} Rf4 {+2.05/6 5}
35. Ke2 {+1.04/11 5} Rf3 {+2.17/5 5} 36. a4 {+1.04/11 5} Re3 {+2.33/7 5}
37. Kf2 {+1.03/12 5} Rg3 {+2.21/5 5} 38. Ke2 {+1.04/11 5} b5 {+2.39/6 5}
39. axb5 {+0.99/11 5} Re3 {+2.58/6 5} 40. Kd2 {+0.99/12 5} Rd3 {+2.41/6 5}
41. Kc2 {+0.92/12 5} Rxd6 {+2.60/8 5} 42. Kb3 {+1.39/13 5} a5 {+4.11/19 5}
43. Ka4 {+1.34/14 4} d5 {+5.67/20 4} 44. Bg6 {+1.22/14 4} d4 {+12.96/19 4}
45. Bd3 {+1.12/14 4} Kg5 {+6.96/17 5} 46. Kb3 {+1.01/13 4} a4 {+12.93/16 4}
47. Ka3 {+0.91/14 4} Kf6 {+13.10/18 4} 48. Kb2 {+0.56/14 4} a3
{+13.32/14 4} 49. Ka2 {-1.63/14 4} Kg5 {+13.46/17 4} 50. Kb1 {-1.63/13 4}
a2 {+14.77/14 4} 51. Ka1 {-10.55/15 4} Kf4 {+14.96/13 4} 52. Bf5
{-10.75/15 4} d3 {+14.81/10 4} 53. Bg4 {-299.84/15 4} d2 {+299.85/14 3} 54.
Bd1 {-299.86/15 4} Ke3 {+299.87/15 4} 55. Bf3 {-299.88/14 4} d1=Q
{+299.89/15 4} 56. Bxd1 {-299.90/15 4} Kf4 {+299.91/15 4} 57. Kb2
{-299.92/15 4} a1=Q {+299.93/15 4} 58. Kc2 {-299.94/13 4} Qc3
{+299.95/16 4} 59. Kb1 {-299.96/14 4} Qb2 {+299.97/18 3} 60. Kc2
{-299.98/14 4} Qxc2 {+299.99/13}
{Xboard adjudication: King destroyed but bare king} 1/2-1/2
User avatar
hgm
Posts: 28361
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Winboard 4.8.0b and atomic chess variant

Post by hgm »

This is indeed very wrong. I am puzzled as to why it could happen. It seems to me WinBoard should already have adjudicated a checkmate on the move before. Instead it allows the checkmated King to move, and be captured. And I guess the "bare King" adjustment of the winning side to a draw should be moved backwards. I probably assumed there was no possibility that you could win in a regular way when you only have a King, but this is an example.

I will investigate it.
Ferdy
Posts: 4848
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Winboard 4.8.0b and atomic chess variant

Post by Ferdy »

hgm wrote:This is indeed very wrong. I am puzzled as to why it could happen. It seems to me WinBoard should already have adjudicated a checkmate on the move before. Instead it allows the checkmated King to move, and be captured. And I guess the "bare King" adjustment of the winning side to a draw should be moved backwards. I probably assumed there was no possibility that you could win in a regular way when you only have a King, but this is an example.

I will investigate it.
Thanks, the ending rule of this variant is foolish :).
User avatar
hgm
Posts: 28361
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Winboard 4.8.0b and atomic chess variant

Post by hgm »

Well, I vaguely remember there were some subtle rule differences on some ICS. Like that it is illegal to move into check, but legal to leave your King susceptible to destruction by an explosion on a neighboring square. (But illegal to bow up your own King.) So it is tricky, as I must not make rules that conflict with ICS rules, to keep WinBoard useful as ICS client.
Ferdy
Posts: 4848
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Winboard 4.8.0b and atomic chess variant

Post by Ferdy »

hgm wrote:Well, I vaguely remember there were some subtle rule differences on some ICS. Like that it is illegal to move into check, but legal to leave your King susceptible to destruction by an explosion on a neighboring square. (But illegal to bow up your own King.) So it is tricky, as I must not make rules that conflict with ICS rules, to keep WinBoard useful as ICS client.
It is legal to move into check because the goal of the game is to remove the opp king either by explosion or by a capture. Stalemate is rare because the king that still have an empty square to move to, can move there regardless if that is attacked by the opponent. Once it moves there the opponent will capture it to win.
Black to play and lose.
[d]7k/6R1/8/5K2/8/8/8/8 b - - 0 1
User avatar
hgm
Posts: 28361
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Winboard 4.8.0b and atomic chess variant

Post by hgm »

OK, that explains why it did not adjudicate checkmate. I checked it out, and it seems that in the general GameEnd routine I put code to correct any win to a draw when the winner has <= 1 piece on the board (if there are no holdings, and it is not Suicide/Giveaway). I guess I was thinking that a win with only a single piece must have been a forfeit, and the single King would not have provided winning potential. In Atomic this is obviously not true, as your case shows.
User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: Winboard 4.8.0b and atomic chess variant

Post by gbtami »

Ferdy wrote:
hgm wrote:Well, I vaguely remember there were some subtle rule differences on some ICS. Like that it is illegal to move into check, but legal to leave your King susceptible to destruction by an explosion on a neighboring square. (But illegal to bow up your own King.) So it is tricky, as I must not make rules that conflict with ICS rules, to keep WinBoard useful as ICS client.
It is legal to move into check because the goal of the game is to remove the opp king either by explosion or by a capture. Stalemate is rare because the king that still have an empty square to move to, can move there regardless if that is attacked by the opponent. Once it moves there the opponent will capture it to win.
Black to play and lose.
[d]7k/6R1/8/5K2/8/8/8/8 b - - 0 1
It's lose on ICC http://www6.chessclub.com/help/atomic
but draw on FICS.

bsetup atomic
Entering setup mode.
The game type is now atomic chess.
You are not observing any games.
bsetup fen 7k/6R1/8/5K2/8/8/8/8
bsetup tomove black
It is now black's turn to move.
Kg8
Illegal move (Kg8).
User avatar
hgm
Posts: 28361
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Winboard 4.8.0b and atomic chess variant

Post by hgm »

That is what I meant. The rules are not the same everywhere, so I have to be careful not to break WinBoard as Atomic client for either of those servers. So on FICS the shown game would have been declared a checkmate earlier.

But that just means WinBoard should not adjudicate checkmate in that position. Exempting Atomic from the bare King win -> draw correction is a safe change, however. I guess I could do better, to still apply it sometimes, but that is probably not worth it.
Ferdy
Posts: 4848
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Winboard 4.8.0b and atomic chess variant

Post by Ferdy »

gbtami wrote:It's lose on ICC http://www6.chessclub.com/help/atomic
but draw on FICS.
Now I understand why Pulsar without "fics" command line option, would
* castle out of check
[d]rnbqr1k1/pppp1ppp/8/8/8/Q7/PPPP1PPP/R3KBNR w KQ - 0 1
White king castles long.

Code: Select all

ICC Help: atomic

Atomic chess (wild 27) is a chess variant in which any capture also destroys the capturing piece (or pawn) and any piece (but NOT pawns) in a one square radius (horizontal, vertical, or diagonal). There is no chain reaction -- only direct captures detonate. For captures en passant, ground-zero of the explosion is the square on the sixth rank upon which the capturing pawn lands.

Win by capturing or destroying your opponent's king without simultaneously destroying your own king. You may not make a move which destroys your own king. Check and checkmate are not recognized; you may move into check, castle out of check, or castle through check.
Ferdy
Posts: 4848
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Winboard 4.8.0b and atomic chess variant

Post by Ferdy »

hgm wrote:That is what I meant. The rules are not the same everywhere, so I have to be careful not to break WinBoard as Atomic client for either of those servers. So on FICS the shown game would have been declared a checkmate earlier.

But that just means WinBoard should not adjudicate checkmate in that position. Exempting Atomic from the bare King win -> draw correction is a safe change, however. I guess I could do better, to still apply it sometimes, but that is probably not worth it.
Played an atomic chess game attempting to implement fics rule.
WB adjudicate the game as false win claim even though that king was already mated.

Black to play.
[d]r4bn1/4p2r/2n2pp1/p2p2Pk/1p4Qp/2P1P3/PP1P3P/R1B1K2R b KQ - 2 20

So the claim verification in WB follows the icc rule, that is destroying your opponent's king before claiming a win.

WB setting:
Test legality on
Verify engine claims is on
Detect mates is on

Is there an option in WB such that the claim will be based on fics rule?

Fics rule:
http://www.freechess.org/Help/HelpFiles/atomic.html

The game.

Code: Select all

[Event "Computer Chess Game"]
[Site ""]
[Date "2015.12.18"]
[Round "5"]
[White "Mabagsik v1.11 64bit fics atomic"]
[Black "Pulsar2009-9b fics atomic"]
[Result "0-1"]
[TimeControl "300+5"]
[Variant "atomic"]
[Annotator "2. +1.10   3... -0.78"]

1. Nf3 f6 2. Nc3 {+1.10/14 15} c6 3. e3 {+0.93/14 14} d5 {-0.78/8 17} 4.
Nd4 {+1.12/14 14} h5 {-0.44/8 18} 5. Ncb5 {+4.28/16 10} cxb5 {-1.60/8 17}
6. Nb5 {+4.80/16 12} Bg4 {-4.27/8 14} 7. f3 {+5.05/16 13} Qc8 {-4.59/8 17}
8. c3 {+5.16/15 13} a5 {-5.17/7 17} 9. Qa4 {+6.01/17 12} Qc4 {-4.81/8 14}
10. Bxc4 {+6.13/17 12} b5 {-5.15/9 16} 11. Qa3 {+10.03/18 9} b4
{-5.55/9 13} 12. Qa4 {+11.33/17 9} Nc6 {-5.57/9 12} 13. Qb5 {+299.83/17 11}
Kf7 {-5.95/8 14} 14. fxg4 {+299.87/17 9} g6 {-6.46/8 12} 15. Qb7
{+299.89/21 10} Kg7 {-5.82/8 12} 16. Qd7 {+299.91/24 10} Rh7 {-74.96/8 11}
17. Qe6 {+299.93/26 9} Kh6 {-74.97/8 11} 18. g4 {+299.95/21 10} h4
{-74.98/8 12} 19. g5 {+299.97/34 8} Kh5 {-74.99/9 12} 20. Qg4 {+299.99/13}
{False win claim: 'White mates'} 0-1