Skip to content

Insuffiect material draw and Perft testing#7

Merged
Mgrdich merged 3 commits intomainfrom
insuf-material-draw-and-perft-testing
Jan 6, 2026
Merged

Insuffiect material draw and Perft testing#7
Mgrdich merged 3 commits intomainfrom
insuf-material-draw-and-perft-testing

Conversation

@Mgrdich
Copy link
Owner

@Mgrdich Mgrdich commented Jan 6, 2026

No description provided.

@Mgrdich Mgrdich requested a review from Copilot January 6, 2026 12:30
@Mgrdich Mgrdich changed the title Insuf material draw and perft testing Insuffiect material draw and Perft testing Jan 6, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements insufficient material draw detection and perft (performance test) validation for the chess engine. It completes Slices 13 and 14 of the chess engine foundation specification.

Key Changes:

  • Implements insufficient material draw detection that automatically ends games when neither side can force checkmate (K vs K, K+B vs K, K+N vs K, K+B vs K+B with same-color bishops)
  • Adds perft testing functionality to validate move generation correctness against known benchmark positions
  • Implements FEN (Forsyth-Edwards Notation) parsing to create board positions from standard chess notation

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/engine/game_state.go Implements insufficient material detection logic with material counting and automatic draw status
internal/engine/game_state_test.go Comprehensive test suite for all insufficient material scenarios (K vs K, K+B vs K, K+N vs K, same-color bishops, etc.)
internal/engine/board.go Adds Perft and Divide methods for performance testing and debugging move generation
internal/engine/perft_test.go Test suite with known perft positions including starting position, kiwipete, and other standard benchmarks
internal/engine/fen.go FEN parser implementation with validation for piece placement, castling rights, en passant, and move counters
internal/engine/fen_test.go Tests for FEN parsing including valid positions, error cases, and specific FEN components
context/spec/001-chess-engine-foundation/tasks.md Marks Slices 13 and 14 as complete
context/spec/001-chess-engine-foundation/functional-spec.md Table formatting improvements for special rules section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Mgrdich Mgrdich merged commit b9f5dd5 into main Jan 6, 2026
1 check passed
@Mgrdich Mgrdich deleted the insuf-material-draw-and-perft-testing branch January 6, 2026 13:21
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