tinycodinglm / chess /chess-0107.jsonl
winapiadmin's picture
Upload folder using huggingface_hub (part 12)
3c88a0f verified
|
Raw History Blame Contribute Delete
1.31 kB
opencode trace
System You are an expert software engineer.

You are an expert software engineer.

User

Explain Stockfish's search algorithm

Assistant

Stockfish uses alpha-beta with iterative deepening + Lazy SMP parallelism.

Core search<NodeType>() is templated for Root/PV/NonPV nodes. Key heuristics:

  • Aspiration windows with progressive widening
  • Null move pruning (R=2, adaptive null move)
  • Futility pruning (margin varies with depth)
  • Razoring (static eval + margin < alpha)
  • ProbCut (captures with verification search)
  • Late move reductions (LMR) with history-dependent reduction
  • Singular extensions (negative extensions for TT moves)
  • Multi-cut pruning

MovePicker implements staged generation as a state machine:

  1. TT move (instant)
  2. Good captures (SEE >= 0, history-scored)
  3. Quiets (history-scored)
  4. Bad captures (SEE < 0)
  5. Bad quiets

Lazy SMP: Multiple threads search independently from root. No locks in search loop. Shared lock-free TranspositionTable with racy RelaxedAtomic access. Best thread selected via vote-based mechanism.