This is a temporary, read-only recovery of the chessprogrammingwiki while a longer-term plan is worked out. Editing is not possible right now, but will be again soon.
Chess Programming Wiki All pages Other namespaces

Gibbon

Home * Engines * Gibbon

Gibbons at Play 1Gibbons at Play 1


  1. Gibbons at Play - Chinese painting 15th century, Hanging scroll, ink and colors on paper, Current location: National Palace Museum, Taipei, Taiwan, Gibbons Wikipedia.de (German)↩︎

Gibbon,
an UCI compliant open source chess engine by Eric Marathée written in C++. Gibbon originated from Small-C in 2005, playing Massy 2006 and improving since then. While featuring some bitboards, it has no annoying magic bitboard stuff, and is a counter approach of a Fruit like programming style, full of gotos, and difficult to follow control flow due to indent style and preprocessor switches for conditional compilation. Gibbon computes a few nodes, but is an attempt to compute the right ones 1.

Contents
  1. Features
    1. Search
      1. Selectivity
      2. Quiescence Search
      3. Mate at a Glance
    2. Evaluation
      1. Opening
      2. Middlegame
      3. Endgame
    3. Interior Node Recognizer
    4. Misc
  2. BitScan with Reset
  3. See also
  4. Forum Posts
  5. External Links
    1. Chess Engine
    2. Misc
  6. References

Features

2

Selectivity

Mate at a Glance

Evaluation

Opening

Middlegame

Endgame

Interior Node Recognizer

Misc

=> Gibbon knows all legal moves, material, mobility, and check-giving squares

BitScan with Reset

In serializing bitboards, Gibbon applies a bitscan with reset based on the De Bruijn multiplication approach published by Charles Leiserson, Harald Prokop and Keith H. Randall in 1998 3. The De Bruijn sequence chosen is even, which implies five leading zeros 4:

/**
 * 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;
}

See also

Forum Posts

Chess Engine

Misc

References

Up one level


  1. gibbon home page↩︎

  2. Features based on the gibbon home page↩︎

  3. Charles E. Leiserson, Harald Prokop, Keith H. Randall (1998). Using de Bruijn Sequences to Index a 1 in a Computer Word. pdf↩︎

  4. gibbon home page, Gibbon 2.57.a - uci - Cchess_2.h, Cchess_4.h, maj.cpp↩︎

Categories: Open Source · UCI · Mammal

What links here

Contributors: GerdIsenberg.