Repository navigation
refactor(env): make unilab a self-contained env package - #2548
Merged
Merged
Conversation
Relocate the env-injection contract out of the algorithm namespace and make the training stack an optional install, so `pip install unilab` is a lightweight env-only package. Drives #2542. - Move `unilab.rl.contracts` -> `unilab.base.contracts` (single owner) and delete the old namespace; update all importers. - Cut env-layer reverse imports of `unilab.rl` (`base/env_factory.py`, `envs/manager_based_rl_env.py`). - Make `unilab.base` lazy so `unilab.base.contracts` imports without pulling in `unisim`. - Move `tensordict`/`rsl-rl-lib`/`wandb`/`tensorboard` into the single `unirl` optional extra; `import unilab` no longer triggers them. - Mark `cli.package_root` and `scripts.train_offpolicy.build_runner` as internal (not a public contract). Validation (final head): - `uv run pytest -m "not slow"` -> 2869 passed, 34 skipped, 1 xfailed, 1 failed (pre-existing motrix backend conformance failure, unrelated) - `uv run ruff check` and `uv run ruff format --check` clean - `uv lock --check` clean Co-Authored-By: Claude Code <noreply@anthropic.com>
The training deps (tensordict/rsl-rl-lib/wandb/tensorboard) moved into the `unirl` optional extra, so CI jobs that exercise the RL/training stack (test-applications, test-rl, mypy, pyright, tensor-runtime) must install it or fail to import rsl_rl/tensorboard/onnx. Add `--extra unirl` to those sync commands and to the Makefile dev sync targets. Co-Authored-By: Claude Code <noreply@anthropic.com>
TATP-233
force-pushed
the
refactor/issue-2542-env-self-contained
branch
from
October 28, 2026 13:51
8322584 to
fcb7aa9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes
unilaba self-contained, lightweight env package — the "no-split" work from #2542 that must happen regardless of the eventualunilab-rlsplit (#2537).unilab.rl.contracts→unilab.base.contracts(single owner). The old namespace is deleted and all importers updated, so env users no longer import the contract from the algorithm namespace.base/env_factory.pyandenvs/manager_based_rl_env.pyno longer importunilab.rl.*.unilab.baseis now lazy sounilab.base.contractsimports without pulling inunisim.unirltraining extra:tensordict/rsl-rl-lib/wandb/tensorboardmoved out of core deps into[project.optional-dependencies] unirl(one extra — nottrain, not per-algorithm).import unilabno longer triggers them.pyproject.rocm.tomland both lockfiles are kept in sync.cli.package_rootandscripts.train_offpolicy.build_runnerdocumented as internal (not a public contract).Not in this PR
Item 5 of #2542 (the
unilab.trainingseam split — separating offpolicy-specificdp_config/tensor_runtimefrom the algorithm-agnostic trainer API) is deferred: it needs a decision on the stable public-API boundary and will follow in a separate PR/ADR.Validation (final head
2a7695bc)uv run pytest -m "not slow"→ 2869 passed, 34 skipped, 1 xfailed, 1 failedtests/base/test_backend_conformance.py::test_fused_tensor_root_reset_reads_back_world_angular_velocity[motrix](motrix physics numerics).uv run ruff checkanduv run ruff format --check→ cleanuv lock --check→ cleanNote:
uv.rocm.lockregenerated frompyproject.rocm.toml, which also folds in pre-existing drift (the old lock still carriedmjwarp/newton/superdexpackages the ROCm toml no longer declares), making the lock consistent with the toml.Part of #2542.
🤖 Generated with Claude Code