Chess variant tournament: Capablanca and similar

Discussion of computer chess matches and engine tournaments.

Moderator: Ras

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

Re: Perft(6) of some variants confirmed by third-party engin

Post by Evert »

Daniel Shawul wrote: Xiangqi's many rules frustrated me but it seems now fairymax, sjaak and makulit all can play it so I will try again.
Just to point out that Sjaak is very weak at Xiangqi (but also very untuned) and on some level it's more a "yes it can do it" proof-of-concept.

The problems are that it doesn't know about defensive pieces (guards and ministers are restricted in where they can go and can't be used to launch an attack on the enemy king) and it disallows all repetitions in the search because it's too hard to encode the more detailed rules (and if I did that I'd simplify it as well, but that probably leads to a conflict with XBoard which I'm not sure how to deal with properly; maybe the same as I do it now).
User avatar
hgm
Posts: 28409
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Perft(6) of some variants confirmed by third-party engin

Post by hgm »

A workable approximation is to score any move to a repeated position as -500, except when it is a check evasion (where you don't treat it as special, but just play it). This is about the minimum you need; it prevents perpetual checking and chasing unless the alternative is so bad that you would lose anyway. It also avoids the problem with using checks to force the opponent to repeat first.

A more fundamental solution is to save an in-check bit in the stack of Zobrist keys, and when a repeat is detected, test if one or both sides were in check for every position in between, and set the result accordingly.

As to perpetual chasing: games between equally strong engines where one does not know anything about chasing, and one that implements the full rules, end in an illegal perpetual chase in ~13% of the games. As about half these games would be lost anyway (and likely more, because an engine that thinks the repeat is a draw would not engage in one if they are ahead), this would cost you some 6% score = 45 Elo. Significant, but not disastrous.

A poor-man's solution that I have not tested would be to score moves that repeat and are not caught as perpetual checks as if they lose a Pawn. Then you would only repeat if all opportunities to break out of the loop would lose you more, suggesting that you are being chased.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Chess variant tournament: Capablanca and similar

Post by Evert »

Ok, I've generated some more perft results (although the Grand Chess one is still working... takes ages to get to depth 6).

I get a different number for Courier chess, but we probably disagree about the correct starting position. ;)
User avatar
hgm
Posts: 28409
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Chess variant tournament: Capablanca and similar

Post by hgm »

Well, the Courier starting position is a debatable issue. It was described to me as a game where the first few move were prescribed. Not that Fairy-Max would obey that prescription...

I could change the starting position in WinBoard, and consider it as a game always starting from a setup position. (So that it will be loaded into the engine.) This is what I do in Makruk, to account for the irregular placement of Pawns. Courier was implemented much earlier, before I had thought up that solution. Problem is that WinBoard just stores arrays of back-rank pieces, and not whole boards; everything else (such as the Cannons in Xiangqi) has to be set up by explicit code. Changing the Pawn rank in Makruk was only a single assignment. For Courier you would have to place and delete several pieces.

At the time I figured there were so many ways to start games from user-supplied positions that I need not bother.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Chess variant tournament: Capablanca and similar

Post by Evert »

hgm wrote:Well, the Courier starting position is a debatable issue. It was described to me as a game where the first few move were prescribed.
Yes, that's the description I got as well (from chessvariants.org, I should check what Pritchard says in his book).

The first problem with that description is what the hell "starting position" means if the rules then say that I have to move particular pieces to particular squares before I'm allowed to start thinking. It'd be the same as saying that a chess game starts with an empty board and I have to start by dropping my rooks in the corners, the knights next to the rooks on the back rank, the bishops next to those, the queen on a square of its own colour and the king on the remaining back-rank square and then fill the second rank with pawns.

The second problem is that the prescribed "moves" are all illegal under the normal movement rules of the game (three double pawn pushes and an orthogonal leap of two squares by the ferz).
I could change the starting position in WinBoard, and consider it as a game always starting from a setup position. (So that it will be loaded into the engine.) This is what I do in Makruk, to account for the irregular placement of Pawns.
I think that's a good idea. That's what has to be done manually now anyway to make sure any arbitrary engine works correctly.

Courier was implemented much earlier, before I had thought up that solution. Problem is that WinBoard just stores arrays of back-rank pieces, and not whole boards; everything else (such as the Cannons in Xiangqi) has to be set up by explicit code. Changing the Pawn rank in Makruk was only a single assignment. For Courier you would have to place and delete several pieces.
I actually had code like that in Jazz, from before it could read FEN strings. I pulled it all out the other day and just replaced it with a startup FEN. Much cleaner and easier in the long run (not that it matters that much for Jazz, since it can't play variants). :)
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Chess variant tournament: Capablanca and similar

Post by Daniel Shawul »

Evert wrote:Ok, I've generated some more perft results (although the Grand Chess one is still working... takes ages to get to depth 6).
Indeed some of the variants with 12x12 board size take long time. Yesterday I thought I finished generating all the perfts in the alien version, but then it turned out I have set allow_king_captures on so the numbers were wrong. With legality checking it will take more time. I will try to do it again.
I get a different number for Courier chess, but we probably disagree about the correct starting position. ;)
This is my start position:

Code: Select all

rnebmkfwbenr/pppppppppppp/12/12/12/12/PPPPPPPPPPPP/RNEBMKFWBENR w - - 0 1
Both NebiyuChess and NebiyuAlien (which has a different implementation of move generation) get the same perft numbers.

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

Re: Chess variant tournament: Capablanca and similar

Post by Evert »

Daniel Shawul wrote:
Evert wrote:Ok, I've generated some more perft results (although the Grand Chess one is still working... takes ages to get to depth 6).
Indeed some of the variants with 12x12 board size take long time. Yesterday I thought I finished generating all the perfts in the alien version, but then it turned out I have set allow_king_captures on so the numbers were wrong. With legality checking it will take more time. I will try to do it again.
I interrupted the calculation, it was draining my laptop battery too quickly. I may set it going again overnight, but I figured that it probably wouldn't be that useful to other people if it takes that long to generate... better to have it at lower depth in different positions (ok, so I don't have that either).
I get a different number for Courier chess, but we probably disagree about the correct starting position. ;)
This is my start position:

Code: Select all

rnebmkfwbenr/pppppppppppp/12/12/12/12/PPPPPPPPPPPP/RNEBMKFWBENR w - - 0 1
Both NebiyuChess and NebiyuAlien (which has a different implementation of move generation) get the same perft numbers.
I'm sure it's fine. I should probably add a note to the number to indicate the starting position used for it. It's this, by the way:

Code: Select all

rnebmk1wbenr/1ppppp1pppp1/6f5/p5p4p/P5P4P/6F5/1PPPPP1PPPP1/RNEBMK1WBENR w - -"
enhorning
Posts: 342
Joined: Wed Jan 05, 2011 10:05 pm

Re: Chess variant tournament: Capablanca and similar

Post by enhorning »

HGM, do you have versions of TSCP-Gothic for me? Or should I just run without it?

Anybody wanting me to use an updated version of their program - I am planning to start the tournament thursday night / early friday morning European time, so would need to know about newer version and be able to download them by then.

Grand Chess - are there many programs supporting this? Out of the variants with Capablanca compounds, that is my favourite, but I thought not many programs played it - I might have the wrong impression though.

Courier Chess - ancientchess.com writes this: "The game begins with each player making four peculiar moves: The three pawns in front of the rooks and queen move two spaces forward; the queen also moves two spaces directly forward, to stand right behind the advanced queen pawn. The two players then play alternately, each time moving one piece in accordance with its normal move."

So, to me, sounds like one might as well treat the position after these four prescribed and peculiar moves as the starting position - no sense in forcing the engine to play them. (Of course, if an engine starts with everything on the first two ranks, and wants to make different moves than the prescribed ones, supplying a starting FEN solves that.)

XiangQi - as I am starting to run low on variants of Fide Chess (that have sufficient amount of engines for them), I am considering running both this and Shogi at some point in the future. Will be quite a while away though.
User avatar
hgm
Posts: 28409
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Chess variant tournament: Capablanca and similar

Post by hgm »

Indeed, the Ferz move is a problem. The Pawns can be simply moved there in two steps. Funny thing is that in Ouk (the Cambodian version of Makruk) the Ferz does have a two-step-forward initial move!
enhorning wrote:HGM, do you have versions of TSCP-Gothic for me? Or should I just run without it?
OK, I'll get to it immediately.
User avatar
hgm
Posts: 28409
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Chess variant tournament: Capablanca and similar

Post by hgm »

Btw, Martin Sedlak's engine Heretic is still missing from your list.