Skip to content

C++ api and internal cleanups - #1052

Open
tturocy wants to merge 5 commits into
masterfrom
dev_precedes
Open

C++ api and internal cleanups#1052
tturocy wants to merge 5 commits into
masterfrom
dev_precedes

Conversation

@tturocy

@tturocy tturocy commented Aug 17, 2026

Copy link
Copy Markdown
Member

This is an omnibus of several commits focused on refactorings ultimately targeted at being able to remove direct reference to internal game objects (mediated via shared pointers)

The predicate of whether an action or infoset precedes a node
can be written as a composition of whether a node precedes another node.
As we are preferring to have a slimmer API surface, we are removing these superfluous predicates.
…he infoset

GameInfosetRep has persistent identity but mutable content: its members,
actions, and player can all be replaced without the object's identity
changing, so a caller holding a GameInfoset across other operations can
end up with a stale-but-valid reference to something that no longer means
what it did when fetched.

Add GameNodeRep::GetInfosetLabel/IsChanceInfoset/GetActionProb/SameInfoset
so callers needing one of these node-invariant properties don't need to
materialize the infoset at all. Rework the three GUI handlers that held
an infoset across multiple mutating calls (DoInsertAction, OnEditReveal,
OnEditMove/EditMoveDialog) to instead anchor on the node they already have
and re-derive the infoset fresh at each point of use.
MixedStrategyProfile, MixedBehaviorProfile, LogBehavProfile, and
BehaviorSupportProfile cached their per-node/per-infoset/per-action/
per-player data in std::map<GameAction/GameInfoset/GameNode, T>. This is
quite inefficient for what's fundamentally dense, small-integer-keyed
data.

Replace these with Array<T>, indexed directly by the relevant object's
existing dense number.
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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