Skip to content

Latest commit

 

History

History
48 lines (38 loc) · 1.54 KB

howitworks.md

File metadata and controls

48 lines (38 loc) · 1.54 KB

How the engine works

SoFCheck is not significantly different from many other engines. It is based on recursive search with alpha-beta pruning. Here, we describe the algorithms in some more details.

Move generator

  • board representation: simple 8x8 array + bitboards
  • PEXT Bitboards (if supported by hardware) and Magic Bitboards (otherwise)

Search

  • Alpha-Beta Search with Principal Variation Search
  • Iterative Deepening
  • Quiescense Search for captures and pawn promotes to overcome horizon effect
  • multithreading via Lazy SMP
  • Transposition Table
  • move ordering in the following order:
    • move from Transposition Table
    • captures ordered by MVV-LVA
    • pawn promotes
    • Killer Heuristic
    • History Heuristic
  • Futility Pruning
  • Razoring
  • Null Move Reduction
  • Late Move Reduction

Evaluation

Evaluation function is linear to simplity its tuning. It includes:

  • Piece-Square Tables
  • Tapered Eval
  • King Safety
    • Pawn Shield
    • Pawn Storm
    • queen or rook near opponent's king
  • bonus for two bishops
  • pawn structure: isolated, double, passed, protected and backward pawns
  • open and semi-open lines

Coefficients for evaluation function are tuned using a method similar to Texel's Tuning Method, but with slight modification. The method is described in this post (in Russian). You can also refer to a Jupyter notebook used for tuning.