Skip to content

fix: Enforce Subgame Perfection in Sequence Form LP (#1304)#1467

Closed
SH20RAJ wants to merge 1 commit intogoogle-deepmind:masterfrom
SH20RAJ:fix/sequence-form-lp-subgame-perfection-1304
Closed

fix: Enforce Subgame Perfection in Sequence Form LP (#1304)#1467
SH20RAJ wants to merge 1 commit intogoogle-deepmind:masterfrom
SH20RAJ:fix/sequence-form-lp-subgame-perfection-1304

Conversation

@SH20RAJ
Copy link
Copy Markdown
Contributor

@SH20RAJ SH20RAJ commented Jan 30, 2026

Description

Enforces subgame perfection in the Sequence Form LP solver, addressing Issue #1304.
Previously, the solver could produce arbitrary policies (e.g., uniform random) in unreachable information states. This PR modifies the formulation to use dual variables (slacks) to extract game-theoretically optimal actions even in unreachable subgames.

Changes

  • Modified open_spiel/python/algorithms/sequence_form_lp.py to use slack variables for policy extraction.
  • Added check_subgame_perfection.py to verify the fix on Kuhn Poker (asserts Player 0 folds 'J' in unreachable subgame).

Verification

Dependencies

Requires cvxopt (and numpy).

…ind#1304)

- Add joint reachability detection and slack-based optimal action extraction in Python.
- Add reduced cost-based optimal action extraction in C++ (OR-Tools).
- Add verification script check_subgame_perfection.py to confirm subgame perfection in Kuhn Poker.
@SH20RAJ
Copy link
Copy Markdown
Contributor Author

SH20RAJ commented Jan 30, 2026

Hi @lanctot and the OpenSpiel team,

This PR serves as a core technical contribution for my GSoC 2025 candidacy. It addresses the subgame perfection issue in the Sequence Form LP solver (Issue #1304), which is critical for equilibrium finding in zero-sum games.

Summary for GSoC Context

  • Problem: The LP solver previously produced arbitrary policies in unreachable states, violating subgame perfection.
  • Solution: I implemented the use of dual (slack) variables to correctly infer optimal actions even when the realization probability is zero.
  • Validation:
    • Reproduced the original failure from PR Implement subgame perfection in Sequence Form LP solver (#1304) #1417.
    • Fixed the environmental/dependency issues (numpy/cvxopt import errors).
    • Added check_subgame_perfection.py which formally asserts that Player 0 folds a Jack in Kuhn Poker even in the unreachable subgame (the classic test case).
    • Verified that all existing regression tests in sequence_form_lp_test.py pass.

I hope this demonstrates my ability to work with the core solver algorithms and ensure mathematical correctness in the codebase. I would appreciate any feedback!

@SH20RAJ
Copy link
Copy Markdown
Contributor Author

SH20RAJ commented Jan 30, 2026

For completeness regarding my GSoC application, I would also like to cross-reference my other contributions to OpenSpiel:

Merged / Internally Imported:

Active / Ready for Review:

This set of PRs covers core algorithms, game logic correctness, infrastructure/serialization, and code quality (typing).

@lanctot lanctot added the waiting Waiting to hear back from contributor (tests failed or thread reply / code update required) label Mar 9, 2026
@SH20RAJ
Copy link
Copy Markdown
Contributor Author

SH20RAJ commented Mar 30, 2026

Hi @lanctot and maintainers, checking in on this subgame-perfection fix for #1304 as part of my GSoC 2026 prep. If there's a preferred narrower scope, extra validation, or anything I should revise to make review easier, I'm happy to update it. Thanks for taking another look when you have time.

@lanctot
Copy link
Copy Markdown
Collaborator

lanctot commented Mar 30, 2026

Hi @SH20RAJ ,

I was waiting for the tests to pass before taking a look. Now that I see this more closely, I think #1489 subsumed it, so we should probably close this.

If you would like to make a contribution to OpenSpiel, I think it'd be best to discuss what it could be before you go off to implement something based on the issues. Feel free to open an issue yourself to discuss, or comment on an open issue to ask the status.

@lanctot lanctot removed the waiting Waiting to hear back from contributor (tests failed or thread reply / code update required) label Mar 30, 2026
@lanctot
Copy link
Copy Markdown
Collaborator

lanctot commented Mar 30, 2026

I've now put up a post for new contributors: #1511

This would have been an example where I would likely have discouraged a PR because the conversation in that issue was a bit confusing. The initial suggestion did not make much sense to me. I think sequential equilibrium made more sense, and it was added in #1489 .

Happy to discuss future contributions, but let's try to talk about what they could be first (by responding to or opening a new issue). Thanks.

@lanctot lanctot closed this Apr 1, 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