Apery

Home * Engines * Apery



Apery, an USI compliant open source Shogi engine developed by Takuya Hiraoka, initially written in C++, in 2019 ported to Rust , licensed under the GPL v3.0. Apery's search is derived from Stockfish with board representation and move generation adopted to Shogi, including magic bitboards for the sliding pieces rook, bishop, as well as the sliding attack subsets of the promoted dragon and horse - of course due to the 7-bit inner piece occupancy of the 9x9 board, somewhat bigger tables. The improved search of the Rust version makes it stronger than the C++ version, despite a little bit lower NPS. Apery's initial evaluation was Bonanza like, using piece-square tables indexed by king location and further two-piece locations, dubbed KPP or KKP. More recent versions require evaluation function binaries as a sub-module as specified by the USI Eval_Dir command. Since 2012, Apery regularly participates at World Computer Shogi Championships. It won the WCSC24 in 2014, and became third at the WCSC28 in 2018.

=Bitboards= Shogi Bitboards are defined as array of two quad words.

C++
The C++ Apery has a conditional compiled union type with 128-bit type __m128i, explicitly taking advantage of SSE2 and SSE4 instructions. class Bitboard { ... private: union { u64 p_[2]; __m128i m_; };   u64 p_[2];  // p_[0] : Seeing from the front, 1 to 79 are arranged vertically. Use 63 bits. Call it right.. // p_[1] : Seeing from the front, 8 bits from 1 to 19 are arranged vertically. Use 18 bits. Call it left. };
 * 1) if defined (HAVE_SSE2) || defined (HAVE_SSE4)
 * 1) else
 * 1) endif

Rust
pub struct Bitboard { pub v: [u64; 2], } =Publications=
 * Takenobu Takizawa, Takeshi Ito, Takuya Hiraoka, Kunihito Hoki (2015). Contemporary Computer Shogi. Encyclopedia of Computer Graphics and Games

=Forum Posts=
 * Japanese Chess (Shogi) Engines USI - Shogidokoro-GUI 3.7.2 by Norbert Raimund Leisner, CCC, September 12, 2016
 * WinBoard 4.8.0 for Shogi - Tanuki USI Engine by Norbert Raimund Leisner, CCC, September 16, 2016
 * Re: The Stockfish of shogi by Fabian Fichter, CCC, January 07, 2020

=External Links=

Shogi Engine

 * Apery
 * GitHub - HiraokaTakuya/apery_rust: USI shogi engine written in Rust
 * GitHub - HiraokaTakuya/apery: a USI Shogi engine
 * WCSC30 Apery Appeal document (Japanese)

Misc

 * Roger Apéry from Wikipedia » Roger Apéry
 * Roger Apéry (1916 - 1994) - Biography - MacTutor History of Mathematics
 * Apéry's constant from Wikipedia
 * Apéry's theorem from Wikipedia

=References= Up one Level