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

You are an expert software engineer.

User

Explain Stockfish's move ordering system

Assistant

MovePicker is a staged state machine that generates and scores moves lazily:

Stage 1: TT move (already known, instant)
Stage 2: Good captures - generated, SEE-filtered (>= 0), scored by history
Stage 3: Quiets - generated, scored by multiple history tables
Stage 4: Bad captures (SEE < 0, remaining)
Stage 5: Bad quiets (remaining)

Key optimizations:

  • Partial insertion sort with AVX-512 optimization
  • skip_quiet_moves() allows aborting quiet generation early
  • History tables used for scoring:
    • ButterflyHistory: piece-from-to * continuation
    • CapturePieceToHistory: capture-specific history
    • ContinuationHistory: move continuation patterns
    • PawnHistory: pawn structure dependent

Gravity-based history updates prevent unbounded growth:
val = val + clampedBonus - val * abs(clampedBonus) / D

This ensures recent results have strong influence while keeping values bounded.