Expand description
§rs-Retroboard
A chess retrograde move generator. Rust port of Retroboard. Suitable for endgame tablebase generation.
§Status
Strong test suite but lack of comparaison of perft result against a trusted source.
§Specification
En-passant is supported, but not castling. Legal but unreachable positions are supported (mainly positions with too many checkers).
Examples of accepted unreachable positions:
8/4k3/3B1B2/8/8/8/8/4K3 b - - 0 1Impossible check8/8/R4k2/4p3/8/8/8/4K3 b - e6 0 1Impossible en passant square. e7e5 would have been illegal because black already in check.
It aims to follow the same generation rules as used by the generation software of syzygy and Gaviota tablebase.
§Performance
A very rough perft test at depth 4 on this position gives 88148797 moves in ~2s (tested on Apple M1). That is roughly 3.5x times slower than shakmaty crate, but is ought to be improved.
fen : q4N2/1p5k/3P1b2/8/6P1/4Q3/3PB1r1/2KR4 b - - 0 1, with 2PNBRQ in white pocket, 3NBRQP in black one, Q uncastling and allowing en-passant moves.
§Example
use retroboard::RetroBoard;
let r = RetroBoard::new_no_pockets("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1").unwrap();
assert_eq!(r.legal_unmoves().len(), 4);Modules§
- shakmaty
- Using the re-exported version of shakmaty will ensure no version clashes
Structs§
- Parse
Retro Pocket Error - Error when parsing an invalid retro UCI.
- Retro
Board - A
shakmaty::BoardwhereUnmoveare played and all legalUnmovecan be generated. It is the user responsability to ensure that position is legal. Unreachable positions are considered legal, for example this position. - Retro
Pocket - A
RetroBoardpocket with a counter for each piece type. It stores the pieces than can be uncaptured by each color.
self.unpromotionis the number of pieces than can unpromote into a pawn. By default it is set to 0 - Retro
Pockets - Wrapper around
RetroPocketthat provide handful functions to access them by color - UnMove
- Information about a move.
Enums§
Functions§
- perft
- From shakmaty code source Counts legal move paths of a given length.
Type Aliases§
- UnMove
List - A container for unmoves that can be stored inline on the stack.