Winglet

Home * Engines * Winglet



Winglet, a didactic open source chess engine by Stef Luijten, written in C++ and licensed under the GNU General Public License. The development of Winglet was documented on the website tutorial Winglet, Writing a Chess Program in 99 Steps, started in 2011, now hosted by the Wayback Machine. Winglet is intended as bitboard version of TSCP with WinBoard support , and is loosely derived from Wing, Stef Luijten's former private engine , in the meantime also open source.

=Description=

Board Representation
Winglet applies a mixture of Kindergarten Bitboards and Magic Bitboards to determine sliding piece attacks with 32 KiB precalculated lookup tables[64][64] each on ranks, files, diagonals and anti-diagonals, indexed by square and hashed line occupancy - the inner six bits multiplied by a magic factor and shifted right by the strange looking 57, while 58 is more natural to ensure a six bit index range, using a constant factor (b-File) for all squares of a diagonal or anti-diagonal, ... U64 arrDiagonalAttacks[64][64]] /* requires initialization */

U64 diagonalKindergartenAttacks(U64 occ, enumSquare sq) { occ = (diagonalMaskEx[sq] & occ) * C64(0x0202020202020202) >> 58; return arrDiagonalAttacks[sq][occ]; } ... but "magic" Winglet factors are designed such that the most significant bit of the 64-bit product will always be clear, that is positive if interpreted as signed 64-bit integer. It seems, Winglet's occupied index calculations emulate Wing's rotated bitboard indices for same attack table layout: /*                Winglet's occupancy state             ==            Wing's occupancy state */ (occ & MG_DIAGA8H1MASK[sq]) * MG_DIAGA8H1MAGIC[sq] >> 57 == (occ045 >> DIAGA8H1_ATTACK_SHIFT[sq]) & 63 (occ & MG_DIAGA1H8MASK[sq]) * MG_DIAGA1H8MAGIC[sq] >> 57 == (occ315 >> DIAGA1H8_ATTACK_SHIFT[sq]) & 63 (occ & MG_FILEMASK[sq])    * MG_FILEMAGIC[sq])    >> 57 == (occ090 >> FILE_ATTACK_SHIFT[sq])     & 63

Search

 * Iterative Deepening
 * Alpha-Beta
 * Principal Variation Search
 * Quiescence Search
 * MVV-LVA
 * Static Exchange Evaluation
 * Null Move Pruning

Evaluation

 * Material Balance
 * Piece-Square Tables
 * Pawn Structure
 * Passed Pawn
 * Backward Pawn
 * Doubled Pawn
 * Isolated Pawn


 * Bishop Pair
 * Rook on Open File
 * Rook behind Passers
 * King Safety in Opening, Middlegame
 * Pawn Shield
 * King Tropism


 * King Centralization in Endgame

=See also=
 * Chesser by Syed Fahad
 * Godot by Ulysse Carion
 * Kenny by Kenshin Himura
 * Vajolet by Marco Belli
 * Wing by Stef Luijten

=Forum Posts=
 * writing a chess engine in xx steps by wing, Winboard Forum, April 18, 2011
 * Writing a chess program in xx steps by Stef Luijten, CCC, April 18, 2011
 * Chess Programming/Concepts for Beginners by MoldyJacket, OpenChess Forum, April 18, 2011

=External Links=

Chess Engine

 * Index of /chess/engines/Jim Ablett/WINGLET by Jim Ablett, hosted by Kirill Kryukov
 * PortugalTheMan/winglet · GitHub
 * winglet, writing a chess program in 99 steps by Stef Luijten, hosted by Abdullah Al-Ghaznawi

Misc

 * Winglet from Wingtip device - Wikipedia
 * Winglets and Sharklets | The Flying Engineer
 * Boeing 737 Winglets
 * Winglets | Airbus, a leading aircraft manufacturer

=References= Up one Level