Skip to content

Let task owners inject the ManagerBasedRlEnv class and keep pre-advance clip ownership in the tensor sampler - #2606

Open
Cudrix-dev wants to merge 1 commit into
Motphys:mainfrom
Cudrix-dev:feat/manager-env-cls-factory
Open

Cudrix-dev wants to merge 1 commit into
Motphys:mainfrom
Cudrix-dev:feat/manager-env-cls-factory

Conversation

@Cudrix-dev

Copy link
Copy Markdown
Contributor

Summary

Two small contracts that downstream task packages rely on.

  • env_cls factory injection: a task owner can supply its own ManagerBasedRlEnv subclass to the Manager env factory, for example to add task-specific step hooks. It does not need to replace or monkeypatch the factory. The default stays ManagerBasedRlEnv.
  • Tensor clip boundary: the tensor MotionSampler decides clip ownership from the frame before advancing. A lane that reaches its clip end is reported done for that clip, and is not re-attributed to the next clip. The full-width bool return ABI and the stable sampler scratch buffers are unchanged.

Tests

  • tests/envs/test_manager_based_rl_env.py: factory injection and the default path.
  • tests/tasks/test_tensor_motion_sampler.py: clip boundary and lifecycle regressions.
  • 146 passed / 6 skipped on 1.5.10 + this branch.

Origin

Ported from the SONIC downstream fork (commit authored by caozx1110, authorship kept), CPU-validated.

Port the task-owned ManagerBasedRlEnv factory extension and pre-advance clip ownership semantics from the SONIC fork cded6de532ed854d47bab0f65cb012d4730d44cd onto UniLab v1.5.1 (13ba6bb). Preserve the full-width bool return ABI and stable sampler scratch buffers.

Source: sonic_unilab/docs/patches/unilab_151_sonic_tensor_contract.patch; upstream code remains under its existing license. Add CPU boundary/lifecycle regressions. Validation: 158 passed, 6 skipped, 3 Go2-asset-dependent cases deselected; Ruff, mypy and pyright passed. No GPU validation.

Refs unilabsim/sonic_unilab#30

This branch has not been deployed

No deployments
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