Skip to content

Comments

feat: MaxGameStringLength API (#1452)#1

Open
SH20RAJ wants to merge 1 commit intomasterfrom
feat/max-serialization-length
Open

feat: MaxGameStringLength API (#1452)#1
SH20RAJ wants to merge 1 commit intomasterfrom
feat/max-serialization-length

Conversation

@SH20RAJ
Copy link
Owner

@SH20RAJ SH20RAJ commented Jan 29, 2026

This PR implements the MaxGameStringLength API as requested in Issue google-deepmind#1452.

Changes

  • Core API: Added virtual int MaxGameStringLength() const { return 0; } to the Game class in open_spiel/spiel.h.
  • Python Bindings: Exposed max_game_string_length in open_spiel/python/pybind11/pyspiel.cc.
  • Implementation: Implemented MaxGameStringLength for KuhnGame (Kuhn Poker).
  • Fixes: Fixed absl::MutexLock usage in spiel.h and bridge.cc where the mutex address was missing.
  • Tests: Added open_spiel/python/tests/max_game_string_length_test.py to verify the implementation.

Verification

Ran the new unit test:

  • Kuhn Poker (2 players) -> Returns 7
  • Kuhn Poker (3 players) -> Returns 11
  • Tic-Tac-Toe -> Returns 0 (default)

- Added MaxGameStringLength to Game class in spiel.h
- Exposed in python bindings (pyspiel.cc)
- Implemented for Kuhn Poker
- Fixed compilation errors in spiel.h and bridge.cc (MutexLock)
- Added unit test
SH20RAJ added a commit that referenced this pull request Jan 30, 2026
Includes:
- Optimization: Euchre computation simplification (Issue google-deepmind#3)
- Bug Fix: Phantom TTT history tracking (Issue #1)
- Bug Fix: Universal Poker action count logic clarification (Issue google-deepmind#4)
- Bug Fix: Standardize Kuhn Poker observation strings (Issue google-deepmind#5)
- Doc: Updated Go/PhantomGo URLs (Issue google-deepmind#2)
SH20RAJ added a commit that referenced this pull request Jan 30, 2026
Includes:
- Optimization: Euchre computation simplification (Issue google-deepmind#3)
- Bug Fix: Phantom TTT history tracking (Issue #1)
- Bug Fix: Universal Poker action count logic clarification (Issue google-deepmind#4)
- Bug Fix: Standardize Kuhn Poker observation strings (Issue google-deepmind#5)
- Doc: Updated Go/PhantomGo URLs (Issue google-deepmind#2)
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