Skip to content

refactor: replace flat obs array with structured dict[str, np.ndarray] - #45

Merged
TATP-233 merged 1 commit into
mainfrom
feat/structured-obs-dict
Mar 17, 2026
Merged

TATP-233 merged 1 commit into
mainfrom
feat/structured-obs-dict

Conversation

@TATP-233

Copy link
Copy Markdown
Collaborator

Environments now emit dict obs (e.g. {"actor": ..., "privileged": ...}) instead of concatenating then slicing flat arrays. This eliminates fragile index alignment across env, config, and wrapper layers.

  • NpEnvState.obs: np.ndarray → dict[str, np.ndarray]
  • Add obs_groups_spec abstract property to ABEnv/NpEnv
  • NpEnv.observation_space computed from obs_groups_spec
  • Add flatten_obs_dict utility for downstream consumers
  • Delete ObsConfig and actor_indices from all envs
  • Update RSL-RL, APPO, off-policy, FastSAC, MLX wrappers
  • Update config obs_groups keys to "actor"/"critic"
  • Add comprehensive tests (61 new) and testing principle to CLAUDE.md

Environments now emit dict obs (e.g. {"actor": ..., "privileged": ...})
instead of concatenating then slicing flat arrays. This eliminates fragile
index alignment across env, config, and wrapper layers.

- NpEnvState.obs: np.ndarray → dict[str, np.ndarray]
- Add obs_groups_spec abstract property to ABEnv/NpEnv
- NpEnv.observation_space computed from obs_groups_spec
- Add flatten_obs_dict utility for downstream consumers
- Delete ObsConfig and actor_indices from all envs
- Update RSL-RL, APPO, off-policy, FastSAC, MLX wrappers
- Update config obs_groups keys to "actor"/"critic"
- Add comprehensive tests (61 new) and testing principle to CLAUDE.md
@TATP-233
TATP-233 merged commit 3e9ae36 into main Mar 17, 2026
0 of 10 checks passed
@TATP-233
TATP-233 deleted the feat/structured-obs-dict branch March 17, 2026 16:04
TATP-233 added a commit that referenced this pull request Mar 17, 2026
…tion

Resolve conflicts between:
- feat/reward-config-injection: Hydra config system, reward config injection
- main (PR #45): obs dict refactor (NpEnvState.obs: ndarray → dict[str, ndarray])

Conflict resolutions:
- Use cfg.training.* refs (Hydra) from our branch; obs_groups_spec + flatten_obs_dict from main
- Keep KNOWN_TASKS-only locomotion/manipulation_params (our Hydra migration)
- Keep Hydra tests; drop tests for deleted config factory functions
- fast_sac/runner: pass env_cfg_override (ours) + obs_groups_spec (main)
- play_interactive: keep PPOConfig import (ours) + flatten_obs_dict (main)
- train_rsl_rl: keep play_rsl_rl(cfg, device) Hydra signature (ours)
TATP-233 added a commit that referenced this pull request May 4, 2026
refactor: replace flat obs array with structured dict[str, np.ndarray]
TATP-233 added a commit that referenced this pull request May 4, 2026
…tion

Resolve conflicts between:
- feat/reward-config-injection: Hydra config system, reward config injection
- main (PR #45): obs dict refactor (NpEnvState.obs: ndarray → dict[str, ndarray])

Conflict resolutions:
- Use cfg.training.* refs (Hydra) from our branch; obs_groups_spec + flatten_obs_dict from main
- Keep KNOWN_TASKS-only locomotion/manipulation_params (our Hydra migration)
- Keep Hydra tests; drop tests for deleted config factory functions
- fast_sac/runner: pass env_cfg_override (ours) + obs_groups_spec (main)
- play_interactive: keep PPOConfig import (ours) + flatten_obs_dict (main)
- train_rsl_rl: keep play_rsl_rl(cfg, device) Hydra signature (ours)
TATP-233 added a commit that referenced this pull request Sep 4, 2026
refactor: replace flat obs array with structured dict[str, np.ndarray]
TATP-233 added a commit that referenced this pull request Sep 4, 2026
…tion

Resolve conflicts between:
- feat/reward-config-injection: Hydra config system, reward config injection
- main (PR #45): obs dict refactor (NpEnvState.obs: ndarray → dict[str, ndarray])

Conflict resolutions:
- Use cfg.training.* refs (Hydra) from our branch; obs_groups_spec + flatten_obs_dict from main
- Keep KNOWN_TASKS-only locomotion/manipulation_params (our Hydra migration)
- Keep Hydra tests; drop tests for deleted config factory functions
- fast_sac/runner: pass env_cfg_override (ours) + obs_groups_spec (main)
- play_interactive: keep PPOConfig import (ours) + flatten_obs_dict (main)
- train_rsl_rl: keep play_rsl_rl(cfg, device) Hydra signature (ours)
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