En passantbugs
Home * Chess * Moves * En passant
En passant (from French: “in passing”) [1] 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.
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 [2] .
En passant bugs
The implementation of the en passant rule often caused subtle bugs. Almost every chess programmer had various issues with it [3] , 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 [4] [5] :
See also
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
- ↑ Earliest Occurrences of Chess Terms by Edward Winter
- ↑ en passant and hash key calculation by Fred Hamilton, CCC, March 21, 2010
- ↑ Chrilly Donninger (1999). Computer machen keine Fehler. CSS 2/99, pdf (German)
- ↑ CSVN Downloads Games Aegon Tournaments
- ↑ Aegon 1994 Round 4 (REPOST) by Dap Hartmann, rgc, May 09, 1994