Skip to content

Conversation

@luccabb
Copy link
Owner

@luccabb luccabb commented Jan 20, 2026

Summary

  • Implement iterative deepening (search depth 1, 2, 3, ... N)
  • Add aspiration windows for faster searches
  • Add TT move ordering (best move from previous search tried first)

Details

Iterative Deepening

Instead of searching directly to depth N, we search depth 1, then 2, then 3, etc:

for depth in range(1, target_depth + 1):
    score, move = negamax(board, depth, ...)

Benefits:

  • TT entries from depth N-1 improve move ordering at depth N
  • Enables future time management (stop when time runs out)
  • Killer moves accumulate across iterations

Aspiration Windows

After the first iteration, we use a narrow window around the previous score:

  • Initial window: ±50 centipawns
  • If search fails high/low, double the window and re-search
  • Fall back to full window if window exceeds ±500 cp

This reduces the number of nodes searched when the score is stable.

TT Move Ordering

  • Extract best move from TT lookup even if score can't be used
  • Put TT move first in the move list before all other moves
  • TT move is the best move found at a shallower depth, excellent for ordering

Test plan

  • All 64 unit tests pass
  • Verified iterative deepening visits all depths

🤖 Generated with Claude Code

@luccabb luccabb force-pushed the feature/mvv-lva-killer-moves branch from 0b53062 to 944a0e0 Compare January 21, 2026 06:40
@luccabb luccabb force-pushed the feature/iterative-deepening-aspiration branch from f205ab8 to cda6ab5 Compare January 21, 2026 06:41
@luccabb luccabb force-pushed the feature/mvv-lva-killer-moves branch from 944a0e0 to f1001bf Compare January 21, 2026 06:44
@luccabb luccabb force-pushed the feature/iterative-deepening-aspiration branch from cda6ab5 to 0a7dc0c Compare January 21, 2026 06:44
@luccabb luccabb changed the title [6/9] Add iterative deepening with aspiration windows and TT move ordering [4/7] Add iterative deepening with aspiration windows and TT move ordering Jan 21, 2026
@luccabb luccabb force-pushed the feature/mvv-lva-killer-moves branch from f1001bf to 98ee9e1 Compare January 21, 2026 07:33
…ering

Implements iterative deepening for better move ordering and future time management:

**Iterative Deepening:**
- Search depth 1, then 2, then 3, ... up to target depth
- Cache persists across all iterations (TT entries reused)
- Killer moves persist across iterations
- Best move from depth N-1 is tried first at depth N (via TT)

**Aspiration Windows:**
- After depth 1, use narrow window (±50 centipawns) around previous score
- If search fails outside window, re-search with doubled window
- Falls back to full window after 500cp expansion
- Reduces nodes searched when score is stable

**TT Move Ordering:**
- Save best move from TT lookup even if score can't be used
- Put TT move first in move list before searching
- Significantly improves move ordering at all depths

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@luccabb luccabb force-pushed the feature/iterative-deepening-aspiration branch from 0a7dc0c to 134def0 Compare January 21, 2026 07:33
@luccabb luccabb changed the title [4/7] Add iterative deepening with aspiration windows and TT move ordering [4/6] Add iterative deepening with aspiration windows and TT move ordering Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants