Skip to content

[Bug Report] DirectMARLEnv state_space=0 is exposed as Box(0) instead of None #7792

Closed

Description

@peachtree0222

Describe the bug

DirectMARLEnvCfg.state_space = 0 is documented to disable centralized state and make env.state_space equal to None. Instead, DirectMARLEnv._configure_env_spaces() assigns None and then immediately overwrites it with gym.spaces.Box(shape=(0,)) because the negative-state check is a second if with an else, rather than an elif.

This makes the public interface inconsistent: env.state() returns None for the zero configuration, but env.state_space advertises a non-None empty Box. Wrappers or RL libraries that use the space to detect centralized state can configure a zero-width critic input even though no state value is produced.

Steps to reproduce

  1. Check out a8b4da3c29ae528b39d4b3c9444d782ce58d886d.
  2. Run poc/repro.py with the IsaacLab source packages on PYTHONPATH.
  3. Observe the mismatch:
cfg.state_space: 0
env.state_space: Box([], [], (0,), float32)
env.state(): None

Expected behavior: env.state_space is None, matching the configuration documentation and env.state().

Reproduction files:

direct-marl-zero-state-space-poc.zip

System Info

  • Commit: a8b4da3c29ae528b39d4b3c9444d782ce58d886d (develop); same control flow at b0542fe2d45bf91c4e1d9ef6952b9c709c80b4e8 (main)
  • Isaac Sim Version: not required by the kitless unit reproduction; current project dependency is 6.1.0
  • OS: Ubuntu 24.04.5 LTS
  • GPU: NVIDIA GeForce RTX 5060 Ti (not used)
  • CUDA / driver: driver 595.84; CPU unit test

Additional context

The contradictory branches are in _configure_env_spaces. The zero contract is documented in DirectMARLEnvCfg.state_space and implemented by DirectMARLEnv.state().

The proposed fix changes the negative-state branch to elif and adds a kitless regression using the existing stub. Discussion #1264 recommends state_space=0, but does not identify this multi-agent control-flow bug.

Checklist

  • I have checked that there is no similar issue in the repo (bounded issue and PR search repeated on 2026-09-12; repeat immediately before filing)
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Acceptance Criteria

  • DirectMARLEnvCfg.state_space = 0 produces env.state_space is None.
  • Negative configuration still constructs the flattened joint-observation state space.
  • Positive and explicit Gymnasium state spaces retain their existing behavior.
  • env.state_space and env.state() agree on whether centralized state exists.

Activity

  1. AntoineRichard commented on Sep 15, 2026

    @AntoineRichard
    Collaborator

    Hi @peachtree0222! Thanks for opening this issue an the associated PR! We're looking into it.

  2. added a commit that references this issue on Sep 20, 2026
    9738e09
  3. StafaH commented on Sep 20, 2026

    @StafaH
    Collaborator

    Resolved by #7810.

  4. added a commit that references this issue on Sep 20, 2026
    618b76c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions