Skip to content

Conversation

@luccabb
Copy link
Owner

@luccabb luccabb commented Jan 20, 2026

Summary

  • Add Bound enum (EXACT, LOWER_BOUND, UPPER_BOUND) for correct TT behavior
  • Use Zobrist hash as cache key instead of FEN string (faster)
  • Store bound type and depth with each cache entry
  • Fix null move pruning condition (was missing null_move parameter check)
  • Update parallel engines to use new cache format

Details

The transposition table now correctly stores and uses bound information:

  • EXACT: Score is within the alpha-beta window, can be used directly
  • LOWER_BOUND: Node failed high (score >= beta), true score is at least this value
  • UPPER_BOUND: Node failed low (score <= alpha), true score is at most this value

This prevents incorrect cutoffs and score usage that can cause search instability.

Parallel Engine Updates

All parallel engines (lazy_smp, l1p, l2p) updated to:

  • Use Zobrist hash for cache key lookup
  • Use context managers for proper Pool/Manager cleanup
  • Fix score negation in l1p (opponent perspective -> our perspective)

Test plan

  • All 64 unit tests pass
  • Verified correct bound handling in search

🤖 Generated with Claude Code

@luccabb luccabb force-pushed the feature/transposition-table-bounds branch from bb2ac9f to f833c45 Compare January 21, 2026 06:40
@luccabb luccabb force-pushed the feature/psqt-evaluation-performance branch from bca3f3e to d7df55a Compare January 21, 2026 06:43
@luccabb luccabb force-pushed the feature/transposition-table-bounds branch from f833c45 to 7a14812 Compare January 21, 2026 06:43
@luccabb luccabb changed the base branch from feature/psqt-evaluation-performance to master January 21, 2026 07:00
@luccabb luccabb changed the base branch from master to feature/psqt-evaluation-performance January 21, 2026 07:06
@luccabb luccabb changed the title [2/9] Fix transposition table with proper bounds [2/7] Fix transposition table with proper bounds Jan 21, 2026
@luccabb luccabb force-pushed the feature/psqt-evaluation-performance branch from d7df55a to e21928a Compare January 21, 2026 07:33
luccabb and others added 2 commits January 20, 2026 23:33
Implements correct transposition table behavior with bound types:

**Transposition Table Changes:**
- Add `Bound` enum: EXACT, LOWER_BOUND, UPPER_BOUND
- Use Zobrist hash as cache key (fast integer vs slow FEN string)
- Store bound type and depth with each cache entry
- Only use cached scores when depth is sufficient
- Properly handle bound types in lookups:
  - EXACT: use score directly
  - LOWER_BOUND: use if score >= beta (fail high)
  - UPPER_BOUND: use if score <= alpha (fail low)

**Null Move Pruning Fix:**
- Added missing `null_move` parameter check (was always trying null move)

**Parallel Engine Updates:**
- Update lazy_smp, l1p, l2p to use new zobrist hash cache key
- Add context managers for Pool/Manager (proper resource cleanup)
- Fix score negation in l1p (opponent perspective -> our perspective)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@luccabb luccabb force-pushed the feature/transposition-table-bounds branch from 4f7fad5 to 1c7b8d9 Compare January 21, 2026 07:33
@luccabb luccabb changed the title [2/7] Fix transposition table with proper bounds [2/6] Fix transposition table with proper bounds 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