Skip to content

Development

kachhy edited this page Mar 20, 2026 · 12 revisions

Board Representation

Axiom uses a bitboard board representation. This means that for every chess piece (white pawns, black knights, etc.) the board stores a single 64 bit integer, where the active bits represent the locations of the pieces.

Attack Generation

Attack generation is done via magic bitboards. We precompute attack tables at engine start to avoid any on-the-fly calculation of attacks during search or performance testing. There are many resources that can explain the workings of magic bitboards, such as this page on the Chess Programming Wiki.

Move Generation

Search

We use an alpha-beta Negamax framework for search.

Transposition Table

We employ statically-sized transposition table to memoize evaluated positions. The table itself is a 3-way associative container, with each slot consisting of 3 entries. Our cache replacement strategy is based on the depth of calculation for the entry and it's last visit time, penalizing entries that were visited longer ago than others, and the weakest entry is replaced. The current cache size is 16MB, however it will become resizable once UCI is fully implemented.

Evaluation

Our evaluation is currently purely classical. We used a phased evaluation which means every evaluation term has a middlegame score and an endgame score, and the evaluated score is interpolated based on the total material on the board (the board phase score).

Material

We value the material count of pieces as

S(82, 94), // PAWN
S(337, 281), // KNIGHT
S(365, 297), // BISHOP
S(477, 512), // ROOK
S(1025, 936), // QUEEN
S(0, 0), // KING

Piece Square Tables

Piece-square tables (PSTs) are a foundational evaluation technique in chess engines, assigning a static bonus or penalty to each piece based on its position on the board. PSTs alone are a crude approximation of true positional understanding, they form the backbone of the static evaluation function and have an outsized impact on overall playing strength, especially at shallow search depths.

Piece by piece evaluation

We apply special evaluation rules to the various chess pieces

Pawns

  • Pawn phalanx
  • Doubled pawns
  • Pawn control
  • Pawn protection
  • Passed pawns

Knights

  • Knight outposts
  • Knights behind pawns

Bishops

  • Bishop pair
  • Bad bishop
  • Bishop blocking pawn push penalty
  • Bishop color control

Rooks

  • Rook on 7th rank
  • Rook on semi-open/open file

Queen

  • Queen relative pin penalty

King safety

  • King pawn shield
  • Pawn storm threat
  • King on semi-open/open file penalty
  • Bonus for when the opponent has no queens

Other evaluation terms

Tempo

White gets a side-to-move static bonus.

Mobility

Different pieces get bonuses or penalties for the number of squares they are able to freely access.

Development

Clone this wiki locally