En passant

Home * Chess * Moves * En passant

En passant (from French: "in passing") is a special pawn capture move, which is only possible immediately after an opposing pawn tried passing an advanced pawn on the fifth rank (or fourth for black pawns) by a double pawn push. This double pushed pawn can then be captured the same way, as it would only performed a single push - but only as an immediate reply.

This chess rule makes chess programming a bit harder. First, the target square of the en passant capture is not identical with origin of the captured pawn, opposed to all other captures. Second, the double pawn push, which triggered the immediate possibility of an en passant capture, must be part of the chess position. The information required is whether there was a previous pawn push, and if so, at least the file number of that pawn, considered as en passant target square inside the Forsyth-Edwards Notation (FEN), albeit with the redundant rank (3 or 6) as well.

=Legality Test= To prove an en passant capture is actually possible, at least the en passant target square should be under attack of an opponent pawn for pseudo legality. Further, for strict legality, the ep capturing pawn should not be absolutely pinned, which additionally requires a horizontal pin test of both involved pawns, which disappear from the same rank.


 * 8/6bb/8/8/R1pP2k1/4P3/P7/K7

8/6bb/8/8/R1pP2k1/4P3/P7/K7 b - d3 after d2-d4

The legality test should be best applied in making of the double pawn push, also considering updating Zobist keys to avoid dissimilarity of otherwise repeated positions if the first occurrence happened after a double pawn push with no en passant capture actually possible. =En passant bugs= The implementation of the en passant rule often caused subtle bugs. Almost every chess programmer had various issues with it, most notable Louis Kessler with his Program Brute Force. Gerd Isenberg had a special en passant experience with IsiChess at Aegon 1994 in the game versus Henk Arnoldus. IsiChess pushed its white pawn from b2 to b4 "between" the two advanced pawns a4 and c4 from Henk, allowing two possible en passant options. Unfortunately IsiChess only generated one - the "wrong" one (an assembly bug due to jc instead if jnz or that like, otherwise it would not have played it), and was immediately lost after Henk played the "right" one : [Event "9th AEGON man-comp"] [Site "The Hague NED"] [Date "1994.05.02"] [Round "4"] [White "IsiChess"] [Black "Henk Arnoldus"] [Result "0-1"]

1.e4 e6 2.d4 d5 3.Nd2 Nf6 4.e5 Nfd7 5.Bd3 b6 6.Ngf3 Ba6 7.O-O Bxd3 8.cxd3 Be7 9.Nb3 O-O 10.Bd2 Na6 11.Qe2 Qc8 12.Rac1 Qb7 13.Rc2 c5 14.Rfc1 Rfc8 15.dxc5 bxc5 16.Qe3 Nb4 17.Bxb4 Qxb4 18.Nbd2 a5 19.a3 Qb7 20.Kh1 Ra6 21.d4 c4 22.Qc3 a4 23.b4 axb3 24.Nxb3 Rxa3 25.Nfd2 Rb8 26.Rb1 cxb3 27.Rcb2 Bb4 28.Qc1 Bxd2 29.Rxd2 Ra2 30.Rdb2 Rxb2 31.Qxb2 Qb4 32.f4 g6 33.h3 Qc4 34.Rc1 Qd3 35.f5 Qxf5 0-1 2r3k1/1q1nbppp/r3p3/3pP3/pPpP4/P1Q2N2/2RN1PPP/2R4K 2r3k1/1q1nbppp/r3p3/3pP3/pPpP4/P1Q2N2/2RN1PPP/2R4K b - b3 0 23

=See also=
 * Algebraic Chess Notation - En passant
 * Captures
 * Castling
 * FEN - En passant target square

=Forum Posts=

1999

 * Hash Tables - Should one store EP, Castling rights etc? by Steve Maughan, CCC, January 30, 1999 » Castling Rights, Transposition Table
 * en-passant move generation by Larry Griffiths, CCC, February 06, 1999
 * Unique nodes, en passant and perfect hashing by Andreas Stabel, CCC, November 25, 1999

2000 ...

 * Does your program understand castling/en passant rights on 3x repetition by Richard A. Fowell, CCC, February 27, 2000 » Castling Rights, Repetitions
 * annoying en passant x-ray by Georg von Zimmermann, CCC, November 30, 2003

2005 ...

 * Programmer bug hunt challenge by Ed Schröder, CCC, May 04, 2007 » Portable Game Notation

2010 ...

 * en passant and hash key calculation by Fred Hamilton, CCC, March 21, 2010
 * Komodo 3 and a minor bug by Jouni Uski, CCC, September 02, 2011
 * Re: Causes for inconsistent benchmark signatures by Evert Glebbeek, CCC, March 27, 2013 » Forsyth-Edwards Notation
 * polyglot en passant square by Marco Belli, CCC, September 12, 2013 » PolyGlot
 * ep and castle rights hashing by Natale Galioto, CCC, September 15, 2013 » Castling Rights, Repetitions, Transposition Table
 * Abundance of castling vs en passant rights by Kirill Kryukov, CCC, April 14, 2014 » Castling
 * En-passant legality test by tetra, OpenChess Forum, August 07, 2014 » Legal Move

2015 ...

 * En passant bonus by Lyudmil Tsvetkov, CCC, February 10, 2015 » Pawn Structure
 * Dynamic EP flag by thevinenator, OpenChess Forum, October 02, 2015
 * Triple Repitition: Is this considered a repitition or not? by Jayakiran Akurathi, CCC, May 07, 2016 » Repetitions
 * Enpass + Castling for Zorbist hashes by Andrew Grant, CCC, January 06, 2017 » Castling Rights, Zobrist Hashing
 * Stockfish Chess 8 - en passant rule by Norbert Raimund Leisner, CCC, September 19, 2017
 * 3-fold repetition and cutechess-cli by Lars Mathiesen, CCC, January 14, 2018 » Repetitions
 * SYZYGY question by Robert Hyatt, CCC, August 11, 2019 » Crafty, Syzygy Bases

2020 ...

 * Being silly with perft and legal move generation by Jakob Progsch, CCC, May 19, 2021 » Perft, Legal Move Generation

=External Links=
 * En passant from Wikipedia
 * Boylston Chess Club Weblog: En passant
 * En Passant - The Bimonthly Journal of the Pittsburgh Chess Club by Bruce W. Leverett

=References=

Up one Level