A note on Castling Rights ... and e.p.

Endgame analysis using tablebases, EGTB generation, exchange, sharing, discussions, etc..
Post Reply
guyhaw
Posts: 489
Joined: Sat Jan 21, 2006 10:43 am
Sign-up code: 10159
Location: Reading, UK
Contact:

A note on Castling Rights ... and e.p.

Post by guyhaw »

Tim Krabbe - excellent author, writer on chess, diarist and chess player - notes that the latest-known castling was on the 48th move of a game, and indeed, that no castling rights have survived to the 49th move of any game.

This information will probably postpone the date by which we have positions with castling rights in the EGTs.

Incidentally, I don't understand how we can have EGTs which are 'correct in the context of the e.p.-rule' without holding positions where there is an e.p.-capture opportunity.

g
syzygy
Posts: 166
Joined: Sun Aug 03, 2008 4:02 pm

Re: A note on Castling Rights ... and e.p.

Post by syzygy »

guyhaw wrote:Incidentally, I don't understand how we can have EGTs which are 'correct in the context of the e.p.-rule' without holding positions where there is an e.p.-capture opportunity.
Construct an EGT with e.p.-positions and throw out the e.p.-positions (leaving the values for all other positions unchanged). Now you have an EGT that handles e.p. correctly. To probe an e.p.-position, the probing code has to do a 1-ply search. (The 1-ply search can be slightly optimized, but that's not so important.)

So EGTs like that exist. The next step is to realize that EGTs can also be constructed without ever storing the e.p.-positions at all, namely by doing a 1-ply search at the appropriate moment. What helps here is that moving into an e.p.-position is a move from one pawn slice into another pawn slice. So moves moving into e.p. only have to be handled once at the start of a pawn slice, together with other pawn moves, captures, promotions.
guyhaw
Posts: 489
Joined: Sat Jan 21, 2006 10:43 am
Sign-up code: 10159
Location: Reading, UK
Contact:

e.p. positions

Post by guyhaw »

Tfy explanation. It never crossed my mind that someone would create an indexing-scheme and EGT to accommodate e.p.-positions (necessary if they are to be taken into consideration) and then not include them in the published EGT.

I don't see the point: this would invalidate most data-mining done on the EGT - stats, zugs, most interesting weird stuff - at very little %-saving in space.

Castling rights define 2^4 'zones' of which the biggest one is 'no castling rights' of course.
e.p.-capture available (or not) doubles this, and of course the biggest zone of the 32 is 'no castling rights, no e.p.-capture on'.
[ Changing castling-rights and not accepting the e.p.-capture opportunity are irreversable moves and ought to reset the move-count to zero, but FIDE haven't got round to that. It will affect DTZ EGTs if they do! ]

e.p.-capture 'on' also increases the number of types of zug: after two 'null moves', position 3 (without the e.p.-capture) =/= position 1 (with the e.p. capture).
This opens the door to a little fun with some very unusual positions.
g
syzygy
Posts: 166
Joined: Sun Aug 03, 2008 4:02 pm

Re: e.p. positions

Post by syzygy »

guyhaw wrote:Tfy explanation. It never crossed my mind that someone would create an indexing-scheme and EGT to accommodate e.p.-positions (necessary if they are to be taken into consideration) and then not include them in the published EGT.
Well, you haven't understood. It is not necessary to index them. Please read the full explanation, including the second paragraph. The first paragraph is only a proof of existence for didactive purposes.

Of course one can still choose to index and store them. In a generator based on pawn slices, this would give separate e.p.-slices. It can be done, but it seems to me it would only complicate the coding in return for increased table size.
I don't see the point: this would invalidate most data-mining done on the EGT - stats, zugs, most interesting weird stuff - at very little %-saving in space.
Why 'invalidate'? Whatever indexing scheme you choose, it will have an effect on statistics.

Can you explain how an e.p.-position itself can be a zugzwang position? An e.p.-position has no real "other-side-to-move" equivalent. I also don't see how e.p.-positions can contain anything particularly weird in any other way. I'm not convinced you have considered your argument very well.
[ Changing castling-rights and not accepting the e.p.-capture opportunity are irreversable moves and ought to reset the move-count to zero, but FIDE haven't got round to that. It will affect DTZ EGTs if they do! ]
Resetting the move-counter after not accepting an e.p.-capture would needlessly complicate the 50-move rule. I'm sure FIDE will never consider such a rule change.

The 50-move rule forces players to choose for 'progress'. Accepting or not accepting an e.p.-capture is not a choice for progress but happens automatically.
e.p.-capture 'on' also increases the number of types of zug: after two 'null moves', position 3 (without the e.p.-capture) =/= position 1 (with the e.p. capture).
This opens the door to a little fun with some very unusual positions.
General data mining on tablebase data is in any case unable to find anything interesting about these positions. You need detailed knowledge of the indexing scheme to identify e.p.-type positions. Once you have that, it's not much more difficult to extract the required information from a tablebase without special e.p.-indexing.
notnale
Posts: 43
Joined: Sun Aug 17, 2008 6:36 am

Re: A note on Castling Rights ... and e.p.

Post by notnale »

On the other hand, there is a compelling case that castling should reset the 50 move counter. I assume that the only reason that they didn't put it in the rules is that it never comes up in actual play.
guyhaw
Posts: 489
Joined: Sat Jan 21, 2006 10:43 am
Sign-up code: 10159
Location: Reading, UK
Contact:

Re: A note on Castling Rights ... and e.p.

Post by guyhaw »

My proposal (to FIDE as it were) is that any move which irreversably moves the game 'on' should reset the move-count to zero.
Making an e.p.-capture (involves P-push and capture and) obviously resets the move-counter and moves the game on.
But rejecting an e.p.-capture opportunity also moves the game on: that e.p.-capture-offer cannot be repeated in the game.
Maybe pedantic as it only lops one ply off the ply-count but even so ...

I would reset the move-count to zero not only when castling takes place but when castling rights change. There are 4 of these at the start.
As previously stated, no castling rights are known to have survived until the 49th move.

The concept of a zugzwang is that, if you were able to pass the move to the opponent, you would be half- or a whole-point better off.
We can formalise this idea by including in the set of available moves a 'null move'.
To be fair, both sides would have to have the same number of null moves available, and this number should be finite.
You might ask what all the fuss is about: White plays a null move, Black responds with a null move, so no progress has been made.
Not so if the first position involved an e.p.-capture opportunity. Null move removes e.p.-opportunity, so the 3rd position is not the 1st position.

Some examples (enjoy!):
1) KPPKPP 8/1p6/1k6/1Pp5/2K5/2P5/8/8 w - c6 ... currently draw, passed over becomes win for White, passed back becomes loss for White
In this case, you can correctly argue that White would not play the null move as it finishes up with a loss rather than a draw.
2) KPPPPPKPPPP 8/8/8/2p5/1pP1p3/kP2P3/Pp1P4/1K6 b – c3 ... (found by Noam Elkies), loss - win - draw ... worth play the null move
3) KRPKPP 8/8/8/8/pP6/p7/k1K5/1R6 b - b3 ... loss - draw - draw ... as zug, but n.b., not a Mutual zug
Note that with less moves, White gets a better score.
4) KPPPKP 8/8/8/8/1pP5/kP6/P7/K7 b - c3 ... ditto, same as '3'
5) KNPKPP 8/3K4/8/3k4/1p3Pp1/8/3N4/8 b - f3 ... draw-win-draw, so a 'Type 1' though positions 1 and 3 differ

g
syzygy
Posts: 166
Joined: Sun Aug 03, 2008 4:02 pm

Re: A note on Castling Rights ... and e.p.

Post by syzygy »

notnale wrote:On the other hand, there is a compelling case that castling should reset the 50 move counter. I assume that the only reason that they didn't put it in the rules is that it never comes up in actual play.
I agree that a stronger case can be made for letting castling reset the 50-move counter. But I don't find it a very strong case.

The only reason for letting castling reset the counter is that castling is irreversible. Then losing castling rights in any other way should also reset the counter. Thus, non-capturing rook and king moves that give up castling rights would become moves that reset the counter. This would probably complicate the 50-move rule far more than FIDE would find acceptable. Now it's simple: captures and pawn pushes.

Furthermore, I would say that captures and pawn pushes intuitively have more to do with "real progress" towards the end of the game than giving up castling rights.

Of course the fact that it doesn't normally happen might play a role as well...
kronsteen
Posts: 88
Joined: Fri Aug 01, 2008 11:20 am
Sign-up code: 0
Location: France

Re: A note on Castling Rights ... and e.p.

Post by kronsteen »

Irreversible/zeroing moves

Really, I don’t think that making zeroing moves and irreversible moves match each other is a sound idea. That’s too theory oriented. Zeroing moves and 50 move rule are not intended to make chess match some kind of mathematics, but to make play enjoyable and, for what they are concerned, to put a deadline on undecided battles which both let attacker enough winning attempts and avoid defender too long suffering. Making castling, moves changing castling rights, and moves declining ep opportunity as zeroing moves would do nothing for that purpose, would complicate rules, and would have almost zero probability to change the course and outcome of a game.

Mutual zugzwangs and moving rights

A fun composing subject ! There are 3 different kinds of MZs, which are (final result for white on wtm/btm) loss/draw, loss/win, draw/win. 1st and 3rd case are mirrored half-point MZs, 2nd case is full-point MZ. If initial position contains additional moving rights for wtm (coming from castling and ep rules), these can affect wtm position status as follows :
- Turn a loss into a draw
- Turn a loss into a win
- Turn a draw into a win
- Turn a draw into a loss, but in this case the “draw” is necessarily a stalemate position, because it is the only possibility through which giving new moving rights to side to move has the effect of degrading its situation. For that matter, note that adding new moving possibilities can spoil a draw by the effect described above but can never spoil a win.

Using g’s notation giving the final result for white on respectively 1) wtm with extra moving possibilities 2) btm 3) wtm without extra moving possibilities, there are 7 possibilities in which 1) and 3) have different outcomes, and either 1+2 or 2+3 (or both) is MZ :

- win/draw/loss (2+3 is half-point MZ)
- win/win/loss (2+3 is full-point MZ)
- win/win/draw (2+3 is half-point MZ)
- draw/draw/loss (2+3 is half-point MZ)
- draw/win/loss (2+3 is full-point MZ, 1+2 is half-point MZ) . Example 1 from g fills in this category
- loss/win/stalemate (2+3 is half-point MZ, 1+2 is full-point MZ). Example 2 from g (with white/black inverted) fills in this category
- loss/draw/stalemate (1+2 is half-point MZ). This is the only case in which 2+3 is not MZ. Examples 3 and 4 from g (with white/black inverted) fill in this category

It would be a good composing challenge to dig out an example of each, and even more for each of the 5 first categories one example involving ep and one example involving castling (on the two last ones it is impossible to be both able of castling and stalemated if not allowed to castle, so these positions can only be built with ep).

Another interesting challenge is to find MZ positions with ep or castling possibilities with such possibilities not changing the outcome : draw/win/draw (Example 5 from g is one, built with ep), loss/draw/loss and loss/win/loss.
guyhaw
Posts: 489
Joined: Sat Jan 21, 2006 10:43 am
Sign-up code: 10159
Location: Reading, UK
Contact:

Re: A note on Castling Rights ... and e.p.

Post by guyhaw »

Null moves do not change castling rights, so - in terms of castling rights, positions 1 and 3 would be the same.

I convinced myself some years ago that there were only 3 extra 'special type' zugs: draw-win-lose, lose-win-draw, lose-draw-draw.
As stated, position 3 cannot be better than position 1 for the stm unless it is actually a stalemate draw.
Player 1 is not going to play a null move from a win, and player 2 is not going to play a null-move from a loss-for-Player-1.

g
Post Reply