You are currently viewing How Computer Chess Engines Calculate Moves

How Computer Chess Engines Calculate Moves

  • Post author:
  • Post last modified:February 24, 2026
  • Post comments:0 Comments

Patronized by many computer chess engines, grandmaster-level play is achieved by evaluating millions of positions each second by using algorithmic accuracy. The modern engines such as Stockfish or Leela Chess Zero are a combination of brute-force search and neural networks, which are able to beat human players due to their ability to explore levels that are impossible to visualize. This is their mechanics, their tree-running and their assessment, broken down, and you will understand why they are dominating 2800+ Elo ratings.

Position Representation

Boards are stored in engines as bitboards, 64-bit integers with each bit representing the presence of a square in the board (e.g. 1 white pawn, 0 empty). It is a SIMD friendly format which allows blazing fast operations such as pawn structure checks or king safety by bitwise AND/OR. Piece-square tables have fixed values: center pawns have higher scores ( +0.5 ) than edges (-0.1), calculated in advance to different levels of middlegame/endgame.

Move Generation

Move Generation
\

Legal actions create through magic bitboards of sliders (bishops/queens/rooks). Tables are pre-calculated occupancy to attack rays, eliminating the slow per-position loops. Pawns/underpromotions are done in terms of special routines; first priority is given to captures (MVV-LVA: most valuable victim, least valuable attacker). The production of engines is 30-50 moves per position with the removal of illegal moves such pinned pieces.

Search Algorithms: Minimax Backbone

The core is made up of minimax: at every ply (half-move) the engine is playing under the assumption that the opponent is going to play in a way that maximizes its score and minimizes that of the opponent. Alpha-beta pruning cuts the branch: when the value of a move is more than beta (the best of the opponent) then cut off the inferior lines. Repetitions with deepening: begin with depth=10, then continue to depth=20, but do most work on root (best-move) lines. Time management puts 80 percent in major variation.

Quiescence Search and Extensions

Raw minimax plays at positions of minimal disturbance; quiescence search plays only the captures (e.g. queen-hanging tactics) until the position is calm, and eliminates the effects of horizons such as invisible checks. Extensions probe forced wins (checks, promotions) or dynamic threats; pruning cuts cuts quiet moves at low depths or killer non-tactics.

Evaluation Function

Leaf nodes are ranked holistically: material (pawn=1, queen=9), but lent towards the end of the game (queens are devalued). Positional values: pawn arrangement (isolated=-0.4, passed=+0.7), king safety (open files=-1.0), mobility of pieces ( +0.1 per square). Ultimate bitbases (7 or more pieces) provide perfection of all tablebases; there is neural net (NNUE in Stockfish) which estimates using a combination of 50 or more features into a single value and is comparable to Monte Carlo rollouts.

Monte Carlo Tree Search (MCTS) in NN Engines

Monte Carlo Tree Search (MCTS) in NN Engines

Leela Chess Zero is based on AlphaZero: thousands of playouts are simulated at each node using a policy/value neural net. There are promising moves (softmax probabilities) which policy suggests; there is the value which is the probability of winning. It is a proven strength in comparison with traditional search, which does not grasp long-term plans but short-term shortsightedness.

Pruning and Optimizations

Late-move reductions (LMR) do not consider middling movements when beta-cutoff is reached; null-move pruning presumes a weakness of a pass. The positions are hashed in transposition tables to store the scores/flags (exact/lower/upper bounds) so as not to have to recalculate it. SMP (symmetric multi-processing) cores parallelize through null-window searches.

Late-move reductions (LMR)

Tuning and Hardware

Engines are self-enhanced through reinforcement learning or crowdsourcing fisktest (Stockfish). NNUE is accelerated using GPUs; the best hardware (i9/RTX 4090) explores 100M+ nodes/second at a depth of 40+.

Action Steps

Install Stockfish; solve PGNs using UCI commands. Study source code on GitHub. Play 10 depth 20 games – observe PV stability increase. Construct your engine: begin with minimax, then add alpha-beta, time bench nodes/second.

Master these layers, and you’ll decode silicon supremacy on the 8×8 battlefield.

Leave a Reply