⚖️ Infographic · Position Scoring

Explain Chess Engine
Evaluation Function

Search needs a leaf score — how much is this position worth in centipawns? Classical engines sum hand-tuned terms; modern ones use neural networks (NNUE).

📅 June 30, 2026⏱ 12 min read🏷️ PST · Tapered Eval · NNUE
Evaluation assigns a numeric score to a chess position from White's perspective (positive = White better). It runs at leaf nodes and during quiescence search. A good eval guides alpha-beta cutoffs; a bad eval makes even deep search play nonsense. Today's top engines use NNUE (Efficiently Updatable Neural Networks); learning engines still benefit from understanding classical material + PST + tapered design.

Approaches

Classical vs NNUE

Hand-crafted eval

Sum explicit terms: material, piece-square tables (PST), pawn structure, mobility, king safety. Weights tuned by humans or automated tuning (Texel tuning).

NNUE eval

Sparse neural net on piece features → hidden layer → output cp. Incrementally updated when pieces move. Trained on millions of positions. Stockfish default since 2020.

Classical stack

What Gets Summed?

Material
+900 Q
Piece-square tables
±30 cp
Pawn structure
±20 cp
Mobility
±15 cp
King safety
±40 cp
100Pawn value (cp)
320Minor piece (typical)
64Squares per PST
256Phase scale (0–256)

Tapered eval

Middlegame vs Endgame Blend

Game phase interpolates MG and EG PST values

Opening/MG (phase 256)TransitionEndgame (phase 0)

Knights worth more in closed middlegames; rooks worth more when files open. Phase = f(non-pawn material) — fewer pieces → lower phase → more endgame weights.

phase = gamePhase(); // 0 = EG, 256 = MG score = (mgScore * phase + egScore * (256 - phase)) / 256;

Components

Key Eval Terms

Material & PST

Base piece values plus per-square bonuses from lookup tables (separate MG/EG arrays). A knight on e5 scores higher than on a1.

Pawn structure

Doubled, isolated, backward, passed pawns — each has a penalty or bonus. Passed pawns especially ramp up toward promotion.

Mobility & space

Count legal moves or attacked squares per piece type. More active pieces → higher score. Cheap bitboard-based approximation.

🧠
NNUE (modern default)

Feature = (piece type, square, king bucket). Accumulator updated incrementally on make/unmake. Single forward pass → cp. Replaces most hand terms in Stockfish.

TermClassicalNNUE
MaterialExplicit sumLearned implicitly
Piece placementPST tablesFeature weights
King safetyPawn shield, attack unitsLearned from data
Update costO(pieces) sumO(1) accumulator delta

Build order for a hobby engine

Eval feeds search

Leaf scores drive alpha-beta, quiescence stand pat, and futility pruning.

Related: Search Algorithm · Quiescence Search · All Blogs