Skip to content

Add native MarlGrid environments with prestige coloring - #419

Merged
Trinkle23897 merged 14 commits into
sail-sg:mainfrom
tortoise10101:feature/marlgrid-env
May 26, 2026
Merged

Add native MarlGrid environments with prestige coloring#419
Trinkle23897 merged 14 commits into
sail-sg:mainfrom
tortoise10101:feature/marlgrid-env

Conversation

@tortoise10101

@tortoise10101 tortoise10101 commented May 25, 2026

Copy link
Copy Markdown
Contributor

Description

Add native C++ EnvPool support for MarlGrid, pinned to the official kandouss/marlgrid implementation at commit e88c40bad07653575ac11fe2f3a115e4de3d13e9.

MarlGrid's GoalCycle environments are the environments used in Ndousse and coauthors' 2021 paper, Emergent Social Learning via Multi-agent Reinforcement Learning. The official reference repository is kandouss/marlgrid.

This PR also adds the optional prestige_coloring cue for GoalCycle-style rendering. It defaults to False for backward compatibility. When enabled, positive rewards move each agent's color from red toward blue, negative rewards reset prestige to red, and prestige decays after each active agent step.

Motivation and Context

This brings MarlGrid into EnvPool with native runtime stepping, registration, rendering, documentation, deterministic tests, and oracle alignment against the pinned upstream implementation. The prestige cue reproduces the reward-history color signal used by the official MarlGrid implementation while keeping existing fixed-color behavior as the default.

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • New environment (non-breaking change which adds 3rd-party environment)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)
  • Example (update in the folder of example)

Implemented Tasks

  • Add pinned kandouss/marlgrid upstream archive wiring under third_party/marlgrid.
  • Add native MarlGrid EnvPool runtime, registration, and Python bindings.
  • Register supported MarlGrid and GoalCycle task IDs.
  • Add optional prestige_coloring, prestige_beta, and prestige_scale config keys.
  • Add deterministic, registry, oracle alignment, render, and prestige-coloring tests.
  • Add MarlGrid documentation and README support-list entry.

Checklist

  • I have read the CONTRIBUTION guide (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.
  • I have reformatted the code using make format (required)
  • I have checked the code using make lint (required)
  • I have ensured make bazel-test pass. (required)

Local validation

  • make lint BAZELOPT="--action_env=PATH=$PATH"
  • make bazel-test BAZEL_TEST_TARGETS=//envpool/marlgrid:marlgrid_test
  • make docstyle
  • make spelling
  • git diff --check

@tortoise10101
tortoise10101 force-pushed the feature/marlgrid-env branch from 41cdc3f to 4ac2c4d Compare May 25, 2026 07:33
@Trinkle23897
Trinkle23897 merged commit 8849255 into sail-sg:main May 26, 2026
12 checks passed
Trinkle23897 added a commit that referenced this pull request Jul 17, 2026
## Summary
- add semantic `matrix` and `full_matrix` observation formats for
MarlGrid
- keep existing pixel observations as the default via
`observation_format="pixels"`
- add direct MarlGrid tests for partial and full matrix observation
shapes and channels
- replace the `.dockerignore` symlink with explicit Docker ignore rules
- fix property docstrings that fail the current ruff lint rule

## Tests
- make bazel-test BAZEL_TEST_TARGETS=//envpool/marlgrid:marlgrid_test
- uvx ruff check envpool/python/envpool.py envpool/python/protocol.py
scripts/coverage_summary.py
- uvx ruff format --check envpool/python/envpool.py
envpool/python/protocol.py scripts/coverage_summary.py
envpool/marlgrid/marlgrid_test.py
- uvx clang-format --style=file -i envpool/marlgrid/marlgrid.h -n
--Werror
- git diff --check origin/main..HEAD

Note: the branch was rebuilt on top of current `origin/main` after
native MarlGrid prestige coloring landed upstream in #419.

---------

Co-authored-by: Jiayi Weng <jiayi@openai.com>
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