Home * Engines * Senpai

Senpai, (Japanese: 先輩)
an UCI compliant open source chess engine by Fabien Letouzey, written from scratch in C++11 and distributed under the GNU General Public License version 3. Senpai 1.0 was precisely published ten years after the release of Fruit 1.0 on March 17, 2014 [1] . It comes with one source file, senpai_10.cpp, structured by namespaces, further with executables for various platforms and operating systems, such as Linux, Mac OS, Windows and Android [2]. Senpai 2.0 released in November 2017 was a complete rewrite with a consistent codebase for multiple games such as Draughts, Chess960, Shogi, and Othello [3].
Katsushika Hokusai, The Great Wave off Kanagawa [4]


Board Representation

Senpai is a bitboard engine and maps consecutive bits to squares along a file (a1,a2,...,a8,b1,...h8). With the option to implement magic bitboards later, Senpai so far uses the Blockers and Beyond loop approach to determine attack-sets for all pieces except pawns, while Senpai 2.0 features PEXT bitboards for BMI2 platforms. BitScan aka trailing zero count, and population count use GCC builtins [5] if available for the target architecture, and otherwise rely on De Bruijn multiplication and SWAR-popcount. In Senpai 2.0 the copy/make approach is used, customary in games with fewer piece types than chess.

Senpai's Little-Endian File-Rank Mapping [6]


Senpai applies a parallel search with one master and a pool of helper threads, following the Young Brothers Wait Concept. The serial search is PVS alpha-beta with transposition table inside an iterative deepening framework with aspiration windows. Beside the obligarory Null move pruning and LMR, Senpai further uses late move pruning and more aggressive futility pruning the last few plies. Senpai 2.0 further applies restricted singular extensions and additional reduction/pruning of "losing" moves (SEE< 0).


Compared to Fruit's evaluation, Senpai has a more precise mobility considering safety and center weights, and evaluates tactical moves. Senpai 2.0 considers a tempo and space, and uses a scoring by logistic regression.


Senpai is a Japanese term applied to the mentor system in wide use in Japanese culture, roughly equivalent to the Western concept of a mentorship. In Japanese martial arts, the term Senpai generally refers to senior level students who hold a black belt [7] . Use in English may carry humorous or affectionate connotations. This is possibly due to (assumed) reference to modern Japanese media, or possibly a lexical gap [8] .

See also

Forum Posts

External Links

Chess engine



  1. ^ Senpai 1.0 (new engine) by Fabien Letouzey, CCC, March 17, 2014
  2. ^ Senpai Chess Engine - Computer Chess Programming hosted by Steve Maughan
  3. ^ Senpai 2.0 by Fabien Letouzey, CCC, November 10, 2017
  4. ^ The Great Wave off Kanagawa, Katsushika Hokusai, c. 1829–32, the first print in Hokusai's series Thirty-six Views of Mount Fuji, current location: Library of Congress, see Culture of Japan
  5. ^ builtin_ctzll, builtin_popcountll, Other Builtins - Using the GNU Compiler Collection (GCC)
  6. ^ Bibob image
  7. ^ Senpai and kōhai - Wikipedia
  8. ^ senpai - Wiktionary
  9. ^ Kohai 1.0 Released - a Senpai Derivative by Michael B, CCC, June 06, 2016
  10. ^ GitHub - MichaelB7/Kohai-Chess: UCI Chess Engine, a derivative of Senpai 1.0

What links here?

Up one level