Skip to content

Conversation

@luccabb
Copy link
Owner

@luccabb luccabb commented Jan 20, 2026

Summary

  • Add draw detection (fifty-move rule, insufficient material, repetition)
  • Properly handle check positions (search all evasions, not just captures)
  • Add is_tactical_move() helper for cleaner tactical move detection
  • Use best_score tracking instead of just alpha

Details

Draw Detection

The quiescence search now detects draws:

  • Fifty-move rule: board.is_fifty_moves()
  • Insufficient material: board.is_insufficient_material()
  • Repetition: Check board.is_repetition(2) after each move

Check Handling

When in check, the position is unstable and we can't use stand-pat for pruning:

  • Search ALL legal moves (evasions), not just tactical moves
  • Don't use stand-pat beta cutoff
  • Initialize best_score to -inf instead of stand_pat

Tactical Move Detection

New is_tactical_move() function that identifies:

  • Captures (material change)
  • Promotions (significant material gain)
  • Checks (forcing moves)

Previously used is_zeroing() which included quiet pawn pushes.

Test plan

  • All 64 unit tests pass
  • Verified proper handling of check positions

🤖 Generated with Claude Code

@luccabb luccabb force-pushed the feature/syzygy-tablebase-init branch from 82526b0 to 5f456a9 Compare January 21, 2026 06:40
@luccabb luccabb force-pushed the feature/quiescence-search-improvements branch from e8b9ff6 to df8a32b Compare January 21, 2026 06:40
@luccabb luccabb force-pushed the feature/syzygy-tablebase-init branch from 5f456a9 to edb7941 Compare January 21, 2026 06:43
@luccabb luccabb force-pushed the feature/quiescence-search-improvements branch from df8a32b to bfb11c1 Compare January 21, 2026 06:44
@luccabb luccabb changed the base branch from feature/syzygy-tablebase-init to master January 21, 2026 07:00
@luccabb luccabb changed the title [4/9] Improve quiescence search Improve quiescence search Jan 21, 2026
@luccabb luccabb force-pushed the feature/quiescence-search-improvements branch 2 times, most recently from 845a25a to 72e2bf9 Compare January 21, 2026 07:22
Enhances quiescence search with better draw detection and check handling:

- Add draw detection: fifty-move rule, insufficient material, repetition
- Proper check handling: when in check, search all evasions instead of
  only tactical moves (position is unstable, can't use stand-pat)
- Add is_tactical_move() helper for cleaner move filtering
- Update organize_moves_quiescence() to use tactical move detection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@luccabb luccabb force-pushed the feature/quiescence-search-improvements branch from 72e2bf9 to 7bcc2f0 Compare January 21, 2026 07:33
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