# Question
Title: Search returns PV that has depth reduced by null move reduction
I was running my program on a couple test positions earlier, and I came across a problem where the PV would be shorter than the max search depth. I am now pretty sure this is due to null move reductions (instead of pruning immediately I instead decrease the search depth by one ply and re-search to avoid problems with zugzwang). Is this actually a problem for the search or should I just leave it? If it is a problem, what should I do?

# Answer
Short principal variations are common if you retrieve the PV from the transposition table. They occur because a position that makes up part of the PV was overwritten in a collision.

If you want access to the full PV, you need to maintain it separately from the transposition table. However, this can get tricky when you cut a search short due to a table hit because you would only have the PV up until that point. To handle this, you can save the searched line of each PV-node (i.e. a node with an exact score) in a separate table alongside your transposition table. Saving that information will obviously cost you memory, but as PV-nodes are relatively uncommon, it isn't actually that expensive.

In my chess engine (being written in C#), I maintain the PV in a triangular PV-table. When I save a PV-node, I save the list of moves that were searched after that PV-node into a Dictionary, using the position's Zobrist hash as the key. Later, when retrieving the node from the transposition table, if the node is a PV-node, I retrieve the PV for that position from the Dictionary and overwrite the relevant portion of the triangular-PV-table.

This is a technique that I implemented after reading a paper that Robert Hyatt had published about ten years ago: A solution to short PVs caused by exact hash matches (2014).

One thing to note is that this is not a common technique, and that is likely for good reason. This work takes resources that could be dedicated to the search. If your goal is to build the best possible chess-playing engine, you should be fine with truncated PV's as long as you have access to the singular best move from the current position. However, if your goal is to learn and understand your engine better, having access to the full PV is nice as it allows you to see the final position that the score was calculated from.
> 0 votes

# Answer
I would say this is most problematic if you are on a low depth or have no qsearch (because of the odd-even effect). My guess is that you should probably do a complete re-search if the second reduced search is greater than alpha since getting a new PV is pretty rare in general.
> 0 votes

---
Tags: engines
---


# Question
Title: Is there any sequence of premoves that guarantees checkmate in this particular King + Queen vs King endgame?
King + Queen vs. King is perhaps the most basic winning endgame and known to be mate in at most ten moves. However, I am wondering if there is any sequence of ***premoves*** that guarantees checkmate? For concreteness, is this possible in the following position?

```
[Title "White to move and checkmate using only premoves"]
[fen "7K/6Q1/8/8/8/3k4/8/8 w - - 0 1"]

```

To clarify, this series of premoves would need to result in checkmate regardless of black's response.

# Answer
The answer is "No". The problem boils down to a combination of the initial smallest square the black king can be confined to being too large and the white king being too far away to limit how far the black king can wander in the square.

For instance, the smallest square the king can be confined to is by moving the white queen to e5. It then takes 3 moves at least to move the white king to a square where it can protect the queen while the queen makes the black "prison" smaller. However in 3 moves the white king takes to get to either f5 (intending Qe4) or e6 (intending Qd5) the black king could have moved to b4 in the case the white king moved to f5, or d2 in the case the white king moved to e6. Then the black king would escape the closing down of the box.

Here's what I mean:

```
[Title "White can't predict / force where the black king goes"]
[fen "7K/6Q1/8/8/8/3k4/8/8 w - - 0 1"]

1. Qe5 Kc4 2. Kg7 Kd3 3. Kf6 Kc4 (3...Kd2 4. Ke6 Kd3 5. Qd5 Ke3) 4. Kf5 Kb4 5. Qe4 Kc5

```
> 3 votes

---
Tags: endgame, checkmate
---


title: Official knight move rule definition

text:
# Question
Title: Official knight move rule definition
Not a trivial question: **How would you define the knight move rule on a d-dimensional chessboard (say an 8 X 8 X ... X 8 board) by extending the official knight move rule that states how a knight moves on a regular 8 X 8 chessboard?**

The most strict and consistent proposal I have found is to take the Euclidean distance between the centers of adjacent cells (as an example, just consider the distance between (0,0,...,0) and (1,0,...,0) or between (0,0,...,0) and (0,1,0,...,0), generalizing the distance between the centers of a1 and b1 or between the centers of a1 and a2 on a planar chessboard) and state that our knight can only move from a cell of our chessboard to another one of the same chessboard, under the constraint that this distance have to be equal to sqrt(5).

I used the Euclidean distance in the definition above, since Article 3.6, Section E, of the FIDE Handbook defines the 2D knight move rule as follows: "The knight may move to one of the squares ***nearest*** to that on which it stands but not on the same rank, file or diagonal". Now, if we do not accept my generalization, we should assume that a 3-dimensional knight can move from the (1,1,1) to (0,0,1) (or (2,0,1) or (2,2,1) and so forth...) and I do not think that this would be reasonable.

What do you think, is this the best way to describe a multidimensional knight?

# Answer
> 1 votes
Im not sure if this is an answer, but it is too long for a comment.

I have seen it noted that a Knight, on the center of a 5x5 set of squares, covers all of the squares that would not be covered by the pieces (Bishop and Rook) that move in straight lines. This would certainly generalize, but might not be best.

I think the problem starts with the Bishops. Even with three dimensions, there are two sorts of diagonal, so we have two sorts of Bishop. Once the Rooks and Bishops are sorted out, the Knights could take whatever is left.

In $d$ dimensions I think there are $d-1$ kinds of diagonal. Together with the Rooks, they give a choice of $4d$ destinations to the linear pieces. This leaves the Knights with $5^d-4d-1$ destinations, which eventually becomes most of the $5^d$ hypercube. In very high dimensions, the Knight would have access to a fraction $(5/8)^d$ of the board.

# Answer
> 0 votes
> What do you think, is this the best way to describe a multidimensional knight?

I'd use a more precise fairy chess notation to describe multi-dimensional chess movement. There are a few different notations, but they are all more precise than the FIDE description. For example, the extended Partlett notation for a knight is `~1/2` which means "this piece jumps over any obstacles to land and capture on its destination location, which is 1 unit away in a dimension and 2 units away in another." Another term for this is a (1,2) leaper.

In 2D, this yields the 8 regular knight moves. In more than one dimension, the same analogy would apply (so a 3D knight could move 2 units "upward" and 1 unit "inward").

If instead you wanted to translate the confusing FIDE definition into multiple dimensions, you are certainly welcome to try. But the terms "rank," "file," and "diagonal" will need more precise definition in higher dimensions. And depending on how you define those terms, you may just end up with a regular old (1,2) leaper after all the work.

---
Tags: rules, fide, knights, illegal-move
---


# Question
Title: Boden–Kieseritzky Gambit vs. Morphy Gambit
I just got an ad for the book *Taming Wild Chess Openings* by Watson & Schiller. I'm not planning to buy the book, but I was intrigued by the table of contents, especially the two lines quoted below (with chess symbols replaced by letters).

Under the heading **BAD WHITE OPENINGS**:

> Boden–Kieseritzky Gambit: 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Nc3 Nxe4 5. O-O

```
[Title "Boden–Kieseritzky Gambit"]
[FEN ""]

1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Nc3 Nxe4 5. O-O

```

Under the heading **GOOD WHITE OPENINGS**:

> Morphy Gambit: 1. e4 e5 2. Bc4 Nf6 3. Nf3 Nxe4 4. Nc3

```
[Title "Morphy Gambit"]
[FEN ""]

1. e4 e5 2. Bc4 Nf6 3. Nf3 Nxe4 4. Nc3

```

First, a terminological quibble: where do they get those names? If I remember right, the opening books I read as a child gave the moves 1. e4 e5 2. Bc4 Nf6 3. Nf3 Nxe4 4. Nc3 as the Boden–Kieseritzky Gambit, and did not mention any "Morphy Gambit."

But my real question is, **what is so different about these two lines that makes one "good" and the other "bad"?** It seems to me that they are quite similar, and very likely to transpose to the same game after a couple more moves. Am I missing some subtlety, or is this sheer carelessness on the part of the authors, who didn't notice that they were writing about the same opening twice?

# Answer
> 2 votes
The authors note in the introduction of the section on the Boden-Kieseritzky Gambit that

> \[The Boden-Kieseritzky Gambit\] is similar to the Morphy Gambit, except that White has already castled and Black has already developed the queenside knight. These additions make the opening favorable for black since he has more central support. With simple moves, Black will be able to achieve an advantage.

So at least they are aware of the obvious similarities. The authors claim that the Morphy Gambit is a 'good enough' opening to attempt to win quickly against weaker players, but it seems to me both openings can be opposed by the same "simple moves".

The main defense the authors offer against the Boden-Kieserizky Gambit starts with

```
[FEN ""]
1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Nc3 Nxe4 5. O-O Nxc3 6. dxc3 f6!

```

after which black can adequately defend and keep the pawn. Let's call this the "main defense".

But in the Morphy Gambit, we end up in the same position after

```
[FEN ""]
1. e4 e5 2. Bc4 Nf6 3. Nf3 Nxe4 4.Nc3 Nxc3 5. dxc3 f6! 6. O-O (6. Nh4!? {The authors mention this line as an option, but I don't think it is any good. For example, after g6} g6 7. f4 Qe7 {and black is fine. Note that white cannot castle immediately, due to Qc5+}) Nc6 {The authors mention this as a side-line (to the game they are analyzing), but do not mention whether they would recommend this particular move for black.}

```

So, there seems to be little theoretical difference between the openings and no practical difference against an opponent that knows the two or three moves that defend against both openings. Against an unaware opponent, in the Morphy Gambit black has to find one more move to reach the "main defense", so if I had to choose for white, I'd slightly prefer that version, but I would just play the same defense to both as black.

Now, why do the authors call only one of those in the book 'good' (for catching an unaware opponent)? I cannot read their minds, of course, but the authors often seem more interested in discussing games rather than openings, so perhaps they just needed an excuse to show games where white successfully uses a wild attack.

---
Tags: opening, books, gambits
---


title: "Premove" in OTB game

text:
# Question
Title: "Premove" in OTB game
Lately, a player of mine caused a minor kerfuffle by his habit of touching a piece to counter blitz even when the opponent had not finished the move.

Interestingly, I found nothing in the rules (admittedly by a quick browse) prohibiting grappling ones own pieces while not having the move, even §4.3 "touch-move" applies only to the player having the move!

To unruffle his rather annoyed opponent (incidentally also the tournament director), after clocks were halted, I politely explained to him that even the allowed counter blitz (not waiting for the opponent pressing the clock) is, even though allowed, at least bad style in my opinion and asking for havoc under Fischer mode (for the record, it was normal 15' quick) - and what he does is asking for a likewise sportsmanship opponent to change his mind where to put the piece and claiming touch-move. I promised him to ask a rule forum what exactly is allowed and what not.

It was always my opinion that a player not having the move should not touch anything, neither for j'adoube nor premove, lest him getting the book thrown at. What should the arbiter do when a player not having the move touches a piece with the intention of counter blitzing?

# Answer
> 10 votes
> What should the arbiter do when a player not having the move touches a piece with the intention of counter blitzing?

Working out somebody else's intentions when they do something is only possible for mind readers so let's leave that bit out.

The following articles of the FIDE Laws of Chess are relevant:

> 1.3 A player is said to ‘have the move’ when his/her opponent’s move has been ‘made’.

A reminder, a move is made when the player's hand leaves the moved piece or pieces and is completed when the clock is pressed, so starting to move before the opponent has pressed the clock is OK as long as the hand has left the piece. But I will add a caveat later.

> 11.5 It is forbidden to distract or annoy the opponent in any manner whatsoever.

Clearly if both players have one of their hands over the board in the process of making a move then there is a possibility of collision and chaos. Even if a collision does not occur, the prospect of one can be very distracting and disturbing. The player having the move has the right to make that move without such distraction and disturbance.

Clearly such action is deliberate. As a non mind reading arbiter I am always going to assume that the intention is deliberate annoyance and punish accordingly. Keep your hands away from the space above the board until the other player has made the move.

I said I would also caveat the second player's right to make a move in reply before the clock has been pressed. The first player also has the right to press the clock. If the move is on the opposite side of the board to the clock and the second player impedes the first player in any way in pressing the clock then I will also treat that very seriously as an infraction of 11.5

# Answer
> 6 votes
There is a clear difference in the FIDE rules between a move being **made** and being **completed**. It's made once you let go of the piece, completed when you have pressed the clock. There are various subtleties (e.g. if you made an illegal move but haven't completed it yet, you can still move something else).

The opponent is allowed to make their move **once you have made yours**:

> 1.3 A player is said to ‘have the move’ when his/her opponent’s move has been ‘made’.

So it's completely normal that they move when you have not pressed your clock yet! It's expected and what all blitz players try to do.

But they can not prevent you from pressing your clock:

> 6.2.2 A player must be allowed to pause his/her clock after making his/her move, even after the opponent has made his/her next move. The time between making the move on the chessboard and pressing the clock is regarded as part of the time allotted to the player.

So it's normal for it to go, player A makes a move, player B makes a move, player A presses the clock, player A makes a move, player B presses the clock, that sort of thing.

If you don't press it but instead immediately make a new move, then that also completes the previous move (and means both players miss out on Fischer increment):

> 6.2.1 \[...\] A move is also completed if:

> 6.2.1.1 \[...\]

> 6.2.1.2 the player has made his/her next move, when his/her previous move was not completed.

However, what's **not** allowed is touch a piece or starting to make a move when it's not your move yet. So if they do that when you have not made yours yet (haven't let go of the piece yet), that's a real problem and you should complain to the arbiter.

# Answer
> 2 votes
If someone plays mostly online, then the instinct to pre-move might become natural and could pop up when playing OTB (Over The Board).

Someone might think that pre-touching a unit has a certain flair. It doesn’t necessarily involve malice or a deliberate intent to annoy or distract.

However it almost certainly is distracting, the arbiter can say ok, very funny, don’t do this again. It does violate FIDE Law 11.5 which prohibits distracting or annoying the opponent.

Pre-touch is not the same as pre-move, so the pre-toucher might get their fingers burnt against a canny opponent. For example, a common pre-move is to a square currently occupied by a friendly unit, which is about to be exchanged off. If the anticipated capture does not happen, the pre-move is simply cancelled and one can make any move. But the pre-toucher OTB would still be obliged to move the touched piece!

---
Tags: rules, etiquette
---


# Question
Title: What's wrong with the way white is playing?
I have played an opening I can't find anywhere online. So I'm guessing it's wrong. Can someone tell me what are the weaknesses in white's strategy? Or is it simply a matter of black not being able to penalize him?

From which move does white and black start to misplay?

```
[FEN ""]
[Event "Rated Classical game"]
[Site "https://lichess.org/ETe2HGt5"]
[Date "2023.09.26"]
[White "a_saint"]
[Black "hamstra"]
[Result "1-0"]
[UTCDate "2023.09.26"]
[UTCTime "10:54:15"]
[WhiteElo "1747"]
[BlackElo "1810"]
[WhiteRatingDiff "+20"]
[BlackRatingDiff "-110"]
[Variant "Standard"]
[TimeControl "1800+0"]
[ECO "C40"]
[Opening "Latvian Gambit: Mason Countergambit"]
[Termination "Normal"]
[Annotator "lichess.org"]

1. e4 e5 2. Nf3 f5? { (0.29 → 1.65) Mistake. Nc6 was best. } (2... Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. Re1 Nd6 6. Nxe5 Nxe5 7. Rxe5+) 3. d4? { (1.65 → 0.49) Mistake. Nxe5 was best. } { C40 Latvian Gambit: Mason Countergambit } (3. Nxe5 Qf6 4. d4 d6 5. Nc4 fxe4 6. Nc3 Qf7 7. Be2 Nf6) 3... fxe4 4. Ng5? { (0.48 → -0.66) Mistake. Nfd2 was best. } (4. Nfd2 d6 5. Nxe4 exd4 6. Bc4 d5 7. Qh5+ g6 8. Qxd5 Qxd5) 4... d5?! { (-0.66 → -0.05) Inaccuracy. exd4 was best. } (4... exd4 5. Nxe4 Nc6 6. Bc4 d5 7. Qh5+ g6 8. Qxd5 Qxd5 9. Bxd5) 5. c4?? { (-0.05 → -2.55) Blunder. dxe5 was best. } (5. dxe5 Bb4+ 6. c3 Bc5 7. Be2 Ne7 8. c4 h6 9. cxd5 hxg5) 5... Be7?? { (-2.55 → 0.45) Blunder. exd4 was best. } (5... exd4 6. Qxd4 h6 7. cxd5 hxg5 8. Nc3 Nd7 9. Bb5 Qf6 10. Qxe4+ Kd8 11. Bd2 Bd6 12. Qe2) 6. h4? { (0.45 → -0.98) Mistake. dxe5 was best. } (6. dxe5 Bxg5) 6... Bf5? { (-0.98 → 0.36) Mistake. exd4 was best. } (6... exd4) 7. g4 Bg6?? { (0.30 → 2.29) Blunder. h6 was best. } (7... h6 8. gxf5) 8. h5?? { (2.29 → 0.22) Blunder. Ne6 was best. } (8. Ne6 Qd7 9. cxd5 c6 10. h5 Bf7 11. Nxg7+ Kf8 12. d6 Kxg7 13. dxe7 Nxe7 14. Nc3 Rd8) 8... Bxg5 9. hxg6 h6 10. dxe5 Bxc1 11. Qxc1 d4?! { (-0.04 → 0.92) Inaccuracy. Ne7 was best. } (11... Ne7) 12. Qf4 Nc6?? { (1.05 → Mate in 1) Checkmate is now unavoidable. Qe7 was best. } (12... Qe7 13. Nd2) 13. Qf7# { White wins by checkmate. } 1-0

```

# Answer
> 2 votes
First of all, the strongest move after black's f5 is Ne5, threatening Qh5. If the black attacks the knight with the Queen/Knigth then it can be guarded by playing d4.

Moving on, white should've captured on e5 instead of Ng5 anyway but we'll leave it be. The worst blunder in the opening is playing 5.c4 after which black can take on d4 and later play h6 which seems simply lost for white given the eval is -3 at this point. 5. ... - Be7? again gives the opportunity to re-caprute on e5. This seems to be the crucial pawn and also the square for white's pawn.

So yeah, white should've got punished for giving away pawns and the center so easily. Basically as white you should aim to punish bad opening such as this right away. If you play well, black shouldn't be able to get away with something like this in a Classical game

---
Tags: opening, analysis, tactics, latvian-gambit
---


title: Why do boys become better than girls?

text:
# Question
Title: Why do boys become better than girls?
From my experience in tournaments until the age of 11-12, the playing strength of boys and girls is pretty similar but after 13 the difference becomes noticeable. Why is that?

# Answer
I think there are 2 factors coming into play here:a)Statistics and b)Talent

The curve of a playing strength of a player is a bell curve

, people with very much or very little talent are extremely rare.

Now the pool of male players \>14 yo is much bigger than the pool of female players \> 14 because many girls hit adolescence and quit chess.But if we have 1000 players it is not guaranteed that 1 player will have the playing strength of a 3000,the more players we have , the better the chance that 0.1% will play at a playing strength of 3000.

Through the evolution on average males were designed to be less emotional than women and have developed skills(hunting etc)which help them in chess.So the mean is bigger for males than for girls.
> 0 votes

# Answer
Hou Yifan did an interview with Chess.com where she answered some questions about why there has been such a persistent gap between men and women when it comes to top-level chess.

Chess.com - Hou Yifan Interview: 'Competing With Top Males Is Talent And Opportunity'

> \[...\]I do think the average rating of female players could improve, but the gap between the top women right now and the players competing for the world title is really quite large. But if you look at any sport, it’s hard to imagine girls competing at the same level as men.
>
> **But why is that the case in chess, given that there appear to be no obvious advantages of being a male player? Is it simply a matter of statistics? Far more men play, and so the chances are that someone with the natural attributes to become a 2800+ player will be a man rather than a woman?**
>
> This is true, but it’s just one of many reasons, and I’m not sure which one is the most important. I think there is a physical aspect because chess exhausts a lot of energy, especially when games last 6-7 hours, and here women could be more disadvantaged. But in general, I think women train less hard at chess compared to men while they’re growing up.
>
> In China, girls tend to think more about university, and then things like family, life balance...while boys are more focused and persistent on that one thing. This makes a big difference. The ones who put greater effort in achieve better results. But I also think there are external factors too.
>
> Growing up, female players are told, "If you win the girls’ title, we’ll be really proud of you, and this is a great job!" It’s unlikely that any of them were told, "No, you should be fighting for the overall title!" Girls are told at an early age that there’s a kind of gender distinction, and they should just try their best in the girls' section and be happy with that. So without the motivation to chase higher goals, it’s harder for girls to improve as fast as boys as they grow up.
>
> **Do you think there are any intrinsic differences between how men and women approach chess?**
>
> I’m just speculating but I wonder whether there is a gender difference when it comes to natural intuition or feel for the game. Because to me, in all aspects of life, sometimes women and men tend to see the same thing from completely different perspectives, and that also comes into chess. I suspect that the male perspective on chess favors men, perhaps when it comes to the emotional aspect of the game and making practical and objective decisions. To put it simplistically, I think male players tend to have a kind of overview or strategy for the whole game, rather than focusing too much attention on one part of the game. It could be interesting to explore this further. I need to do more research to answer this properly!
> 6 votes

# Answer
There was a study on this a few years ago, where researchers concluded that the number of women that were represented in the top players correlated with the number of women that participated at a young age.

This is at least intuitively correct. One of the reasons that it is so hard to make it to a professional level in certain sports is that every boy in the nation is encouraged to play, so the ones that have the "spark" get exposed at a much earlier age, and the potential pool is correspondingly larger. Other, more niche sports it's a relatively easier path to success, but conversely, less people play it so it's less likely that spark gets ignited.

Another article on Slate puts forth much the same thing, that the ratings gap also is reflected in the participation gap. While there is no hard evidence that there IS a gender difference, unfortunately there is also no evident that there is NOT a difference. Sadly, this article also cites a study that by age 6, girls are already starting to believe that they are not as smart as boys.

So tl;dr - Boys are encouraged and perceived as smarter, which leads to less participation from girls, and thus less likely that a girl that could truly excel at the game ever gets a chance to be exposed to it.
> 5 votes

# Answer
Chess has long been an elitist, aristocratic and male-centered game, and to some extent still (sadly) is.

It is in part due to history, as it was widely seen as a pastime for men who could afford investing time in it. Back in the days, women alas did not have the same status and rights as men, and were solely dedicating their lives to having children, raising them, taking care of the household. These customs of another time are evolving nowadays, but they are still very present in the collective mind. So young girls are still perceived in the collective mind as destined to grow as described women; this perception is fading as modern society evolves, but slowly. Even if this is changing, girls are still encouraged by society to be kind, caring, empathetic, when boys are encouraged to be daring, courageous, self-confident; the latter set of traits being a good starting base for playing chess for obvious reasons. Ironically, from my own long-time practice, I have found that most female players I have played against had a much more aggressive playing style than my male opponents. This has always impressed me, and to me hints on that for a female player to reach a certain level and not get disocuraged by the way the community treats them, they need to have nerves of steel.

There is, as far as I know, no scientifically-backed indication of any biological innate advantage or disadvantage for male or female brains when it comes to chess.

The educational psychologist Laszlo Polgar sort of proved that with the proper training and support, female players have very good chances of reaching the high level. He trained his three daughters Susan, Sofia and Judit in playing chess (and in learning quite a few languages), and they famously reached very high level of playing, Judit reaching world rank #8 at her peak. More about Polgar on wikipedia.

Here a personal opinion on the matter: the fact that the chess community continues separating "open" and "women's" chess is not helping closing the level gap at the top. It is understandable for promoting the game to and rewarding female players, but I feel like it reinforces the gap more than it closes it. The fact that price pools and media coverage for the female competitions are significantly lower than for the open competitions just reinforces this impact also. Less money to make as a professional player from prices might deter potential chess geniuses from even entering the field with full committment.

We want more female players, at all levels. Chess is awesome and everyone should enjoy its awesomeness :-)
> -1 votes

---
Tags: tournament, elo, development, gender
---


# Question
Title: What is the longest string of moves by one side on one color of the board?
This game was dubbed "White Key Symphony" by chessgames.com for the fact that Karpov made moves on only light squares for 18 moves in a row.

Is this still the record for the light squares, and what of the dark squares?

```
[Title "Anatoly Karpov-Garry Kasparov, World Championship Match, Moscow, 9/12/1985, 1-0"]
[FEN ""]
[startply "40"]

1. d4 d5 2. c4 e6 3. Nc3 Be7 4. Nf3 Nf6 5. Bg5 h6 6. Bxf6 Bxf6 7. e3 O-O 8. Qc2 Na6 9. Rd1 c5 10. dxc5 Qa5 11. cxd5 Nxc5 12. Qd2 Rd8 13. Nd4 exd5 14. Be2 Qb6 15. O-O Ne4 16. Qc2 Nxc3 17. Qxc3 Be6 18. Qc2 Rac8 19. Qb1 Rc7 20. Rd2 Rdc8 21. Nxe6 fxe6 22. Bg4 Rc4 23. h3 Qc6 24. Qd3 Kh8 25. Rfd1 a5 26. b3 Rc3 27. Qe2 Rf8 28. Bh5 b5 29. Bg6 Bd8 30. Bd3 b4 31. Qg4 Qe8 32. e4 Bg5 33. Rc2 Rxc2 34. Bxc2 Qc6 35. Qe2 Qc5 36. Rf1 Qc3 37. exd5 exd5 38. Bb1 Qd2 39. Qe5 Rd8 40. Qf5 Kg8 41. Qe6+ Kh8 42. Qg6 Kg8 43. Qe6+ Kh8 44. Bf5 Qc3 45. Qg6 Kg8 46. Be6+ Kh8 47. Bf5 Kg8 48. g3 Kf8 49. Kg2 Qf6 50. Qh7 Qf7 51. h4 Bd2 52. Rd1 Bc3 53. Rd3 Rd6 54. Rf3 Ke7 55. Qh8 d4 56. Qc8 Rf6 57. Qc5+ Ke8 58. Rf4 Qb7+ 59. Re4+ Kf7 60. Qc4+ Kf8 61. Bh7 Rf7 62. Qe6 Qd7 63. Qe5 1-0

```

# Answer
Thanks to this CQLi query:

```
cql(input Mega_Database_2023.pgn)

flipcolor {
    sort "Consecutive"
    line singlecolor 18 1000 nestban --> move to light . *
}

// check 3-fold repetition:
dictionary (min) $D
if initial then unbind $D

$appearances = 1
$key = zobristkey

if $D[$key] {
    $appearances = int($D[$key]) + 1
}

$D[$key] = str($appearances)

$appearances <= 2

```

which I ran against Mega Database 2023, I found some interesting stuff.

---

The record for the most consecutive moves (**179**) made by one side on light squares is held by this game:

```
[Event "World op 48th"]
[Site "ICC INT"]
[Date "2020.08.09"]
[Round "7"]
[White "Nair, Ajitesh"]
[Black "Li, Linden"]
[Result "1/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d2 254.Kg2 Ke1 255.Bb7 Ke2 256.Bc6 Ke3 257.Bb7
Kd4 258.Bc6 Kc5 259.Kf3 Kc4 260.Kg2 Kb4 261.Kf3 Kc3 262.Kg2 Kb3 263.Kf3 Kc2
264.Kg2 Kb2 265.Kf3 Kc1 266.Kg2 Kc2 267.Kf3 Kd1 268.Kg2 Kd2 269.Kf3 Kd1 270.Kg2
Ke1 271.Bb7 Ke2 272.Bc6 Ke3 273.Bb7 Ke4 274.Bc6 Kd3 275.Kf3 Kc3 276.Kg2 Kc2
277.Kf3 Kc3 278.Kg2 Kd2 279.Kf3 Kd3 280.Kg2 Kd2 281.Kf3 Ke1 282.Kg2 Ke2 283.Bb7
Ke3 284.Bc6 Ke4 285.Bb7 Kf5 286.Bc6 Kg4 287.Bb7 Kf4 288.Bc6 Ke4 289.Bb7 Kd4
290.Bc6 Kc4 291.Kf3 Kc5 292.Kg2 Kb4 293.Kf3 Kc4 294.Kg2 Kb3 295.Kf3 Kc3 296.Kg2
Kb2 297.Kf3 Kc2 298.Kg2 Kb1 299.Kf3 Kc1 300.Kg2 Kd1 1/2-1/2

```

---

while the record for the most consecutive moves (**154**) made by one side on dark squares is held by this game:

```
[Event "New York State-ch 120th"]
[Site "New York"]
[Date "1998.??.??"]
[Round "1"]
[White "Felber, Joseph J"]
[Black "Lapshun, Yury"]
[Result "1/2-1/2"]
[ECO "C56"]
[WhiteElo "2150"]
[BlackElo "2355"]
[PlyCount "360"]
[FEN ""]

1.e4 e5 2.Bc4 Nc6 3.
Nf3 Nf6 4.d4 exd4 5.O-O Nxe4 6.Re1 d5 7.Bxd5 Qxd5 8.Nc3 Qh5 9.Nxe4 Be6 10.Bg5
Bb4 11.Nxd4 Qxd1 12.Rexd1 Nxd4 13.Rxd4 Be7 14.Re1 Rd8 15.Red1 Rxd4 16.Rxd4 f6
17.Bf4 Kf7 18.h3 g5 19.Bxc7 Rc8 20.Nd6+ Bxd6 21.Bxd6 Rxc2 22.Ba3 a5 23.Rd3 b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kd3 111.Ba3 Bc4 112.Bc5 Kd2 113.Ba3 Ke1 114.Bc5 Kf1 115.Ka3 Kg2 116.Kb2 Kh3
117.Be7 Kh2 118.Bd6+ Kh1 119.Ka3 Kg2 120.Bc5 Kf1 121.Kb2 Bg8 122.Ka3 Bf7 123.
Kb2 Ke1 124.Ka3 Kd1 125.Kb2 Kd2 126.Bb4 Kd3 127.Ba3 Kd2 128.Bb4 Bc4 129.Ba3 Kd1
130.Bb4 Ke1 131.Bc5 Be2 132.Ka3 Bd3 133.Kb2 Kd2 134.Bb4 Be4 135.Bc5 Bd5 136.Bb4
Kd1 137.Ba3 Ke2 138.Bc5 h5 139.Ka3 Kd3 140.Kb2 Kc4 141.Bb4 Be4 142.Ba3 Kd5 143.
Bb4 Ke5 144.Be7 Bd5 145.Bb4 Bc4 146.Ba3 Ke4 147.Bb4 Kf4 148.Bd6+ Kg4 149.Be7
Kh3 150.Ka3 Kh2 151.Bd6+ Kh1 152.Kb2 Kg1 153.Bc5 Kf1 154.Ka3 Ke1 155.Kb2 Kd1
156.Ba3 Kd2 157.Bb4 Kd3 158.Ba3 Ke4 159.Bb4 Kf4 160.Bd6+ Kg4 161.Be7 Bd5 162.
Ka3 Kh3 163.Kb2 Kh2 164.Ka3 Kg1 165.Bc5 Bc4 166.Kb2 Kf1 167.Ka3 Ke1 168.Kb2 Be2
169.Ka3 Kf1 170.Kb2 Kg1 171.Ka3 Kh1 172.Kb2 Kh2 173.Ka3 Kh3 174.Be7 Kg4 175.Kb2
Kf4 176.Bd6+ Ke4 177.Ka3 Kd3 178.Kb2 Ke4 179.Bb8 Bf1 180.Bd6 Bd3 1/2-1/2

```

---

Here are some interesting games:

28 moves:

```
[Event "RUS-ch sf"]
[Site "Krasnodar"]
[Date "1999.??.??"]
[Round "9"]
[White "Zamruk, Aleksandar"]
[Black "Kekov, Alexandr"]
[Result "1/2-1/2"]
[ECO "A12"]
[WhiteElo "2395"]
[BlackElo "2321"]
[FEN ""]
[StartPly "21"]

1.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8 16.b4 e4 17.b5 Bxc4 18.bxc6 Nxc6 19.Ne5
exd3 20.Nxd7 Rxe2 21.Rxe2 dxe2 22.Bd2 Re8 23.Bxc6 bxc6 24.f3 Be6 25.Nb8 Ba2 26.
Ra1 Bd5 27.Rb1 Bxf3 28.a5 Be4 29.Rb7 Bd3 30.Kf2 e1=Q+ 31.Bxe1 Re2+ 32.Kf3 Rxe1 0-1

```

---

19 moves:

```
[Event "NED-ch"]
[White "Ernst, Sipke"]
[Black "Van Foreest, Jorden"]
[Site "Amsterdam"]
[Round "5"]
[Result "0-1"]
[Date "2016.08.26"]
[WhiteElo "2535"]
[BlackElo "2601"]
[PlyCount "150"]
[StartPly "19"]
[FEN ""]

1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Nf3 e5 7. O-O Nc6 8. d5 Ne7 9. Bg5 h6 10. Bd2 Ne8 11. Qc1 Kh7 12. Qc2 f5 13. exf5 gxf5 14. g3 c6 15. Nh4 b5 16. a3 bxc4 17. Bxc4 Bb7 18. dxc6 Bxc6 19. Be6 Bd7 20. Ba2 Rc8 21. Qd3 Bc6 22. Be6 e4 23. Qe2 d5 24. Bxc8 Qxc8 25. Rfc1 Qd7 26. Nd1 Bb5 27. Qe1 Rf7 28. a4 Ba6 29. Bf4 d4 30. Qa5 Bb7 31. Ng2 Qe6 32. Qb5 Nd5 33. a5 a6 34. Qe2 Nd6 35. Rc5 Nb5 36. Qc4 Bf8 37. Rxb5 axb5 38. Qxd4 Bg7 39. Qd2 e3 40. Ndxe3 Nxe3 41. fxe3 Rd7 42. Qe2 b4 43. a6 Ba8 44. a7 b3 45. h3 Qe4 46. Qf2 Qc2 47. e4 Bxb2 48. Re1 Qxf2+ 49. Kxf2 Bd4+ 50. Be3 Bxa7 51. Rb1 Rd2+ 52. Kf1 Bxe4 53. Bxd2 Bxb1 54. Bc3 Bc5 55. Bb2 Bf8 56. Ne3 Bg7 57. Bxg7 Kxg7 58. Kf2 Kf6 59. Nc4 Be4 60. Ke3 Bg2 61. h4 Bd5 62. Nb2 Bf7 63. Nd3 Be6 64. Kd4 f4 65. gxf4 Kf5 66. Kc3 Bf7 67. Kb2 h5 68. Kc3 Bg8 69. Ne5 Kxf4 70. Ng6+ Ke4 71. Kb2 Bf7 72. Nf8 Kf4 73. Nd7 Kg3 74. Ne5 Bd5 75. Ng6 Be4 0-1

```

... and many more
> 4 votes

---
Tags: records, famous-games
---


# Question
Title: How rare are double forks in high-level games?
I was playing a blitz game, when I saw my chance to produce an amusing position, to which my opponent unknowingly obliged; I was able to fork their rooks with my queen and rook simultaneously.

```
[Title "Punktilinchen - RewanDemontay, Rated Blitz game, 2023.02.25"]
[FEN ""]
[startply "91"]

1. e4 e6 2. d4 d5 3. exd5 exd5 4. c3 Nc6 5. Nf3 Bd6 6. Bd3 Nf6 7. O-O Be6 8. Be3 O-O 9. Nbd2 Ne7 10. Qe2 c6 11. Rab1 Qc7 12. b3 b5 13. b4 a5 14. Bc2 axb4 15. cxb4 Rxa2 16. Qd3 Rfa8 17. Bg5 Nd7 18. Qxh7+ Kf8 19. Qh8+ Ng8 20. Bh7 f6 21. Qxg8+ Bxg8 22. Bxg8 Kxg8 23. Bh4 g5 24. Bg3 Bxg3 25. hxg3 Kf7 26. Nb3 Nb6 27. Nh2 Nc4 28. Ng4 Nd2 29. Nxd2 Rxd2 30. Nh6+ Kg6 31. Ng4 Raa2 32. Rbe1 Rxd4 33. Ne3 c5 34. bxc5 Qxc5 35. Rc1 Qa3 36. Rc6 b4 37. Nc2 Rxc2 38. Rxc2 b3 39. Rcc1 b2 40. Rb1 Rc4 41. Rfd1 d4 42. Rd2 Rc1+ 43. Rd1 d3 44. Kh2 d2 45. Kh3 Qc3 46. f4 Qc2 47. g4 gxf4 48. Kh4 Qc8 49. Rxd2 Qh8#

```

This reminded me of Diary Entry #333 on Tim Krabbe's site: "Such a double fork is extremely rare - I found only four other examples. Berkell's, however, is the prettiest, and the oldest."

```
[Title "Berkell - Engström, Swedish Open 1977"]
[FEN ""]
[startply "62"]

1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bc4 O-O 8. Ne2 c5 9. O-O cxd4 10. cxd4 Nc6 11. Be3 Bg4 12. f3 Na5 13. Bd3 Be6 14. d5 Bxa1 15. Qxa1 f6 16. Qd4 Bd7 17. e5 e6 18. Nf4 fxe5 19. Qxe5 Qb8 20. Qg5 Qd8 21. Qe5 Qb8 22. Qg5 Qd8 23. Qh6 Qe7 24. dxe6 Be8 25. Bd4 Rd8 26. Ba1 Nc6 27. Bxg6 Nd4 28. Bxh7+ Qxh7 29. Qxh7+ Kxh7 30. e7 Nxf3+ 31. Kh1 Bc6 32. Ne6

```

This makes me curious; how rare are such double forks in high-level games, and are there any well known games that feature one? A cql entry ought to be able to spot some.

# Answer
I ran this CQL query against Mega Database 2023 to find some interesting games:

```
cql(input Mega_Database_2023.pgn)

btm
piece wp in A {
    [bnrqk] attackedby wp > 1 // wp forks at least 2 black pieces

    piece wp1 in A & ~wp {
        [bnrqk] attackedby wp1 > 1 // wp1 forks at least 2 black pieces

        Common = [bnrqk] attackedby wp & [bnrqk] attackedby wp1
        Common > 1 // wp and wp1 fork the same black pieces (at least 2)

        totalAttackers = 0
        square sq in Common {
            totalAttackers += #a attacks sq
            // exclude some FPs: the forked pieces shouldn't be able
            // to capture forking ones
            not sq attacks wp
            not sq attacks wp1
        }

        // underdefended black pieces
        sort min "Total attackers" totalAttackers < 2

        // forking piece not captured in next move
        not move capture wp1
        not move capture wp
    }
}

```

The list of the games returned is available here.

*Some* interesting games below:

```
[Event "Izmailov Memorial op 17th"]
[Site "Tomsk"]
[Date "2013.06.16"]
[Round "6"]
[White "Kovalev, Vitaly"]
[Black "Fitiak, Sergey"]
[Result "1-0"]
[ECO "A29"]
[WhiteElo "2103"]
[BlackElo "2209"]
[PlyCount "67"]
[FEN ""]
[StartPly "66"]

1.g3 d5 2.Bg2 e5 3.c4 Nf6 4.cxd5
Nxd5 5.Nc3 Nb6 6.Nf3 Nc6 7.O-O Be7 8.d3 O-O 9.Be3 Be6 10.Na4 e4 11.Ne1 exd3 12.
Nxd3 Nd5 13.Bc5 b6 14.Bxe7 Ncxe7 15.Qc2 c5 16.Rad1 Qe8 17.e4 Nb4 18.Nxb4 cxb4
19.b3 Nc6 20.f4 Rc8 21.Rd6 Nd4 22.Qd2 Nb5 23.Rd3 Nc7 24.f5 Bc4 25.bxc4 Qxa4 26.
e5 Qa5 27.Bd5 Qc5+ 28.Kg2 Rfe8 29.Re1 b5 30.Re4 bxc4 31.Bxc4 Rxe5 32.Rd8+ Re8
33.Rexe8+ Nxe8 34.Qd7 1-0

```

---

```
[Event "Alushta4"]
[White "Morozevich,Alexander"]
[Black "Onischuk,Alexander"]
[Site "Alushta"]
[Round "6"]
[Annotator "Chekhov,Valery A"]
[Result "1-0"]
[Date "1994.??.??"]
[WhiteElo "2590"]
[BlackElo "2535"]
[PlyCount "63"]
[FEN ""]
[StartPly "60"]

1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. Bb5+ c6 7. dxc6 bxc6 8. Be2 h6 9. Nf3 e4
10. Ne5 Bd6 11. d4 exd3 12. Nxd3 Qc7 13. b3 O-O 14. Bb2 Ne4 $5 $146 15. Nc3 f5 $1 16. h3 Bb7 17. O-O a6 $6
18. Qe1 c5 19. Rd1 Rae8 20. Nc1 Be5 21. Nxe4 fxe4 22. Bxe5 Rxe5 23. Qd2 Rg5 24. Qd6 Qc8 $6 25. h4 Rgf5
26. Bg4 R8f6 27. Qe7 Nc6 28. Bxf5 Qxf5 29. Qxb7 Qg4 30. Qd7 Re6 31. Rd6 Nd4 32. Rxd4 1-0

```

---

```
[Event "Ducale op 10th"]
[Site "Genova"]
[Date "2002.12.01"]
[Round "9"]
[White "Puglisi, Vincenzo"]
[Black "Massa, Giovanni"]
[Result "0-1"]
[ECO "B34"]
[WhiteElo "2115"]
[BlackElo "2096"]
[FEN ""]
[StartPly "33"]

1.e4 c5 2.Nf3 Nc6 3.d4 cxd4 4.Nxd4
g6 5.Be3 Nf6 6.Nc3 Bg7 7.f4 d6 8.Bb5 Bd7 9.Be2 O-O 10.O-O Qb6 11.e5 dxe5 12.
fxe5 Nxe5 13.Nf5 Qxb2 14.Nxe7+ Kh8 15.Bd4 Qb4 16.Rxf6 Bxf6 17.Bxe5 Qc5+
0-1

```

---

```
[Event "Baku Jafarov Memorial"]
[Site "Baku"]
[Date "2018.01.04"]
[Round "1"]
[White "Shubin, Kirill"]
[Black "Tahbaz, Arash"]
[Result "0-1"]
[ECO "B57"]
[WhiteElo "2299"]
[BlackElo "2442"]
[PlyCount "94"]
[FEN ""]
[StartPly "93"]

1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4
Nf6 5.Nc3 Nc6 6.Bc4 Bd7 7.O-O g6 8.Nxc6 Bxc6 9.Nd5 Bg7 10.Bg5 Bxd5 11.exd5 O-O
12.Re1 h6 13.Be3 Rc8 14.Bb3 Nd7 15.c3 a6 16.Qd2 Kh7 17.a4 Nb6 18.Qe2 Qc7 19.Bf4
Bf6 20.Qd2 h5 21.Re4 Nd7 22.Re3 Ne5 23.Qe2 Kg7 24.Re1 Nc4 25.Re4 b5 26.axb5
axb5 27.Bc1 Qb7 28.Rd1 Rc5 29.Qd3 Rfc8 30.f4 Qd7 31.Qe2 Ra8 32.Bc2 Qb7 33.f5
Rxd5 34.Re1 gxf5 35.Rf4 Re5 36.Qf1 Qb6+ 37.Kh1 e6 38.Rd1 Ne3 39.Bxe3 Qxe3 40.
Bd3 Ra4 41.Rf3 Qb6 42.b4 Ra3 43.Rg3+ Kf8 44.Qf4 Ke7 45.Qh6 Qf2 46.Bf1 Re1 47.
Rf3 Qxf3 0-1

```

---

```
[Event "Korinthos op 3rd"]
[Site "Korinthos"]
[Date "1999.07.27"]
[Round "4"]
[White "Stathakis, Ioannis"]
[Black "Mastrovasilis, Athanasios"]
[Result "0-1"]
[ECO "A15"]
[WhiteElo "2087"]
[BlackElo "2345"]
[PlyCount "66"]
[FEN ""]
[StartPly "63"]

1.c4 Nf6 2.Nf3 b6 3.d3 c5 4.e4 Nc6
5.Nc3 d6 6.h3 g6 7.Be2 Bg7 8.Be3 O-O 9.Qd2 a6 10.Bh6 Nd4 11.Bxg7 Kxg7 12.Nxd4
cxd4 13.Nd5 Nd7 14.h4 h6 15.f4 f5 16.exf5 gxf5 17.Nb4 Bb7 18.Rh3 a5 19.Nc2 e5
20.O-O-O Kh7 21.Rg1 Qf6 22.g4 fxg4 23.Bxg4 Nc5 24.fxe5 dxe5 25.Bh5 Rg8 26.Re1
Rg2 27.Qd1 Qf5 28.Reh1 Rf2 29.Rg1 Qxh3 30.Bg6+ Kh8 31.Qh5 Rf1+ 32.Ne1 Qe3+ 33.Kb1 Rxg1 0-1

```
> 1 votes

---
Tags: history, statistics, famous-games, master-games, fork
---


# Question
Title: En passant capture - statistically advantageous?
If anyone is doing chess score analysis (on say, last 10 years of competitive games), I wonder if it's identifiable how many times en passant (EP) capture could have been played vs how many times it was played (and also ignored)?

I guess without analyzing the position post the EP capture/non-capture move, we can assume that it was weaker move if the (assume again, ranked) player didn't proceed with the capture.

Given that, wonder if we can determine a "when EP is available for capture, what is the probability that capture is a weak/strong move at a competitive level".

Eg, if this was 5 in 100, then we can more or less say that EP capture is the strongest move in 5% of cases. (I would say, castling, for example, is probably like 85%+ when possible?)

Does this kind of analysis even make sense?

It's maybe a guide for beginner players to say, if you get presented with EP capture, it's likely only the best move 5% of the time. etc.

# Answer
> 6 votes
The library python chess can determine if a position has a legal ep move. I use this library to calculate if an ep move is better than the played move in the game using stockfish 16 engine at 1 sec/pos.

I took the rapid team champ games from the weekinchess and analyze each position.

### Result

```
num_games: 1296, possible_ep: 146, played_ep: 82, better_epmove_than_played_move: 17 (11.64%)

```

You can run other pgn file with the following code.

# Code

```
"""Get stats on unplayed but better ep move.

Read every position in the game from pgn file. Check
if position has a legal ep move, the played move in the game
and if ep move is better than the played move by analyzing
the position with stockfish engine.

requirements:
    pip install chess
"""

import chess
import chess.pgn
import chess.engine

fn = 'wrapteam23.pgn'
gcnt = 0

engine = chess.engine.SimpleEngine.popen_uci(
    r'F:\Chess\Engines\stockfish\sf16\sf16pop.exe'
)

engine.configure({'Hash': 256})

possible_ep, played_ep, better_epmove = 0, 0, 0
at = 1.0  # analysis time in seconds
epds = []

with open(fn) as pgn:
    while True:
        game = chess.pgn.read_game(pgn)
        if game is None:
            break

        gcnt += 1
        print(f'game {gcnt}')

        for node in game.mainline():
            board = node.parent.board()
            gmove = node.move  # the actual move played in the game

            # Check if there is legal ep capture.
            if not board.has_legal_en_passant():
                continue

            possible_ep += 1
            ep_square = board.ep_square

            # Get the best move and score of the engine from the current position.
            info = engine.analyse(board, chess.engine.Limit(time=at))
            bm = info['pv'][0]
            bscore = info['score'].relative.score(mate_score=32000)

            # Determine the ep move score.
            if bm.to_square == ep_square:
                epmove = bm
                epscore = bscore
            else:
                for mv in board.legal_moves:
                    to_sq = mv.to_square
                    if to_sq == ep_square:
                        tboard = board.copy()

                        # Push this move and analyze the position with the engine.
                        # Negate the score because we push it.
                        tboard.push(mv)
                        info = engine.analyse(tboard, chess.engine.Limit(time=at))
                        epscore = -info['score'].relative.score(mate_score=32000)
                        epmove = mv
                        break

            # Determine the game move score.
            if bm == gmove:
                gscore = bscore
            elif gmove == epmove:
                gscore = epscore
            else:
                tboard = board.copy()
                tboard.push(gmove)
                info = engine.analyse(tboard, chess.engine.Limit(time=at))
                gscore = -info['score'].relative.score(mate_score=32000)

            # Determine if epmove is played or epmove is better than gmove.
            if gmove == epmove:
                played_ep += 1
            elif epscore > gscore:
                better_epmove += 1

                # Save the epd where the ep move is better but not played.
                epdr = f'{board.epd()} c0 "engine_move: {bm}, engine_score: {bscore}, game_move: {gmove}, game_score: {gscore}, ep_move: {epmove}, ep_score: {epscore}";'
                epds.append(epdr)

engine.quit()

print('Better ep move but not played:')
for e in epds:
    print(e)

print(f'num_games: {gcnt}, possible_ep: {possible_ep}, played_ep: {played_ep}, better_epmove_than_played_move: {better_epmove} ({100*better_epmove / possible_ep:0.2f}%)')

```

## Sample output

World Rapid Team Championship 2023 games.

Better ep move but not played by the player in the game.

```
rnbqk1nr/pp3p1p/3p2p1/2pPp3/2P1P3/2P5/P4PPP/R1BQKBNR w KQkq e6 c0 "engine_move: a2a4, engine_score: 53, game_move: g1e2, game_score: 7, ep_move: d5e6, ep_score: 28";
2r1r1k1/5pbp/pp1p1np1/n2Pp2q/3NP3/PP4PP/1B1Q1PB1/R4RK1 w - e6 c0 "engine_move: d5e6, engine_score: 243, game_move: g3g4, game_score: -132, ep_move: d5e6, ep_score: 243";
8/1p6/6kp/pPp5/P3P3/8/5KPP/8 w - c6 c0 "engine_move: b5c6, engine_score: 581, game_move: b5b6, game_score: 532, ep_move: b5c6, ep_score: 581";
r2r2k1/1ppqbppp/2n1p3/8/pPPPb3/P1Q1BN1P/4BPP1/R2R2K1 b - b3 c0 "engine_move: a4b3, engine_score: 44, game_move: e7f6, game_score: -98, ep_move: a4b3, ep_score: 44";
rn1qkb1r/6p1/p2pp3/4p1Pp/4P3/1PN1B3/1PP4P/R2QK1R1 w Qkq h6 c0 "engine_move: g5h6, engine_score: 333, game_move: d1f3, game_score: 296, ep_move: g5h6, ep_score: 333";
2rr2k1/1p1b1pbp/nqpp1np1/p2Pp3/2PNP3/PPN3PP/1B3PB1/1R1Q1RK1 w - e6 c0 "engine_move: d5e6, engine_score: 138, game_move: d4e2, game_score: -50, ep_move: d5e6, ep_score: 138";
r3k2r/pp3p2/3P4/2pPp3/3q2pp/1R4P1/P1bN1PP1/4QRK1 w kq e6 c0 "engine_move: d5e6, engine_score: 0, game_move: b3e3, game_score: -67, ep_move: d5e6, ep_score: 0";
8/1pp1r1p1/p3k2p/P3Pp2/1P1RK2P/1PP3P1/8/8 w - f6 c0 "engine_move: e5f6, engine_score: 165, game_move: e4f4, game_score: 9, ep_move: e5f6, ep_score: 165";
3r1nk1/p5p1/1p2p1p1/5pP1/2P2P1P/P1P1RK2/3r4/2Q5 w - f6 c0 "engine_move: g5f6, engine_score: 31, game_move: e3e2, game_score: -57, ep_move: g5f6, ep_score: 31";
2r2r2/1b2b1kp/1q2p1p1/p1npPp2/2pN1PP1/PpP1PR2/1P1BQ2P/RB4K1 w - f6 c0 "engine_move: d2e1, engine_score: -101, game_move: g4g5, game_score: -222, ep_move: e5f6, ep_score: -158";
2r1r2k/5p2/5Pp1/1p4Pp/4PQ1P/3R4/1q6/3R1K2 w - h6 c0 "engine_move: g5h6, engine_score: -178, game_move: d3d7, game_score: -247, ep_move: g5h6, ep_score: -178";
rnbqkb1r/pp3ppp/4pn2/2p5/2PpP3/3P1NP1/PP3PBP/RNBQK2R b KQkq e3 c0 "engine_move: d4e3, engine_score: -43, game_move: b8c6, game_score: -54, ep_move: d4e3, ep_score: -43";
r2qr1k1/1p3pbp/p2p1np1/2pPp3/2PnP3/2N1B1P1/PP1Q1PBP/R4RK1 w - c6 c0 "engine_move: d5c6, engine_score: 29, game_move: c3e2, game_score: -41, ep_move: d5c6, ep_score: 29";
r1b2rk1/pp2b1pp/2q1p3/3pPp2/2pP3P/2N2P2/1PPQN1P1/R3K2R w KQ f6 c0 "engine_move: h4h5, engine_score: -193, game_move: e1f2, game_score: -174, ep_move: e5f6, ep_score: -133";
r1bq1rk1/1pb3pp/p4n2/3nNp2/P1NPpP2/2P5/1P2B1PP/R1BQ1RK1 b - f3 c0 "engine_move: c8e6, engine_score: -128, game_move: c8d7, game_score: -224, ep_move: e4f3, ep_score: -158";
1r1r2k1/pq5p/6pQ/4Pp2/3P3R/8/1n4PP/2B2RK1 w - f6 c0 "engine_move: c1b2, engine_score: 433, game_move: c1b2, game_score: 433, ep_move: e5f6, ep_score: 558";
3r1bk1/5p2/6p1/1Q4Pp/4P1K1/4RNP1/8/3q4 w - h6 c0 "engine_move: g5h6, engine_score: -26, game_move: g4f4, game_score: -471, ep_move: g5h6, ep_score: -26";

```

# Code 2

Revised code to calculate if ep move is top engine move, good move (score\_rate \>= 55%), bad move (score\_rate \<= 45) and equal move (score\_rate \> 45% and score\_rate \< 55%), regardless if this ep move is played or not in the actual game.

```
"""Get stats on unplayed but better ep move.

Read every positions in the game from pgn file. Check
if position has a legal ep move, the played move in the game
and if ep move is better than the played move by analyzing
the position with stockfish engine

requirements:
    pip install chess
"""

import chess
import chess.pgn
import chess.engine
from chess.engine import Cp

fn = 'wrapteam23.pgn'
gcnt = 0

# Modify engine here.
engine = chess.engine.SimpleEngine.popen_uci(
    r'F:\Chess\Engines\stockfish\sf16\sf16pop.exe'
)

# modify this if you use other stockfish version
WDL_MODEL = 'sf16'

engine.configure({'Hash': 256})
engine_id = engine.id['name']

possible_ep, played_ep, better_epmove = 0, 0, 0
top_engine_move, good_move, equal_move, bad_move = 0, 0, 0, 0
at = 0.5  # 1.0  # analysis time in seconds
epds = []

with open(fn) as pgn:
    while True:
        game = chess.pgn.read_game(pgn)
        if game is None:
            break

        gcnt += 1
        print(f'game {gcnt}')

        for node in game.mainline():
            board = node.parent.board()
            gmove = node.move  # the actual move played in the game

            # Check if there is legal ep capture.
            if not board.has_legal_en_passant():
                continue

            possible_ep += 1
            ep_square = board.ep_square

            # Get the best move and score of the engine from the current position.
            info = engine.analyse(board, chess.engine.Limit(time=at))
            bm = info['pv'][0]
            bscore = info['score'].relative.score(mate_score=32000)

            # Determine the ep move score.
            if bm.to_square == ep_square:
                epmove = bm
                epscore = bscore
            else:
                for mv in board.legal_moves:
                    to_sq = mv.to_square
                    if to_sq == ep_square:
                        tboard = board.copy()

                        # Push this move and analyze the position with the engine.
                        # Negate the score because we push it.
                        tboard.push(mv)
                        info = engine.analyse(tboard, chess.engine.Limit(time=at))
                        epscore = -info['score'].relative.score(mate_score=32000)
                        epmove = mv
                        epexp = Cp(epscore).wdl(model=WDL_MODEL, ply=board.ply()).expectation()
                        break

            # Determine the game move score.
            if bm == gmove:
                gscore = bscore
            elif gmove == epmove:
                gscore = epscore
            else:
                tboard = board.copy()
                tboard.push(gmove)
                info = engine.analyse(tboard, chess.engine.Limit(time=at))
                gscore = -info['score'].relative.score(mate_score=32000)

            # Determine if epmove is played or epmove is better than gmove.
            if gmove == epmove:
                played_ep += 1
            elif epscore > gscore:
                better_epmove += 1

                # Save the epd where the ep move is better but not played.
                epdr = f'{board.epd()} c0 "engine_move: {bm}, engine_score: {bscore}, game_move: {gmove}, game_score: {gscore}, ep_move: {epmove}, ep_score: {epscore}";'
                epds.append(epdr)

            # Determine if ep move is strong or weak or close to equal.
            # Strong ep move:
            # 1. Top engine move.
            # 2. If not top, win percentage must be 55 or more percent.
            # weak ep move:
            # 1. win percentage is 45 and below percent
            # close to equal ep move
            # 1. win percentage is within [46 to 54] percent
            if epmove == bm:
                top_engine_move += 1
            elif epexp >= 0.55:
                good_move += 1
            elif epexp <= 0.45:
                bad_move += 1
            else:
                equal_move += 1

engine.quit()

# Summaries
print('Better ep move but not played:')
for e in epds:
    print(e)
print()

print(f'analysis engine: {engine_id}')
print(f'position analysis time (sec): {at}')
print(f'pgn file: {fn}')
print()

print(f'num games: {gcnt}')
print(f'possible ep move: {possible_ep}')
print(f'played ep move: {played_ep} ({100*played_ep/possible_ep:0.2f}%)')
print(f'better ep move than played move: {better_epmove} ({100*better_epmove / possible_ep:0.2f}%)')
print()

print(f'top engine ep move: {top_engine_move} ({100*top_engine_move/possible_ep:0.2f}%)')
print(f'good ep move: {good_move} ({100*good_move/possible_ep:0.2f}%)')
print(f'equal ep move: {equal_move} ({100*equal_move/possible_ep:0.2f}%)')
print(f'bad ep move: {bad_move} ({100*bad_move/possible_ep:0.2f}%)')

```

### Algorithm on good, bad, and equal ep move

```
if epmove == bm:
    top_engine_move += 1
elif epexp >= 0.55:
    good_move += 1
elif epexp <= 0.45:
    bad_move += 1
else:
    equal_move += 1

```

The epexp is the score probability (1, 0) of the ep move according to stockfish 16 at 0.5 second of analysis.

## sample output

```
analysis engine: Stockfish 16
position analysis time (sec): 0.5
pgn file: wrapteam23.pgn

num games: 1296
possible ep move: 146
played ep move: 81 (55.48%)
better ep move than played move: 18 (12.33%)

top engine ep move: 79 (54.11%)
good ep move: 10 (6.85%)
equal ep move: 19 (13.01%)
bad ep move: 38 (26.03%)

```

## Sample result from world cup 2023

```
analysis engine: Stockfish 16
position analysis time (sec): 0.5
pgn file: wcup23.pgn

num games: 677
possible ep move: 92
played ep move: 47 (51.09%)
better ep move than played move: 7 (7.61%)

top engine ep move: 39 (42.39%)
good ep move: 6 (6.52%)
equal ep move: 18 (19.57%)
bad ep move: 29 (31.52%)

```

# Code 3

Add ep stats by eco, opening and variation.

```
"""Get stats on unplayed but better ep move.

Read every positions in the game from pgn file. Check
if position has a legal ep move, the played move in the game
and if ep move is better than the played move by analyzing
the position with stockfish engine

requirements:
    pip install chess
"""

import chess
import chess.pgn
import chess.engine
from chess.engine import Cp

fn = 'wcup23.pgn'  # 'wrapteam23.pgn'
gcnt = 0

# Modify engine here.
engine = chess.engine.SimpleEngine.popen_uci(
    r'F:\Chess\Engines\stockfish\sf16\sf16pop.exe'
)

# modify this if you use other stockfish version
WDL_MODEL = 'sf16'

engine.configure({'Hash': 256})
engine_id = engine.id['name']

possible_ep, played_ep, better_epmove = 0, 0, 0
top_engine_move, good_move, equal_move, bad_move = 0, 0, 0, 0
at = 0.5  # 1.0  # analysis time in seconds
epds = []
eco_ep_data = {}

with open(fn) as pgn:
    while True:
        game = chess.pgn.read_game(pgn)
        if game is None:
            break

        gcnt += 1
        print(f'game {gcnt}')

        eco = game.headers.get('ECO', None)
        opening = game.headers.get('Opening', None)
        variation = game.headers.get('Variation', None)
        eco_cnt = 0

        for node in game.mainline():
            board = node.parent.board()
            gmove = node.move  # the actual move played in the game

            # Check if there is legal ep capture.
            if not board.has_legal_en_passant():
                continue

            possible_ep += 1
            ep_square = board.ep_square

            eco_cnt += 1

            # Get the best move and score of the engine from the current position.
            info = engine.analyse(board, chess.engine.Limit(time=at))
            bm = info['pv'][0]
            bscore = info['score'].relative.score(mate_score=32000)

            # Determine the ep move score.
            if bm.to_square == ep_square:
                epmove = bm
                epscore = bscore
            else:
                for mv in board.legal_moves:
                    to_sq = mv.to_square
                    if to_sq == ep_square:
                        tboard = board.copy()

                        # Push this move and analyze the position with the engine.
                        # Negate the score because we push it.
                        tboard.push(mv)
                        info = engine.analyse(tboard, chess.engine.Limit(time=at))
                        epscore = -info['score'].relative.score(mate_score=32000)
                        epmove = mv
                        epexp = Cp(epscore).wdl(model=WDL_MODEL, ply=board.ply()).expectation()
                        break

            # Determine the game move score.
            if bm == gmove:
                gscore = bscore
            elif gmove == epmove:
                gscore = epscore
            else:
                tboard = board.copy()
                tboard.push(gmove)
                info = engine.analyse(tboard, chess.engine.Limit(time=at))
                gscore = -info['score'].relative.score(mate_score=32000)

            # Determine if epmove is played or epmove is better than gmove.
            if gmove == epmove:
                played_ep += 1
            elif epscore > gscore:
                better_epmove += 1

                # Save the epd where the ep move is better but not played.
                epdr = f'{board.epd()} c0 "engine_move: {bm}, engine_score: {bscore}, game_move: {gmove}, game_score: {gscore}, ep_move: {epmove}, ep_score: {epscore}";'
                epds.append(epdr)

            # Determine if ep move is strong or weak or close to equal.
            # Strong ep move:
            # 1. Top engine move.
            # 2. If not top, win percentage must be 55 or more percent.
            # weak ep move:
            # 1. win percentage is 45 and below percent
            # close to equal ep move
            # 1. win percentage is within [46 to 54] percent
            if epmove == bm:
                top_engine_move += 1
            elif epexp >= 0.55:
                good_move += 1
            elif epexp <= 0.45:
                bad_move += 1
            else:
                equal_move += 1

        # Save ep counts by ECO opening.
        try:
            eco_ep_data[(eco, f'opening: {opening}', f'variation: {variation}')] += eco_cnt
        except KeyError:
            eco_ep_data.update({(eco, f'opening: {opening}', f'variation: {variation}'): eco_cnt})

engine.quit()

# Summaries

print(f'analysis engine: {engine_id}')
print(f'position analysis time (sec): {at}')
print(f'pgn file: {fn}')
print()

print('Better ep move but not played:')
for e in epds:
    print(e)
print()

print(f'num games: {gcnt}')
print(f'possible ep move: {possible_ep}')
print(f'played ep move: {played_ep} ({100*played_ep/possible_ep:0.2f}%)')
print(f'better ep move than played move: {better_epmove} ({100*better_epmove / possible_ep:0.2f}%)')
print()

print(f'top engine ep move: {top_engine_move} ({100*top_engine_move/possible_ep:0.2f}%)')
print(f'good ep move: {good_move} ({100*good_move/possible_ep:0.2f}%)')
print(f'equal ep move: {equal_move} ({100*equal_move/possible_ep:0.2f}%)')
print(f'bad ep move: {bad_move} ({100*bad_move/possible_ep:0.2f}%)')
print()

# ep move possibility by ECO.
eco_ep_data = dict(sorted(eco_ep_data.items()))
eco_ep_data = dict(sorted(eco_ep_data.items(), key=lambda item: item[1], reverse=True))
for k, v in eco_ep_data.items():
    print(f'{k}: {v}')

```

## Sample output

```
...

top engine ep move: 42 (45.65%)
good ep move: 8 (8.70%)
equal ep move: 16 (17.39%)
bad ep move: 26 (28.26%)

('C43', 'opening: Petrov', 'variation: modern attack, Symmetrical variation'): 4
('C53', 'opening: Giuoco Piano', 'variation: None'): 4
('A13', 'opening: English opening', 'variation: None'): 3
('A20', 'opening: English opening', 'variation: None'): 3
('B12', 'opening: Caro-Kann', 'variation: advance variation'): 3
('B40', 'opening: Sicilian', 'variation: Anderssen variation'): 3
('B45', 'opening: Sicilian', 'variation: Taimanov variation'): 3
('A22', 'opening: English', 'variation: Bremen, Smyslov system'): 2
('A22', 'opening: English opening', 'variation: None'): 2
('B33', 'opening: Sicilian', 'variation: Pelikan (Lasker/Sveshnikov) variation'): 2
('B50', 'opening: Sicilian', 'variation: None'): 2
('B51', 'opening: Sicilian', 'variation: Canal-Sokolsky (Nimzovich-Rossolimo, Moscow) attack'): 2
('C02', 'opening: French', 'variation: advance, Paulsen attack'): 2
('C44', 'opening: Scotch gambit', 'variation: Dubois-Reti defence'): 2
('C67', 'opening: Ruy Lopez', 'variation: Berlin defence, open variation'): 2
('D35', 'opening: QGD', 'variation: exchange, positional line'): 2
('D37', 'opening: QGD', 'variation: 4.Nf3'): 2
('D43', 'opening: QGD semi-Slav', 'variation: None'): 2
('D80', 'opening: Gruenfeld', 'variation: Stockholm variation'): 2
('A07', 'opening: Reti', "variation: King's Indian attack"): 1
('A08', 'opening: Reti', "variation: King's Indian attack, French variation"): 1
('A09', 'opening: Reti opening', 'variation: None'): 1
('A13', 'opening: English', 'variation: Neo-Catalan'): 1
('A13', 'opening: English', 'variation: Neo-Catalan accepted'): 1
('A13', 'opening: English opening', 'variation: Agincourt variation'): 1
('A28', 'opening: English', 'variation: four knights, Stean variation'): 1
('A29', 'opening: English', 'variation: four knights, kingside fianchetto'): 1
('A40', "opening: Queen's pawn", 'variation: English defence'): 1
('A42', 'opening: Modern defence', 'variation: Averbakh system'): 1
('A45', 'opening: Trompovsky attack (Ruth, Opovcensky opening)', 'variation: None'): 1
('A46', "opening: Queen's pawn game", 'variation: None'): 1
('A56', 'opening: Benoni defence', 'variation: None'): 1
('A62', 'opening: Benoni', 'variation: fianchetto variation'): 1
('A81', 'opening: Dutch defence', 'variation: None'): 1
('B11', 'opening: Caro-Kann', 'variation: two knights, 3...Bg4'): 1
('B23', 'opening: Sicilian', 'variation: closed'): 1
('B30', 'opening: Sicilian', 'variation: Nimzovich-Rossolimo attack (without ...d6)'): 1
('B31', 'opening: Sicilian', 'variation: Nimzovich-Rossolimo attack (with ...g6, without ...d6)'): 1
('B33', 'opening: Sicilian defence', 'variation: None'): 1
('B39', 'opening: Sicilian', 'variation: accelerated fianchetto, Breyer variation'): 1
('B52', 'opening: Sicilian', 'variation: Canal-Sokolsky attack, 3...Bd7'): 1
('B67', 'opening: Sicilian', 'variation: Richter-Rauzer, Rauzer attack, 7...a6 defence, 8...Bd7'): 1
('B90', 'opening: Sicilian', 'variation: Najdorf'): 1
('B90', 'opening: Sicilian', 'variation: Najdorf, Byrne (English) attack'): 1
('C07', 'opening: French', 'variation: Tarrasch, open variation'): 1
('C22', 'opening: Centre game', 'variation: Berger variation'): 1
('C42', 'opening: Petrov', 'variation: classical attack'): 1
('C44', 'opening: Scotch gambit', 'variation: None'): 1
('C46', 'opening: Four knights game', 'variation: None'): 1
('C50', 'opening: Giuoco Pianissimo', 'variation: None'): 1
('C65', 'opening: Ruy Lopez', 'variation: Berlin defence, Mortimer variation'): 1
('C72', 'opening: Ruy Lopez', 'variation: modern Steinitz defence, 5.O-O'): 1
('C80', 'opening: Ruy Lopez', 'variation: open, 8...Be6'): 1
('C80', 'opening: Ruy Lopez', 'variation: open, Bernstein variation'): 1
('C85', 'opening: Ruy Lopez', 'variation: Exchange variation doubly deferred (DERLD)'): 1
('D02', "opening: Queen's pawn game", 'variation: None'): 1
('D10', 'opening: QGD Slav defence', 'variation: exchange variation'): 1
('D31', 'opening: QGD', 'variation: semi-Slav, Marshall gambit'): 1
('D35', 'opening: QGD', 'variation: exchange variation'): 1
('D47', 'opening: QGD semi-Slav', 'variation: Meran variation'): 1
('D78', 'opening: Neo-Gruenfeld, 6.O-O c6', 'variation: None'): 1
('E04', 'opening: Catalan', 'variation: open, 5.Nf3'): 1
('E10', "opening: Queen's pawn game", 'variation: None'): 1
('E29', 'opening: Nimzo-Indian', 'variation: Saemisch, main line'): 1
('A01', 'opening: Nimzovich-Larsen attack', 'variation: classical variation'): 0
('A01', 'opening: Nimzovich-Larsen attack', 'variation: modern variation'): 0
('A04', 'opening: Reti opening', 'variation: None'): 0
('A05', 'opening: Reti', "variation: King's Indian attack"): 0
('A05', 'opening: Reti', "variation: King's Indian attack, Spassky's variation"): 0

...

```

# Answer
> 4 votes
We can of course grab the statistics for a period of time, compare the eval difference between performing EP and missing it and get some % in which it's best move.

The problem is, this wouldn't be by any means representative and informative to newer players because it still comes down to the fact that each position has it's own best move which is unique and bases on a vast number of factors.

I do believe that the best advice for beginners regarding EP is to simply remember it's possible and to calculate it as the first option when the opponent moves the pawn from the starting position next to your pawn

# Answer
> 3 votes
I don't think these statistics will work out anything like the way you suggest!

85% for castling seemed massively high, so I did a quick experiment, looking at the 15 top-rated blitz games in progress on lichess just now. All the players involved are rated 2400+.

By the end of the games, there had been (for white and black together) a total of 75 opportunities to castle king-side. In total there were 27 king-side castling moves. So on this small sample, you get something around 36%.

So you see that castling is extremely common *per game* but not particularly common *per opportunity*.

There are just too many cases where it's possible to castle but there's no hurry to do so. For example, one of the games followed a fairly normal-looking Spanish line:

1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. d3 b5 6. Bb3 Bc5 7. O-O h6 8. c3 d6 9. a4 Rb8 10. d4 Bb6 11. Bd5 Nxd5 12. exd5 Ne7 13. axb5 axb5 14. Na3 O-O ...

White castled at the 4th opportunity and black at the 8th. Obviously it would be bad for white to castle at the 1st opportunity - it loses a bishop.

Suppose you instead look at the proportion of times when a player castled at their first opportunity, as a proportion of the games that they have an opportunity to do so. In my small sample, even that larger statistic was 13/27, less than 50%.

On the other hand, in my small sample, *every* time a player had the opportunity to castle king-side, they did take it *eventually*: 27/27.

The en passant statistic would be harder to get a quick estimate of because the situation is so much rarer. Maybe someone with a database and some coding skills can oblige. But I would expect that statistic to be rather *larger* than the castling one. Quite often, when en passant is possible, it's a good move. And when it's not, the opportunity goes away immediately - you don't typically get 8 opportunities in a game as Black had for king-side castling in the game above. What makes you think that en passant moves per opportunity is in the region of 5%? Picking a number out of the air, I'm going to go with 50% (in high-level games). If someone wants to put in the time to do a calculation, it would be fun to find out how far off that flying guess is :)

**Edited to add**: in ferdy's answer he gets a statistic of 82/146 en passant moves played per opportunity, or roughly 56%, in a sample of 1296 games.

# Answer
> 2 votes
One issue I see with this kind of analysis is that it probably depends very highly on the experience of your opponent: playing against an inexperienced opponent, when an en passant move is available, it is quite likely that they didn't consider the possibility, which makes it more likely to be the best move. Playing against an experienced player, this is unlikely to be true. So to get a meaningful result you'd need to look at a wider variety of games than just high-level competitions, but with lower-level games your signal is likely to be lost in the noise produced by the frequent blunders made by less experienced players.

---
Tags: statistics, en-passant
---


# Question
Title: Why is this knight outpost from a Semi-Slav an inaccuracy?
```
[fen "rn1qk2r/4bppp/p1p1pn2/1p4B1/3P4/2NQPN2/PP3PPP/R3K2R w KQkq - 0 12"]

```

I played Ne5 which I thought was reasonable as it targets c6. But Stockfish 14+ goes from +1.1 to +0.2. What is the problem? Is it that if there is a trade on f6, the d4 pawn is pinned so can't actually defend the knight?

# Answer
> 6 votes
1.Ne5 here is misguided because it leads to the exchange of minor pieces, relieving Black of their relative lack of space and helping them to engineer the freeing ...c6-c5.

After 1...Nfd7! Black bumps both the knights and the bishops, forcefully leading to the exchange of White's most active pieces.

If White naively exchanges, 2.Bxe7 Qxe7 3.Nxd7 Nxd7, they only speed up Black development and after 4.0-0 0-0 followed by 5...c5, the White dominance of the center vanishes.

2.Bf4 Nxe5 3.Bxe5 Nd7 4.Bg3 is only marginally better : 4...0-0 followed by ...c5

Instead, with 1.0-0 intending e4 or the centralization of White's rooks, White keeps a small space advantage - although that should be very manageable for Black.

More ambitious is the thematic 1.Bxf6!? Bxf6 2.Ne4 intending Rc1 to expose the weakness of c6 and c5, e.g. 2...0-0 3.0-0 Be7 4.Rfc1 \[4.Rac1 is of course reasonnable, depending which of a4 or Rd1 will be most useful\] Qb6 5.Qc2 and Black still has to show how they plan to untangle their queenside. \[5.Ne5 forces a concession but 5...f6 6.Nf3 Nd7 7.Qb3?! c5 is not convincing ; 5.Qd2!? intending 5...a5 6.Ne5 or 5...Nd7 6.b4 is not natural but interesting\]

# Answer
> 0 votes
To my understanding is clear Stockfish gives three continuations. all of them starting with ...Nfd7 seems clear there is not anything else in the tree to be analyzed.

---
Tags: stockfish, evaluation, semi-slav
---


# Question
Title: Promote a piece to queen by moving back aside of king?
As I was trying out different chess applications I received a hint from the Lucas Chess virtual tutor, showing me I had a better option: Move piece C2 to C1. When I did that, the piece promoted to queen. I've tried this on chess.com with the same result. What (strange) rule is this, and where can I learn more about promotions?

EDIT: Or, maybe this got triggered by the fact I had a crashed play, and had set-up the board manual, making a mistake by flipping the board so the computer thinks I'm already on the other side. That must be it, right? :)

# Answer
I had a crashed play, and set-up the board manualy. As I was playing black, I mistakenly flipped the board. Thereby the computer thought I'm already on the other side.
> 1 votes

---
Tags: rules, pawn-promotion
---


# Question
Title: A different hashing algorithm for chess positions
This is not a question, it is a curious discovery I wanted to share

The most common hashing algorithm in chess programming is, I believe, Zobrist hashing. However, I may have found a different way of hashing. Beware that I'm just an amateur, so this could be entirely wrong. I'm confident this method can be considered hashing, but I don't know how to prove it, and also, I don't know if it is new, but I couldn't find anything on it on the internet.

So, the algorithm is actually pretty simple to conceptualize, for a given position, you get the number of attackers for each square for black and white, and basically that is it. If we say the maximum number of attackers per square is 16, we can use a byte to save both white and black attackers for each square using only 64 bytes.

Why would the maximum be only 16? Because in any legal position there is a maximum of 16 pieces for each side, and so the maximum number of attackers can only be 16. As I said, this is only valid for legal positions. If you want any position, the maximum number of attackers would be:

* 8 (for each square where a knight could be attacking) +
* 14 (for each square a vertical/horizontal moving piece could attack us from) +
* 13 (for each square a diagonal moving piece could attack us from),

so 35 maximum. From a computer science standpoint, this number is not as manageable as the first, that is why I chose only legal positions.

The way I conceptualize it being is the first 32 bytes for white and the rest for black, the first byte being for index one and two, squares a1 and b1 respectively, and so on for every byte.

A hashing algorithm must not yield the same result for two different inputs and must be difficult to work your way backwards.

This is the case for this algorithm, it is easy to compute the number of attackers per square, but it is hard to do it the other way round, and also, I believe, although as I said, I have no real proof of it, that every hash is unique to one position. Each hash is 64 bytes, so it is 256 bits, and so there are in theory 2^256 different hashes, despite some of them (or maybe most) being impossible to reach.

A chess board has around 5 * 10^44 positions, 2^256 equals 1.2 * 10^77, so it is a number a lot bigger than the number of legal chess positions. The chance of a hash repeating is really low. If you can prove me or show me how to prove that the hashes don't (or do) repeat, please do it.

A really nice property of this hash, is the if you sum all the white attackers and subtract from them all the black attackers, you get a somewhat stockfish accurate evaluation of the game. This is why:

A pawn, attacks 2 squares when it is not on the side of the board, so it contributes 2 to the eval. A knight, when it is in the middle, it attacks 8 squares, but the it is on the side or the corner it attacks less, so the eval naturally prefers knights in the middle than to the side, which is good. A similar thing happens with all the other pieces, except for the rook, that can attack 14 squares for any square it is on.

If we compute the average number of attacked squares for each piece, we get the following:

Pawn: 1.75
Knight: 5.25
Bishop: 8.06
Rook: 14.00
Queen: 22.06
King: 6.56

If we normalize it so a pawn has a value of 1 we get:

Pawn: 1.00
Knight: 3.00
Bishop: 4.61
Rook: 8.00
Queen: 12.61
King: 3.75

These piece values are not that far from the ones used on chess websites, in relative terms, everything is kind of the same, with two rooks being better than a queen, and in this case, a rook and a bishop being as valuable as a queen. The bishop is also more valuable than the knight, which is a thing many people take into account.

It is curious how such a simple algorithm can achieve almost the same behavior as some less generalized techniques like piece square tables.

Lastly, an advantage of this hash is that it is useful in neural networks, we can have 64 input neurons to encode the whole position. Some advanced chess neural networks could use this technique paired with some other important data for evaluating a position like which side it is to move. With this we can create evaluation functions based on neural networks that with only depth 1 pair which stockfish on depth 20,30 or more, it all comes down to the database.

If you found this interesting and want to build on it, you are free to do it, as long as you give me credit. I'm open to suggestions and questions.

Edit:
To clear some things, when I refer to the number of attackers I actually refer to the number of attackers without taking into account any blockers.

This hash is supposed to be a starting point for a more generalised evaluation function, the biggest problem with it is that calculating the number of attackers per square is slow, but that can be sped up by storing the bitboards representing the attacks for each square for each piece. I believe that a good programmer could make it faster, maybe by adding the attacks bitboards of each piece of a given side. It would be like (in terms of speed) piece square tables but instead of just adding values for each piece, we would do sums for each square, so while PST is 2 additions per piece, here it would be 64, so 32 times more. Probably using the fact that we only need 4 bits per square we could do some bit operations instead of adding ints like we would in PST. If we wanted to get an eval from this, it would be 128 additions if we don't use any weights. In the end, it would be still really slow, but maybe a little more useful?

Edit 2:
You are speaking a lot about tradeoffs in size, any idea on how to make this hash smaller, while keeping its characteristics (or at least most of them, the no collisions part is not a must, it's just a funny byproduct of this algorithm)?

# Answer
> 4 votes
Let me start out by elaborating on Hauke's comment: Add friendly pieces/pawns to b5, c6, e6, f5, f3, e2. Then a Na1 is hashed the same as a Nd4. So as presented this function is not collision free.

And some more general remarks:

In chess you usually use (Zobrist) hashes for transposition tables. These are supposed to be very small - e.g. 64 Bits - to ensure that the transposition table entries themselves can be very small. Since there are much more than 2^64 chess positions, there will necessarily be many collisions, however, the way Zobrist hashes are built seems to in practice lead to few enough collisions that this is not a big problem. (this also has to do with the fact that in an alpha-beta search, very rarely getting a wrong evaluation turns out to not affect the search result most of the time)

If you want a function that has no collisions, there are some simple ways to do this, for example you can take a bitboard of occupied squares, which will use 64 Bit and have at most 32 ones set. Then for those 32 ones you add on a 32 Bit-board denoting the colours and then 32 x 3 Bit for the piece type on each of those 32 Bits, for a total of only 192 Bit or 24 Bytes. For a more compact representation you can probably use something like this to calculate an index for the position among the list of all possible chess positions https://github.com/tromp/ChessPositionRanking

This is not really done in chess engines however, since Zobrist hashing is super fast (usually a couple of XORs which can be done in nano seconds), yields a small result and is generally "good enough". However, if you need something reliably collision free you may use the above.

You also mention that you want it to be difficult to compute a preimage for the hash. This is the case when talking about cryptographic hash functions, however, I can not think of many practical chess applications where one would want/need this property. In any case I am doubtful one can make such a simple hash that is collision free and (cryptographically) hard to compute preimages.

Finally, you do mention that it approximates some evaluation functions. And that is indeed where I think this is useful. In particular, having a map of attackers per side and square can be useful in evaluation both directly (add everything up and you got a pure "activity eval" which while not super strong can play some reasonable-ish chess) as well as for further evaluation terms, for example you can count the number of attacks on squares adjacent to each sides king to get a measure for how endangered the respective kings are. Nowadays many engines use NNs directly as their evaluation function, however, at least back in the day that was a useful evaluation term to have. Furthermore, I think giving a NN something similar to this in addition to the position has been done in Shogi (?) back in the days. I do not know whether it is still used and/or whether it is/was at some point successful in chess.

(also this post was written while being sick so please excuse (and point out) any mistakes I may have made)

---
Tags: software, chess-algorithms, chess-ai
---


# Question
Title: Is there a real version of the chess puzzle from The Yiddish Policeman's Union? If not - can it be made?
I will preface this by saying that the following contains a spoiler for Michael Chabon's *The Yiddish Policeman's Union*, so tread carefully.

Chess features heavily in the book and a major plot point is a seemingly in-progress game that a young man was playing while he was murdered. However, at the end, it turns out that it wasn't a game at all - it was a *puzzle*. Here are the details of the puzzle as it is described in the book.

* White still has two knights on the board in the position.
* White to move and mate in 2. *(Not 3, see comments under answer below)*
* White can try by underpromoting the b-pawn to a third knight. *(Tempting, but not the key, see comments under answer below)*
* Black has a pawn on d7 that he must move at this point, though it is unclear if it is because this is the only legal move, or if failing to do so would lead to a quicker checkmate.
* White instead plays the move Bc2, a move described in the book as, "a dull move \[that y\]ou don't even notice it at first."
* After White plays Bc2, Black is in zugzwang, and is compelled to move into their own eventual loss.
* Had White *not* played 2.Bc2, then White would still have mate in 3, not mate in 2.

Is this a real, pre-existing puzzle that anyone is familiar with? It sounds an interesting, but I can't work the mechanics of it out in my head. Surely the Black king must be in a wildly precarious position for the move 1.b8=N to be necessary - the only way I can rationalize it is if it somehow leads to a mating net, necessitating the king to be in the general vicinity of, say, a5. I'd love to know if something real can be made out of this, or if it's possible at all.

# Answer
Now which chess problem author will "high literature" reference?

Nabokov. That's a no-brainer.

It's in the afterword of the book!

```
[FEN "3N3B/KP1p2r1/1Qp1N2b/4k1nR/4BR2/2p3P1/4n3/8 w - - 0 1"]

```
> 5 votes

# Answer
I didn't find a problem for the original qualifications set in tbe question, so I created one.

```
[Title "me, chess.stackexchange.com 10/8/2023, Mate In 3"]
[FEN "8/1P1p4/1p3p2/1kn2Rp1/1B4K1/1P6/NN6/1B6 w - - 0 1"]

1. b8=N! d5 2. Bc2 d4 3. Bd3#

```
> 3 votes

---
Tags: problems, puzzles, identify-this
---


title: Tricky sidelines against the French?

text:
# Question
Title: Tricky sidelines against the French?
In my experience, the French is my weakest opening after e4. I used to play the advance variation against it but found that black gets really nice pressure in the center and by the middlegame white's center is kind of a liability. After switching to the exchange variation, it was hard to really push for much of an advantage since the position is basically equal.

My question is are there any tricky (tactical or offbeat) sidelines that will make black uncomfortable that are still objectively equal with perfect play from black? By the way, I'm 1600 on chess.com, since rating is probably relevant to the question.

# Answer
Have a look at the Schlechter variation. It's a tricky sideline that almost always takes Black out of book and their known structures. White has interesting ideas, and some typical French moves are not great in this variation. There are also a few traps (that some 1600s fall for).

```
 [FEN ""]
 1. e4 e6 2. d4 d5 3. Bd3

```

If Black tries to get their known and favourite advance structure, White gets a very favourable version of it with a significant advantage.

The risk is low, if Black finds the best moves (very unlikely at 1600, as noone knows the theory), the game is objectively even (maybe practically slightly more pleasant for Black).

This video is a great introduction to the line. I also recommend to look at the ChessMood material created by experienced GM coaches, as it has a very high quality: Starter Course, Main Course. You can also consider IM Banzeas Sidelines Course on Chessable to learn the line and it's ideas.
> 1 votes

# Answer
There is an old gambit idea in advance, that was pioneered by Nimzowitsch & Keres. According to Sveshnikov (the authority on the advance variation) it leads to equality with best play.

```
 [FEN ""]
 1. e4 e6 2. d4 d5 3. e5 c5 4. Nf3

```

The point is that you sacrifice your d4 pawn and in exchange black position is restrained by his own immobile center - black cannot pressure d4 if he has his own pawn on d4. So it's a positional sort of gambit, where you have longterm compensation.

Piece placement: place your bishop on d3, after black plays Ne7 play Bf4 with idea that you can answer Ng6 with Bg3. You castle short. Rook goes to e1, Queen often to e2.

There are three main motifs you have to be aware of:

1. you need to overprotect e5 pawn. If you place your pieces so that almost all of them are protecting e5, they will be quite harmonius and ready for kingside attack.
2. Greek gift sacrifice. If black castles kingside, greek gift sacrifice of the bishop on h7 works a lot of the time, since e5 makes Nf6 impossible.
3. h4-h5-h6 pawn push. Especially if black knight is on g6 - since then h5 forces it to move away from the king and so prepares greek gift sacrifice. Even if you don't have anything concrete this plan is desirable, since after h6 if black replies g6 he has a lot of dark square weaknesses on kingside. Start pushing h-pawn as soon as you are finished developing (if there isn't something better to do).

If black tries to break your center early with f6 it's usually dubious, check with engine.

For inspiration see Keres games in the variation.
> 1 votes

# Answer
This is a very relevant question. I myself am a 1.e4-player and something, which you will encounter a lot are players complaining about the french defense. I personally decided a long time ago, that going into the french positions only bears risk for a not so well prepared player (like me).

Finally I found something, where french players are really bad it (because they almost never face it). I started experimenting with sidelines. One line, which surely should not be viewed as a sideline is the KIA (Kings Indian Attack).

```
[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "*"]
[PlyCount "3"]

1. e4 e6 2. d3 *

```

Black has many possible setups, but all are a little different from the usual french structure. I have played this line with white and black against titled players. It has always been fun and exciting. Surely not, what a french player seeks, when he pushes his e-pawn one move forward.

I have also analysed a quick win by Georg Meier in a very important sideline of the KIA. Meier-Parkhov
> 1 votes

# Answer
I propose the ***Exchange French Defense***. Garry Kasparov, when he was world chess champion, played it several times with success. The main advantage is psychological, French players like some kind of pawn structures that you are avoiding with this line. However, the position is almost equal. The best player will win. If you study games played with this line, you will have a good start in your French games.

Here is one of the games that Kasparov won with that line: https://www.chessgames.com/perl/chessgame?gid=1070560

Here is a video that can inspire you about the same game: https://www.youtube.com/watch?v=zNHO-vINDJc

There is a book that you can buy. Here are some pages offered by the publisher, ***New In Chess***, to motivate you to buy: https://www.newinchess.com/media/wysiwyg/product\_pdf/3756.pdf

The author is GM Alexander Fishbein: https://en.wikipedia.org/wiki/Alexander\_Fishbein

You can buy the book on Amazon, if you wish: https://www.amazon.com/stores/Alex-Fishbein/author/B075N1DG4Z?ref=ap\_rdr&store\_ref=ap\_rdr&isDramIntegrated=true&shoppingPortalEnabled=true
> 0 votes

# Answer
First off: the French Defense is a "correct" opening and you cannot expect to get some "automatic" advantage playing against it - the same way you can't expect to get an advantage in the Ruy Lopez, the Italian, or any other correct opening. That doesn't mean there aren't some lines which lead to either white or black advantage. But given best play from both sides you will end up in some balanced middlegame position.

Second: the main theme of the French is "counterattack". White is allowed to expand his center - only to have it attacked and eventually blown apart later. On the other hand black always has the light-squared bishop as a liability, because the pawn structure remains fixed for a long time and most black pawns are on the white squares.

There are some offbeat lines for white which are still "correct" in the sense that black can play correctly and still have no advantage automatically. The "offbeat" merely means that the resulting structures are unusual for the French Defense:

a) **Chigorin Variation**
After 1. e4 e6 2. Qe2!? black cannot really play d5 because the e-pawn, which would naturally take back in case of exd, is pinned and Qxd5 is uncomfortable because Nc3 would win a tempo. Black usually responds with 2. ... c5 and the game will develop very similar to the closed Sicilian, with the white light-squared bishop usually ending on g2 (otherwise white would have to lose an additional tempo to bring the queen out of the way). The resulting positions are about level.

b) **Aljechin-Chatard**
In the main variation (1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7) The classic continuation is to exchange the Bishop on e7, but 6.h4!? is also possible. This is a gambit, but black's position becomes dangerous after 6. ... Bxg5 7. hxg5 Qxg5 8. Nh3! (hitting the queen) and a following Qh5. A typical motive is the sacrifice of a knight on e6, tearing open the black position and breaking through in the center. In the end the gambit leads to equality, not more (once again, the French is still "correct"), although the tendency of the game ending in anything else than a draw is high.

c) **Tarrasch Variation**
After 1. e4 e6 2. d4 d5 instead of the "normal" move 3. Nc3 (the "classical variation") white can also play 3. Nd2!?. on the upside d4 can be reinforced by c2-c3, the downside is that the bishop c1 is temporarily shut in. Black can steer the game into rather quiet waters by 3. ... dxe (the "Rubinstein variation") and it makes no difference if the white knight takes back coming from c3 or d2. Black can also play 3. ... c5 (the "open variation"), resulting in a lively game. Black can also ignore white's setup completely and play 3. ... Nf6.
> 0 votes

---
Tags: opening
---


# Question
Title: What would the Best move for Black be in Algebraic Chess Notation?
What would the best move for black be in algebraic chess notation?

```
[Title "Black to play and win"]
[fen "7k/1p4p1/p4b1p/3N3P/2p5/2rb4/PP2r3/K2R2R1 b - - 0 1"]

```

# Answer
> 2 votes
Rc1+ leads to mate in 2

```
[fen "7k/1p4p1/p4b1p/3N3P/2p5/2rb4/PP2r3/K2R2R1 b - - 0 1"]

1...Rc1+ 2. Rxc1 Bxb2#

```

---
Tags: computer-chess, notation
---


title: What are some good endgame books?

text:
# Question
Title: What are some good endgame books?
I know some people have asked about general good books or middle game books. But I read someone said that the best way to start learning chess is by studying endgames, so I ask: What are some good endgame books and why?

# Answer
> 5 votes
I have four endgame books I value:

**1. *Basic Chess Endings* by Reuben Fine (1941, 573 pages)**

This is the basic endgame encyclopedia which I always referred to in my earlier days after I misplayed an endgame. If you can't find the endgame you are interested in in this book you are unlikely to find it anywhere. There is some explanation of ideas but not in great detail.

**2. *Understanding Chess Endgames* by John Nunn (2009, 231 pages)**

This covers 100 key endgame ideas which Nunn thinks are most important. Nunn was one of the first writers to make extensive use of computers in his work and consequently his analysis is always top quality. He explains difficult concepts well.

**3. *Amateur to IM* by Jonathan Hawkins (2012, 369 pages)**

Ostensibly this is about how Hawkins, who learned the game at age 8, went from being a club level player in his late teens to an IM a few years later. He puts it all down to learning endgames. The first part is given over to explaining how to think and plan in the endgame along with some easier (but not that easy) endgames. The second part covers the endgames Hawkins thinks are essential. Part three covers difficult master level endgames like KRB vs KR, the minority attack in Karlsbad structures and KR+3 kingside pawns vs KR+3 kingside pawns + 'a' pawn.

**4. *Van Perlo's Endgame Tactics* by GC van Perlo (2006, 607 pages)**

To lighten up endgame study this is a book with over 1300 endgame tactical problems because we all love tactics.

# Answer
> 2 votes
**Silman's Complete Endgame Course**, Jeremy Silman

# Answer
> 1 votes
To beginners, to average players, and to about every player, I would recommend Paul Keres' ***Practical chess endings***, you will love it.

---
Tags: analysis, endgame, books, recommendations
---