What are Tablebases?
Tablebases are databases containing perfect play information for all possible positions with a limited number of pieces. They answer two key questions:- What is the objective outcome? (Win, draw, or loss)
- What is the optimal move? (Best move with fewest moves to conversion or mate)
Tablebases provide perfect information - not engine evaluation, but mathematically proven best play assuming both sides play optimally.
Syzygy Tablebases
Obsidian Chess Studio uses the Syzygy tablebase format, hosted by Lichess:7-Man Tablebases
Complete 7-piece endgame databaseCovers all positions up to 7 pieces
Online Access
No download requiredInstant access via Lichess API
Free & Fast
Free for all usersSub-second response times
API Integration
Lichess Tablebase Endpoint
Fetching Tablebase Data
Response Structure
Position Categories
Tablebase positions are classified into these categories:Win / Loss
Win / Loss
Win: Current side to move can force a win with optimal play.Loss: Current side to move will lose with optimal defense.
Draw
Draw
Draw: Position is a theoretical draw with perfect play.Includes:
- Insufficient material
- Stalemate
- Positions where neither side can make progress
Cursed-Win / Blessed-Loss
Cursed-Win / Blessed-Loss
Cursed-Win: Technically winning, but will be drawn by the 50-move rule.Blessed-Loss: Technically losing, but can force a draw via the 50-move rule.
These occur in long endgames where optimal play exceeds 50 moves without a capture or pawn move.
Maybe-Win / Maybe-Loss
Maybe-Win / Maybe-Loss
Maybe-Win: Winning position where optimal play depends on 50-move rule enforcement.Maybe-Loss: Losing position where optimal defense relies on 50-move rule.
Unknown
Unknown
Unknown: Position not in tablebase (> 7 pieces) or couldn’t be determined.Falls back to engine evaluation for these positions.
Distance Metrics
DTZ (Distance to Zeroing)
Definition: Number of moves until a capture or pawn move (zeroing move) with optimal play.DTZ is the primary metric for Syzygy tablebases because it respects the 50-move rule.
DTZ = 15: Optimal play reaches a capture/pawn move in 15 movesDTZ = 0: Current position requires an immediate capture/pawn move
DTM (Distance to Mate)
Definition: Number of moves until checkmate with optimal play. Key Difference: DTM ignores the 50-move rule, while DTZ respects it.Display Logic
- Show DTM if available (exact mate length)
- Otherwise show DTZ (50-move rule compliant)
- For draws, show outcome only
User Interface
Tablebase Panel
The tablebase information appears in the Analysis panel:Move Display
Moves are displayed in a grid with outcome badges:Move Sorting
Moves are sorted by outcome quality:- Winning moves (sorted by shortest DTZ)
- Drawing moves
- Losing moves (sorted by longest DTZ)
Caching Strategy
React Query Integration
- Infinite Stale Time: Tablebase data is immutable, so cached forever
- FEN-Based Keys: Each position cached separately
- Automatic Deduplication: Multiple requests for same FEN share one fetch
- Persistent Cache: Survives tab switches and navigation
Cache Invalidation
Tablebase cache is never invalidated because endgame theory doesn’t change. Only cleared on application restart or manual cache clearing.
Usage in Analysis
When Tablebases Activate
Tablebases automatically activate when:- Position has ≤ 7 pieces (including kings)
- Analysis panel is open
- Position is legal
- Network connection available
Interpreting Results
Check Category
Look at the badge color in the accordion header:
- White/Black: Winning for that side
- Gray: Draw
- Yellow: Cursed/Blessed/Maybe (50-move rule affects outcome)
Distance Metrics
Note the DTZ/DTM values:
- Low numbers = Quick conversion
- High numbers = Long endgame
- 50+ moves = Risk of 50-move rule draw
Practical Examples
Example 1: King and Pawn Endgame
Example 1: King and Pawn Endgame
Position:
8/8/8/4k3/8/4K3/4P3/8 w - - 0 1Tablebase Result:- Category:
win(White) - DTZ: 16
- Best Move:
Kd4(DTZ 15)
Example 2: Rook vs Rook and Pawn
Example 2: Rook vs Rook and Pawn
Position:
8/8/8/r7/8/8/1R6/4K2k w - - 0 1Tablebase Result:- Category:
draw - Best Move: Any (all draw)
Example 3: Cursed-Win
Example 3: Cursed-Win
Position: Complex 7-piece positionTablebase Result:
- Category:
cursed-win - DTZ: 53
Advanced Features
Fifty-Move Rule Indicator
Color Coding
- White Badge: White is winning
- Black Badge: Black is winning
- Gray Badge: Draw or unknown
Interactive Move Selection
Click any move in the tablebase panel to play it on the board:Limitations
- 7-Piece Maximum: Positions with 8+ pieces not supported
- Network Required: Online API requires internet connection
- Standard Chess Only: No support for variants (Chess960, etc.)
- 50-Move Rule Complexity: Cursed/blessed positions may be impractical
- No Positional Understanding: Tablebases only provide “perfect” moves, not instructive plans
Troubleshooting
Tablebase Not Loading
Tablebase Not Loading
Symptoms: Accordion shows “Loading” indefinitely or error message.Solutions:
- Check internet connection
- Verify position has ≤ 7 pieces
- Ensure position is legal
- Check Lichess API status at status.lichess.org
- Clear browser/app cache
- Retry after a few seconds (API rate limiting)
Unexpected Results
Unexpected Results
Symptoms: Tablebase shows surprising outcomes.Explanation: Tablebase results are mathematically perfect but may seem counterintuitive:
- Sacrifices that lead to winning pawn endgames
- Long king marches that are optimal
- Positions that “look” drawn but have forced wins
Performance Issues
Performance Issues
Symptoms: Slow API responses.Solutions:
- Check network speed
- Use wired connection if possible
- Wait for Lichess server load to decrease
- Results are cached - revisit position later for instant load
Best Practices
Verify Critical Positions
For important games, verify tablebase moves with engine analysis to understand the plan.
Learn Endgame Patterns
Use tablebases as a learning tool - study why certain moves are optimal.
Respect the 50-Move Rule
Pay attention to cursed/blessed positions - they may be impractical in real games.
Combine with Engine
Use both tablebase and engine for comprehensive endgame understanding.
Integration with Other Features
Engine Analysis
Tablebase results complement engine analysis:- Positions with ≤ 7 pieces: Tablebase provides perfect play
- Positions with 8+ pieces: Engine provides evaluation
- Transition Zones: Watch how engine moves aim for tablebase wins
Database Searches
Use tablebases to find critical endgame positions in your database:- Search for positions with few pieces
- Check tablebase outcomes
- Study games where players reached these positions
- Learn typical paths to winning/drawing endgames
Training
Incorporate tablebase positions into training:- Set up 7-piece positions
- Try to find the best move
- Check against tablebase
- Repeat until mastered
Technical Details
API Request Format
fen: URL-encoded FEN string of the position
Error Handling
200 OK: Success400 Bad Request: Invalid FEN or > 7 pieces429 Too Many Requests: Rate limited500 Internal Server Error: Lichess server issue
Related Resources
Game Analysis
Learn about other analysis features
Engine Integration
Configure chess engines
Puzzle Training
Practice tactical and endgame positions
Further Reading
For more information about Syzygy tablebases:
