Sekirei for developers

USI GUI

Install the engine with Cargo

Install Rust, run the command, then register the executable in a USI GUI.

$ cargo install sekirei

OPTIONAL NNUE

Load nn_r6 through EvalFile

Download and extract nn_r6. Verify its SHA-256, then set EvalFile to the full path.

CC BY 4.0

WebAssembly

The browser build exposes legal move generation, move application, and search to JavaScript.

Shogi engine development glossary

USI
The protocol between a shogi GUI and an engine. The GUI supplies a position and requests a search. The engine replies with bestmove.
SFEN
A one-line representation of the board, side to move, pieces in hand, and move number. It is useful when reporting a position-specific bug.
KIF
A game record format with Japanese move notation such as 7六歩. Used to exchange or replay games.
WebAssembly
A compiled format that lets code written in Rust and other languages run in a browser. Sekirei uses it for rules and search.
Search
Examining possible moves and replies. Alpha-beta search skips branches that cannot improve on the result already found.
Depth and nodes
Depth measures how far the search looks ahead. Nodes count position visits, including repeated visits to the same position.
Evaluation function
A function that scores a position. Material evaluation uses differences in piece values. NNUE can also use features such as piece placement.
NNUE
A neural network designed for efficient position evaluation. Its inputs can be updated incrementally as moves change the board.
Evaluation and cp
A unit for displaying evaluations, often scaled so a pawn is 100. Scales vary by engine. Check whether the score uses Sente’s or the side-to-move’s perspective.
Principal variation
The line beginning with the move the engine considers best. In search logs it shows the replies the engine expects.
MultiPV
Returns several lines with different first moves so you can compare alternatives.
Transposition table
A cache of search information for positions reached by more than one sequence. It can reuse score bounds and promising moves.
Mate search
Searches the defender’s replies to establish forced mate. The result can include a mate distance and mating line.

Browser version

Getting started with shogi AI