[d]r2q3r/pp3pk1/2n1bbP1/3pN3/3P4/1BN4P/PP1Q1P2/R3R1K1 b Q -
In some datset I encounter this position indicating white can long castle. So must be chess960.
(there is also a pv included going: pv h8h6 e5g4 h6h3 e1e6 f7e6 g1a1 c6d4 b3d5 e6d5 g4f6).
Is there any consensus about which rook is the castling rook?
Both rooks could have moved. Both rooks could be the "castling" rook.
(I know this "Q" should actually be an "A" but anyway... what to do as a programmer)
unclear 960 position regarding castling
Moderator: Ras
-
ericlangedijk
- Posts: 69
- Joined: Thu Aug 08, 2013 5:13 pm
-
Tibono
- Posts: 174
- Joined: Sat Aug 01, 2015 6:16 pm
- Location: France
- Full name: Eric Bonneau
Re: unclear 960 position regarding castling
If I understand correctly the rules, e1-Rook cannot be involved in a castling move. Because the King must be placed between both rooks in the starting position, hence either the King or the e1-Rook moved. If the King moved, any castling is ruled out. If e1-Rook moved, and King didn't, then a1-Rook is a candidate, assuming it didn't move so far. Castling also requires there is no piece in-between, hence the PV is including e1e6 Rook move.
Hope this helps...
Hope this helps...
-
mar
- Posts: 2690
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: unclear 960 position regarding castling
Tibono is right - white cannot possibly castle here, no matter if FRC or standard chess => the FEN has invalid castling rights
btw KQ is perfectly valid in X-FEN notation in Chess960, rook letters are used in S-FEN
btw KQ is perfectly valid in X-FEN notation in Chess960, rook letters are used in S-FEN
-
Aleks Peshkov
- Posts: 995
- Joined: Sun Nov 19, 2006 9:16 pm
- Location: Russia
- Full name: Aleks Peshkov
Re: unclear 960 position regarding castling
https://en.wikipedia.org/wiki/X-FEN
the castling rights provided by this as default are related to the outermost rook of the affected side
-
ericlangedijk
- Posts: 69
- Joined: Thu Aug 08, 2013 5:13 pm
Re: unclear 960 position regarding castling
Use the outer most rooks. Ok! Thanks!
@Tibono: Not quite! With the given fen both rooks can be candidates for being the "castling" rook.
In the example it is possible (if we don't know the "outer rook" rule and assume the king was inbetween the rooks) that:
1) the king did not move.
2) the e1 rook is the castling rook and the a1 rook was originally on h1.
3) the a1 rook is the castling rook and the e1 rook was originally on h1
@Tibono: Not quite! With the given fen both rooks can be candidates for being the "castling" rook.
In the example it is possible (if we don't know the "outer rook" rule and assume the king was inbetween the rooks) that:
1) the king did not move.
2) the e1 rook is the castling rook and the a1 rook was originally on h1.
3) the a1 rook is the castling rook and the e1 rook was originally on h1
-
abulmo2
- Posts: 493
- Joined: Fri Dec 16, 2016 11:04 am
- Location: France
- Full name: Richard Delorme
Re: unclear 960 position regarding castling
I agree with you. The X-FEN notation is broken and cannot represent any chess 960 positions after having played some moves. Obviously, you cannot describe the case you describe in 2) with it. Fortunately, the S-FEN notation is the de facto standard used by UCI chess 960 engines & GUIs.ericlangedijk wrote: ↑Tue May 12, 2026 4:09 pm Use the outer most rooks. Ok! Thanks!
@Tibono: Not quite! With the given fen both rooks can be candidates for being the "castling" rook.
In the example it is possible (if we don't know the "outer rook" rule and assume the king was inbetween the rooks) that:
1) the king did not move.
2) the e1 rook is the castling rook and the a1 rook was originally on h1.
3) the a1 rook is the castling rook and the e1 rook was originally on h1
Richard Delorme
-
syzygy
- Posts: 5977
- Joined: Tue Feb 28, 2012 11:56 pm
Re: unclear 960 position regarding castling
It seems to me the FEN has valid castling rights, it's just not legal to castle immediately (also because it's black turn to move
Once the rook on e1 has moved away from rank 1, white can play o-o-o with king ending up on c1 and the rook on a1 ending up on d1.
-
syzygy
- Posts: 5977
- Joined: Tue Feb 28, 2012 11:56 pm
Re: unclear 960 position regarding castling
I guess you're right that this FEN is simply ambiguous. It's clear that the king has not moved and that therefore the rook starting on h1 has moved, but we can't tell from the FEN if the rook moved from h1 to e1 (with the other rook starting on a1) or from h1 to a1 (with the other rook starting on e1).ericlangedijk wrote: ↑Tue May 12, 2026 1:01 pm [d]r2q3r/pp3pk1/2n1bbP1/3pN3/3P4/1BN4P/PP1Q1P2/R3R1K1 b Q -
In some datset I encounter this position indicating white can long castle. So must be chess960.
(there is also a pv included going: pv h8h6 e5g4 h6h3 e1e6 f7e6 g1a1 c6d4 b3d5 e6d5 g4f6).
Is there any consensus about which rook is the castling rook?
Both rooks could have moved. Both rooks could be the "castling" rook.
(I know this "Q" should actually be an "A" but anyway... what to do as a programmer)
edit: Aha, Aleks Peshkov is correct that the X-FEN standard handles this properly, but I think a bit more has to be cited:
So indeed Q refers to the outermost rook. If instead white can long-castle with the rook on e1, then it would have said E instead of Q.The new and crucial point of the arrangement is that the castling rights provided by this as default are related to the outermost rook of the affected side. If instead an inner rook is associated with that right, the traditional castling tag will be replaced by the file letter of the involved rook, using upper case for White.
So the X-FEN is both unambiguous and standard compliant (assuming Wikipedia correctly reflects the standard).
-
mar
- Posts: 2690
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: unclear 960 position regarding castling
sure, if you take the X-FEN parsing rules literally, you'll get an S-FEN with A.syzygy wrote: ↑Wed May 13, 2026 12:51 am It seems to me the FEN has valid castling rights, it's just not legal to castle immediately (also because it's black turn to move).
Once the rook on e1 has moved away from rank 1, white can play o-o-o with king ending up on c1 and the rook on a1 ending up on d1.
this is probably a standard chess position with wrong castling rights, otherwise I'd like to see that rook manoeuvre from h1
-
ericlangedijk
- Posts: 69
- Joined: Thu Aug 08, 2013 5:13 pm
Re: unclear 960 position regarding castling
[d]1bb2rkr/pp2pppp/2q1n3/3n4/3p4/1NN1P3/PP2QPPP/1BB2RKR w KQkq -
I adjusted my code using the outermost rook in case of a KQkq castling string.
Also I changed my move parsing a bit.
Scanning through the dataset I was left with 2 errors. One of these is the above position.
The pv from this board was: c3d5 c6d5 f1d1 f8d8 g1g1 g8g8 b3d4 e6d4 d1d4 d5e5
where the g8g8 move is a castling move
Not sure yet if I will make my move parsing even more lenient...
I adjusted my code using the outermost rook in case of a KQkq castling string.
Also I changed my move parsing a bit.
Scanning through the dataset I was left with 2 errors. One of these is the above position.
The pv from this board was: c3d5 c6d5 f1d1 f8d8 g1g1 g8g8 b3d4 e6d4 d1d4 d5e5
where the g8g8 move is a castling move
Not sure yet if I will make my move parsing even more lenient...