Skip to content

Implement proper 'Mate in X' and checkmate detection#217

Merged
kevinjosethomas merged 2 commits into
devfrom
211-stockfish-mate-logic
Aug 28, 2025
Merged

Implement proper 'Mate in X' and checkmate detection#217
kevinjosethomas merged 2 commits into
devfrom
211-stockfish-mate-logic

Conversation

@kevinjosethomas
Copy link
Copy Markdown
Collaborator

Summary

This PR resolves issue #211 by implementing proper mate display and checkmate detection for Stockfish analysis:

Mate Sign Display: Shows +M2/-M2 instead of just M2 to indicate whose mate it is
Checkmate Detection: Fixed positions showing "..." instead of "Checkmate"
Independent Detection: Added checkmate detection that works without Stockfish analysis
Maia Win Rate: Shows 0%/100% for mate and checkmate positions even when Stockfish data is missing

Test plan

  • Verify +M2 displays for white mate in 2, -M3 for black mate in 3
  • Confirm checkmate positions show "Checkmate" instead of "..."
  • Test Maia win rate shows 0%/100% for decisive positions
  • Ensure both client-side Stockfish and backend API evaluations work
  • Validate backward compatibility with normal centipawn evaluations
  • Run TypeScript compilation and ESLint checks
  • Verify Next.js build completes successfully

🤖 Generated with Claude Code

…fish analysis

- Display mate values as +M2/-M2 instead of +100/-100 to show whose mate it is
- Add independent checkmate detection that works without Stockfish analysis
- Fix checkmate positions showing "..." instead of "Checkmate"
- Set Maia win rate to 0%/100% for mate and checkmate positions
- Support both client-side Stockfish and backend API evaluation sources
- Maintain backward compatibility with normal centipawn evaluations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
maia-platform-frontend Ready Ready Preview Comment Aug 28, 2025 7:24am
maia-v1 Ready Ready Preview Comment Aug 28, 2025 7:24am

- Improve line breaks and indentation in MaiaModelSettings.tsx
- Fix text wrapping in SoundSettings.tsx
- Apply consistent code formatting per ESLint/Prettier rules

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@kevinjosethomas kevinjosethomas changed the title feat: implement proper mate display and checkmate detection for Stockfish analysis Implement proper 'Mate in X' and checkmate detection Aug 28, 2025
@kevinjosethomas kevinjosethomas merged commit 9306092 into dev Aug 28, 2025
7 of 9 checks passed
@kevinjosethomas kevinjosethomas deleted the 211-stockfish-mate-logic branch October 11, 2025 20:58
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.

1 participant