Technical Specifications

At the moment, I lack ambition to explain all the jargon mentioned below. A thorough explanation would require a long series of articles. As a consequence, this page describes the technical implementation of MadChess in a manner meaningful only to those who have written a chess engine.

Includes

  • UCI Protocol (see UCI Feature Support)
  • Magic Bitboards
  • Alpha / Beta Negamax Search Algorithm
  • Principal Variation Search (PVS)
  • MultiPV
  • Cached Positions (of dynamic score and best move) in Hash / Transposition Table
  • Futility Pruning
  • Null Move Pruning
  • Late Move Pruning (LMP)
  • Late Move Reductions (LMR)
  • Quiet Search (quiescence search resolves all checks and captures)
  • Staged Move Generation
  • Move Prioritization
    • Best Move (from cached positions)
    • Captures by Most Valuable Victim, Least Valuable Attacker (MVV / LVA)
    • Pawn Promotion
    • Killer Moves
    • History Heuristic
  • Static Evaluation
    • Tapered (interpolated) between middlegame and endgame values
    • Score scaled down as game approaches draw by 50 moves (100 ply) without a capture or pawn move
    • Recognizes checkmate, stalemate, draw by repetition, and draw by insufficient checkmating material
    • Separate scoring (0) for pawnless, drawish endgames
    • Separate scoring for simple endgames (K vrs KP, K vrs KBN, K vrs KQ or KR)
    • Material Value
    • Piece Location
    • Pawns
      • Passed… and free (non-linearly scaled), and unstoppable, and escorted by king
      • Isolated
      • Doubled
    • Piece Mobility
      • For each individual knight, bishop, rook, and queen (encouraging development of all pieces)
      • Non-Linearly Scaled
    • King Safety
      • Near a semi-open file
      • Near squares attacked by enemy pieces
      • Pawn Shield
      • Distance of Defending Pieces
      • Non-Linearly Scaled
    • Threats
    • Bishop Pair
    • Minor Piece Outposts
    • Rook on 7th Rank (enemy king on back rank)
  • Limit-Strength Mode
    • Chess Knowledge
    • Search Speed
    • Move Error
    • Blunder Error
    • Blunder Percent
  • C# Programming Language
  • Compiled as a self-contained application using .NET 6
  • Windows Binary Executables (see Downloads page)
  • Clean Code

    • Procedural Code
    • Extensively Commented
    • Complies with JetBrains ReSharper rules
    • Hosted by GitHub

Does Not Include

  • Object Oriented Design (uses classes but no interfaces, derived types, or polymorphism)
  • Aspiration Windows (why not?)
  • Multi Threading (other than a dedicated search thread so main thread may continue to read standard input stream)
  • Any heap memory allocations during search
  • Any floating point math during search (integer math only, prefer division by power of 2 so C# compiler transforms to bit shift)
  • Any list access during search (arrays are faster)
  • Any foreach loops (foreach allocates an enumerator)
  • Any lambda (anonymous) methods (lambdas allocate a delegate)
  • Linux or Mac binary executables (because code is built on .NET 6, you may compile for these platforms if you wish)

Comments are closed.