Commit Graph
2 Commits
Author SHA1 Message Date
rektdieandclaude 9643c7b0a5 feat: Chess960 support
Castling works with any rook placement: each castling right remembers
its rook square (Position::castle_rook), set from KQkq (X-FEN, the
outermost rook on that side of the king) or Shredder-FEN file letters.
Castling moves stay king-from to king-destination (g/c file), so move
indices, history tables and the bench are unchanged; make_move lifts
king and rook before placing them, since in 960 their squares can
overlap. Rights are dropped by a king move or a move from or to a
castling rook's square. Generation follows the 960 rules: every square
the king or rook crosses or lands on is empty apart from the two, and
no square the king crosses or lands on is attacked with the moving rook
out of the occupancy (the king's own square included when it does not
move: the rook leaving can uncover the rank). has_legal_move falls back
to full generation for non-standard castling setups.

UCI_Chess960 writes and reads castling as the king taking its rook;
FEN output uses KQkq for outermost rooks and file letters otherwise.
New command perftfile <epd> [depth] runs an EPD perft file.

Checked: the 960 positions of the standard Chess960 perft suite
(fischer.epd) all match to depth 5 (17.6 billion nodes), perftsuite 6
passes, has_legal_move agrees with full generation at every perft node
to depth 4 of the 960 suite, castling both ways over UCI in 960 mode.
Lc0's training data has about 4% Chess960 games, which the policy data
converter now keeps.

Bench: 529903

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:26:45 +01:00
rektdieandclaude d3044c0b88 feat: minimal MCTS engine with UCI
Bitboard board with fancy magics and fully legal move generation, checked
by a perft suite. PUCT search over a node arena with FPU reduction and
in-tree draw detection. Hand-written value (eval + quiescence) and
heuristic policy stand in until the network is trained. UCI loop with a
search thread, OpenBench-compatible bench and Makefile.

Bench: 546127

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 00:31:20 +01:00