Older Version Newer Version

GerdIsenberg GerdIsenberg Dec 23, 2014

**[[Home]] * [[Engines]] * Gibbon**
|| [[image:Zhu-Zhanji-Gibbons-at-Play.jpg link="http://commons.wikimedia.org/wiki/File:Zhu-Zhanji-Gibbons-at-Play.jpg"]] ||~ || **Gibbon**,
an [[UCI]] compliant [[Open Source Engines |open source chess engine]] by [[Eric Marathée]] written in [[Cpp|C++]]. Gibbon originated from [[Small-C]] in 2005, playing [[Massy 2006]] and improving since then. While featuring some [[Bitboards|bitboards]], it has no annoying [[Magic Bitboards|magic bitboard stuff]], and is a counter approach of a [[Fruit]] like programming style, full of [[http://en.wikipedia.org/wiki/Goto|gotos]], and difficult to follow [[http://en.wikipedia.org/wiki/Control_flow|control flow]] due to [[http://en.wikipedia.org/wiki/Indent_style|indent style]] and preprocessor switches for [[http://en.wikipedia.org/wiki/Conditional_compilation|conditional compilation]]. Gibbon computes a few [[Node|nodes]], but is an attempt to compute the right ones <ref>[[http://perso.numericable.com/monique.marathee/gibbon_home_page.html|gibbon home page]]</ref>. ||
|| Gibbons at Play <ref>Gibbons at Play - [[http://en.wikipedia.org/wiki/Chinese_painting|Chinese painting]] 15th century, Hanging scroll, ink and colors on paper, Current location: [[http://en.wikipedia.org/wiki/National_Palace_Museum|National Palace Museum]], [[http://en.wikipedia.org/wiki/Taipei|Taipei]], [[http://en.wikipedia.org/wiki/Taiwan|Taiwan]], [[http://de.wikipedia.org/wiki/Gibbons|Gibbons Wikipedia.de]] (German)</ref> ||~ ||^ ||
[[toc]]
=Features=
<ref>Features based on the [[http://perso.numericable.com/monique.marathee/gibbon_home_page.html|gibbon home page]]</ref>
==[[Search]]==
* [[Principal Variation Search]] (PVS) with [[Iterative Deepening]] and [[Aspiration Windows]]
* [[Transposition Table#TwoTier|Two-tier Transposition Table]], [[Pawn Hash Table]]
* [[Move Ordering]] with [[Hash Move]] and [[Killer Move|Killer Moves]]
* [[Internal Iterative Deepening]]
* [[Enhanced Transposition Cutoff]] (conditional compiled)
===[[Selectivity]]===
* [[Null Move Pruning]] with [[Depth Reduction R|R]] = 4
* [[Node Types|Non-PV nodes]] [[Pruning|pruning]] ([[Late Move Reductions]] [[Fail-Low]]/[[Fail-High]] [[History Heuristic|History]])
* [[Futility Pruning]]
* [[Futility Pruning#Extendedfutilitypruning|Extended Futility Pruning]]
* [[Extensions]] ([[Check Extensions]], [[Recapture Extensions]], [[Passed Pawn Extensions]])
===[[Quiescence Search]]===
* One [[Check|check]] allowed at the [[Horizon Node|horizon]]
* Quiescence [[Double Attack|heuristic for checks]] winning [[Hanging Piece|hanging pieces]]
* [[Static Exchange Evaluation]] (SEE)
* [[One Reply Extensions]] in quiescence
===[[Mate at a Glance]]===
* [[Checkmate|Mate in one]] recognition for queen moves
* Heuristic to identify moves threatening mate with queen and piece

==[[Evaluation]]==
* [[Lazy Evaluation]]
* [[Mobility]]
* [[Pawn Structure]] considering king placement 
* [[Passed Pawn|Passed Pawns]]
* [[Material|Trade down bonus]] that encourages the winning side to trade pieces but no pawns
* Incentive to keep the [[Queen|queen]] in case of material down
* Incentive to keep at least one [[Pawn|pawn]]
* [[Bishop Pair]]
===[[Opening]]===
* [[Development]]
===[[Middlegame]]===
* [[King Safety]] considering [[Castling rights|castling rights]]
* [[Outposts]]
===[[Endgame]]===
* [[Bishops of Opposite Colors]]
* [[Rule of the Square]]
* [[King Pawn Tropism]]
* [[King Centralization]]
* [[Draw evaluation]]
* [[Pawn Endgame]]

==[[Interior Node Recognizer]]==
* [[KPK]]
* [[Rook Endgame#KRPKR|KRPKR]]
* KQKQ
* [[Wrong color Bishop and Rook Pawn]]
* KNKP
* KBKP
* KRKP

==Misc==
* [[Incremental Updates|Incremental]] [[Move Generation]] (few [[Bitboards|bitboards]])
> => Gibbon knows all [[Legal Move|legal moves]], [[Material|material]], [[Mobility|mobility]], and check-giving squares
* [[Opening Book]]
[[#BitScan]]
=BitScan with Reset=
In [[Bitboard Serialization|serializing bitboards]], Gibbon applies a [[BitScan#BitscanwithReset|bitscan with reset]] based on the [[BitScan#DeBruijnMultiplation|De Bruijn multiplication]] approach published by [[Charles Leiserson]], [[Harald Prokop]] and [[Keith H. Randall]] in 1998 <ref>[[Charles Leiserson|Charles E. Leiserson]], [[Harald Prokop]] and [[Keith H. Randall]] (**1998**). //Using de Bruijn Sequences to Index a 1 in a Computer Word//, [[http://supertech.csail.mit.edu/papers/debruijn.pdf|pdf]]</ref>. The [[De Bruijn sequence]] chosen is even, which implies five leading zeros <ref>[[http://perso.numericable.com/monique.marathee/gibbon_home_page.html|gibbon home page]], Gibbon 2.57.a - uci - Cchess_2.h, Cchess_4.h, maj.cpp</ref>:
[[code format="cpp"]]
/**
 * bitScanForward
 * @author Charles E. Leiserson
 *         Harald Prokop
 *         Keith H. Randall
 * "Using de Bruijn Sequences to Index a 1 in a Computer Word"
 * @param bb bitboard to scan
 * @precondition bb != 0
 * @return index (0..63) of least significant one bit
 */
const char xindex64[64] = {
   63,  0, 58,  1, 59, 47, 53,  2,
   60, 39, 48, 27, 54, 33, 42,  3,
   61, 51, 37, 40, 49, 18, 28, 20,
   55, 30, 34, 11, 43, 14, 22,  4,
   62, 57, 46, 52, 38, 26, 32, 41,
   50, 36, 17, 19, 29, 10, 13, 21,
   56, 45, 25, 31, 35, 16,  9, 12,
   44, 24, 15,  8, 23,  7,  6,  5
};

#define set_bit_to_0(x64,xr)     (x64) &= ~((unsigned __int64)1<<(xr)) 

char SEARCH::bitScanForward_Clear(unsigned __int64 &bb) 
{
   char index;
   unsigned __int64  debruijn64 =(unsigned __int64)(0x07EDD5E59A4E28C2);
   ASSERT (bb != 0);
   // Ignorer le warning de compilation
   index=xindex64[((bb & -bb) * debruijn64) >> 58];
   set_bit_to_0(bb, index);
   return index;
}
[[code]]

=See also=
* [[Various Classifications#Mammal|Mammal]]
* [[Small-C]]

=Forum Posts=
* [[http://www.talkchess.com/forum/viewtopic.php?t=13171|Gibbon 2.32a : 2219]] by [[Patrick Buchmann]], [[CCC]], April 16, 2007
* [[http://www.talkchess.com/forum/viewtopic.php?t=14559|Gibbon 2.41a : 2258]] by [[Patrick Buchmann]], [[CCC]], June 19, 2007
* [[http://www.talkchess.com/forum/viewtopic.php?t=16825|Gibbon 2.42c : 2200]] by [[Patrick Buchmann]], [[CCC]], October 01, 2007
* [[http://www.talkchess.com/forum/viewtopic.php?t=26533|Gibbon 2.51a : 2249]] by [[Patrick Buchmann]], [[CCC]], February 12, 2009
* [[http://www.talkchess.com/forum/viewtopic.php?t=26839|Gibbon 2.52a : 2208]] by [[Patrick Buchmann]], [[CCC]], March 03, 2009

=External Links=
==Chess Engine==
* [[http://perso.numericable.com/monique.marathee/gibbon_home_page.html|gibbon home page]]
* [[http://www.computerchess.org.uk/ccrl/404/cgi/engine_details.cgi?print=Details+%28text%29&eng=Gibbon%202.57a%2064-bit|Gibbon 2.57a 64-bit]] in [[CCRL|CCRL 40/4]]
* [[http://computerchess.org.uk/ccrl/4040/cgi/engine_details.cgi?print=Details+%28text%29&eng=Gibbon%202.52a|Gibbon 2.52a]] in [[CCRL|CCRL 40/40]]
==Misc==
* [[http://en.wikipedia.org/wiki/Gibbon|Gibbon from Wikipedia]]
* [[http://fr.wikipedia.org/wiki/Gibbon|Gibbon, Wikipedia.fr]] (French)
* [[http://en.wikipedia.org/wiki/Gibbon_%28disambiguation%29|Gibbon (disambiguation) from Wikipedia]]

=References= 
<references />
=What links here?= 
[[include page="Gibbon" component="backlinks" limit="40" ]]
**[[Engines|Up one level]]**