Skip to content

Number reduced strategies sequentially instead of by action signature#1002

Open
d-kad wants to merge 5 commits into
gambitproject:masterfrom
d-kad:strategy-label-rework
Open

Number reduced strategies sequentially instead of by action signature#1002
d-kad wants to merge 5 commits into
gambitproject:masterfrom
d-kad:strategy-label-rework

Conversation

@d-kad

@d-kad d-kad commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description of the changes in this PR

Reduced strategies of extensive games were labelled by concatenating the chosen action's number
at each information set ("*" where unspecified). These labels were not injective — once an information set
had ten or more actions, (1, 11) and (11, 1) both rendered "111" — which broke NFG round-tripping
and made label lookup ambiguous.

This PR labels reduced strategies by their sequence number in generation order ("1", "2", ...),
matching table games. The order is deterministic.

A separate commit fixes unrelated m_behav map pollution found alongside this.

@d-kad d-kad added c++ Items which involve writing in C++ bug labels Jul 22, 2026
@d-kad d-kad added this to the gambit-17.0.0 milestone Jul 22, 2026
@tturocy

tturocy commented Jul 22, 2026

Copy link
Copy Markdown
Member

I've cherry-picked out the sparsity violation and made a separate PR, as consistent use of .at instead of [] is important and we want to fix that irrespective of the disposition of this PR.

I suggest that many of the tests we had with strategy labels were actually testing that we are generating the correct sets of reduced strategies - as we were saying, the crux of the problem is that the strategy label was doing double duty as sometimes communicating details about the reduced strategy mapping of infosets to actions.

So I propose these tests shouldn't just have the strategy labels changed because this is effectively losing coverage. Just as a for-example, test_reduced_strategic_form loses a lot by just changing the strategy labels to be sequential integers, we aren't actually testing the strategy maps at all.

So at least some of these tests should probably be rewritten to exercise strategy.action as appropriate to construct the map and check it's what's expected.

@tturocy

tturocy commented Jul 22, 2026

Copy link
Copy Markdown
Member

I have added a commit which proposes some crude UX for the GUI - left-clicking a strategy label in the reduced strategic game pops up a transient window showing the map. It's really basic, but at least we don't lose information for now.

This will tie into the bigger discussion we are having about UX for strategic games (and the GUI in general).

@rahulsavani Noting for you as we should think about what features we might want to explore/display the reduced strategy space, or richer visualisation of the Kuhn's theorem mapping from strategies to behaviours...

@d-kad
d-kad requested a review from tturocy July 23, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug c++ Items which involve writing in C++

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants