Skip to content

fix: compare jaxmarl space bounds and cardinalities - #1221

Open
quinnarnold wants to merge 1 commit into
instadeepai:developfrom
quinnarnold:fix/jaxmarl-space-equality
Open

quinnarnold wants to merge 1 commit into
instadeepai:developfrom
quinnarnold:fix/jaxmarl-space-equality

Conversation

@quinnarnold

@quinnarnold quinnarnold commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

What?

Fixes #961. Compare the observation and action spaces of JaxMARL agents beyond their shapes.

Why?

Equal-shaped spaces can have different discrete action counts, bounds, or dtypes. The shape-only check accepts these as homogeneous.

How?

Compare shape and dtype, then discrete cardinality or Box bounds, using the existing Gymnax/JaxMARL type helpers. Reduce array-valued bound comparisons to a boolean.

Extra

Local validation passed 40 observation/action comparisons and a real SimpleSpread JIT reset/step. The original implementation fails the unequal-cardinality check. These checks were run separately; no repository test files were changed.

Applicable pre-commit hooks pass except mypy, which reports the same pre-existing HiddenStates type error at mava/systems/gpo/anakin/rec_magpo.py:664 on a clean archive of the upstream base.

AI assistance.

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.

[MAINTAIN] Better equality check for jaxmarl specs

1 participant