{"type": "session", "harness": "opencode", "id": "chess-0107", "name": "Stockfish Alpha-Beta Search"} {"type": "message", "message": {"role": "system", "content": "You are an expert software engineer."}} {"type": "message", "message": {"role": "user", "content": "Explain Stockfish's search algorithm"}} {"type": "message", "message": {"role": "assistant", "content": "Stockfish uses alpha-beta with iterative deepening + Lazy SMP parallelism.\n\nCore search() is templated for Root/PV/NonPV nodes. Key heuristics:\n- Aspiration windows with progressive widening\n- Null move pruning (R=2, adaptive null move)\n- Futility pruning (margin varies with depth)\n- Razoring (static eval + margin < alpha)\n- ProbCut (captures with verification search)\n- Late move reductions (LMR) with history-dependent reduction\n- Singular extensions (negative extensions for TT moves)\n- Multi-cut pruning\n\nMovePicker implements staged generation as a state machine:\n1. TT move (instant)\n2. Good captures (SEE >= 0, history-scored)\n3. Quiets (history-scored)\n4. Bad captures (SEE < 0)\n5. Bad quiets\n\nLazy 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."}}