Skip to content

Refactor triple triad header and game logic#502

Open
TuriGitGit wants to merge 3 commits intoPufferAI:3.0from
TuriGitGit:patch-2
Open

Refactor triple triad header and game logic#502
TuriGitGit wants to merge 3 commits intoPufferAI:3.0from
TuriGitGit:patch-2

Conversation

@TuriGitGit
Copy link

@TuriGitGit TuriGitGit commented Mar 23, 2026

Major changes

  • Correctly mask placed cards
  • Added masking for selected cards
  • Simplified and optimised compute obs
  • Simplified and optimised reset functions
  • Got rid of the double and triple pointers
  • Removed janky bot and agent logic
  • Correctly allocate memory (allocates 99.86% less memory)

Minor changes:

  • Defined magic numbers
  • Simplified structs
  • Removed 4 unused vars
  • Corrected visual score
  • Corrected obs size being off by one
  • Standardised the formatting of the code and neatened it up

Results

Increased env speed by 5-15% depending on hardware
Models correctly learn not to select invalid actions now

Refactor triple triad game logic for improved clarity and performance. Consolidate memory management and enhance function definitions.
Removed num_cards variable from the tripletriad structure.
Removed the num_cards field from the game environment initialization.
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