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
    • Best Move
    • Good Captures
    • Pawn Promotions
    • Killer Moves
    • Losing Captures
    • Non Captures
  • Recognizes checkmate, stalemate, draw by repetition, and draw by insufficient checkmating material
  • Move Prioritization
    • Best Move (from cached positions)
    • Captures by history score with a victim material bonus (essentially MVV / LVA ordering influenced by capture history)
    • Pawn Promotion
    • Killer Moves
    • History Score
  • 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
    • 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
      • Enemy attacks on squares surrounding king
      • Proximity of attacking pieces
      • Near enemy semi-open file
      • Pawn shield
      • Proximity of defending pieces
      • Non-linearly scaled
    • Threats
    • Bishop Pair
    • Knight Outposts
    • Rook on 7th Rank with enemy king on back rank
  • Limit-Strength Mode
    • Chess Knowledge
    • Search Speed
    • Move Error
    • Blunder Percent
    • Blunder Error
  • C# Programming Language
  • Compiled as a self-contained application using .NET Core
  • Windows Binary Executables (see Downloads page)
  • Clean Code

    • Procedural Code
    • Extensively Commented
    • Complies with JetBrains ReSharper rules
    • Open source code maintained in a GitHub repository

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 multidimensional arrays (jagged arrays are faster)
  • Any foreach loops (foreach allocates an enumerator)
  • Any lambda (anonymous) methods (lambdas allocate a delegate)
  • Linux or Mac binary executables. Though, you may compile for these platforms if you wish.

Comments are closed.