Skip to content

feat: complete per-env fixed model variant roadmap - #1568

Merged
TATP-233 merged 15 commits into
mainfrom
dev/issue-1563-per-env-model-contract
Sep 13, 2026
Merged

TATP-233 merged 15 commits into
mainfrom
dev/issue-1563-per-env-model-contract

Conversation

@TATP-233

@TATP-233 TATP-233 commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add the task-owned fixed model variant catalog and cold-path Manager-Based lifecycle guard (ADR-0010). The ablated owner API keeps only the variant/catalog config types; Manager factory directly builds UniSim's one final plan.
  • Consume UniSim per-world reset defaults in ResetStateTransaction and remove the legacy DomainRandomizationManager/provider protocol; Manager-Based events are now the sole DR lifecycle in this line.
  • Add a deterministic representative SimToolReal mesh-variant workload for CPU and MJWarp, including immutable assignment, reset-time mass/inertia DR, per-env playback, cross-backend comparison, and benchmark evidence.
  • Ablate the representative integration: expose only materialized model files, reuse the production RSL-RL adapter and shared memory profiler, and avoid duplicating backend conformance assertions.
  • Consume the published unisim-core 1.3.0 and mjbatch-uni 0.2.0 registry releases across default and ROCm lock profiles.
  • Physically remove the remaining unilab.dr compatibility namespace and provider API docs; Manager-Based construction/reset/interval paths are the sole DR lifecycle, and unsupported capabilities fail closed.

Roadmap: #1563
Representative rollout: #1566
Contract child issues: #1564, #1565, #1567

Validation

  • uv sync --locked --extra mujoco --extra mjwarp --extra motrix
  • uv run --no-sync pytest -q — 1592 passed, 26 skipped
  • make test-all — formatting, mypy, pyright, test checks, 1592 tests with coverage, and benchmark smoke passed
  • Representative 64-env / 64-variant benchmark:
    • MuJoCo: median construction 0.181 s over three runs, construction RSS delta about 48.7 MB, all finite
    • MJWarp on RTX 4090: construction 0.970 s, construction RSS delta 420.6 MB, 68,815 env-steps/s, all finite

Integration notes

This PR keeps the package version at 1.2.0 and consumes published registry releases:

  • unisim-core>=1.3.0
  • mjbatch-uni~=0.2.0

Both default and ROCm locks are generated from PyPI artifacts; no integration-only direct dependency remains.

This PR targets main only, intentionally keeps unilab at version 1.2.0, and does not create a tag, GitHub release, or PyPI publication.

@TATP-233

Copy link
Copy Markdown
Collaborator Author

Final-head update at 525853735d09144c5e7fb3f1adb8bccf6290dd5b:\n\n- Added the missing end-to-end training-rollout gate: a slow representative 12-env PPO run completes one learning iteration over fixed tool variants and confirms optimizer updates plus finite actor/critic parameters.\n- Current-head CI passed: ruff format/lint, mypy, pyright, benchmark smoke, docs, and Ubuntu coverage test job. Run: https://github.com/Motphys/UniLab/actions/runs/34752848784\n- Targeted local gates also passed for the three representative runtime tests and the slow PPO test.

@TATP-233

Copy link
Copy Markdown
Collaborator Author

A/B owner/test ablation is complete at a21d6953d551198f116b205d8fa76da54a57e4bd (net -296 lines from the prior head).\n\nUniLab API simplification:\n- fixed-variant task config now exports only FixedModelVariantCfg and FixedModelVariantCatalogCfg;\n- removed FixedModelVariantAssignmentCfg, FixedModelVariantMaterialization, and the public materialization/prepare/validation helpers;\n- empty explicit_variant_names means deterministic round-robin; a non-empty list is the exact expanded assignment;\n- Manager factory directly builds UniSim's plan, so FixedVariantPlan.assignment is the sole final assignment representation;\n- capability negotiation now checks the complete plan (support + layout), not just a single boolean.\n\nRepresentative workload/test simplification:\n- SimToolReal source set exposes only materialized model_files; synthetic variant metadata is private;\n- PPO smoke reuses the production-owned uni_rl RSL-RL adapter instead of adding another test wrapper;\n- benchmark RSS/peak reporting reuses the shared memory profiling helper;\n- representative tests no longer duplicate UniSim immutability/capability conformance assertions;\n- reset-default/entity readonly bindings avoid copying already immutable arrays repeatedly.\n\nValidation:\n- uv run --no-sync pytest -q: 1593 passed, 26 skipped;\n- targeted slow PPO test: 1 passed;\n- make test-all: formatting, mypy, pyright, full coverage suite, and benchmark smoke passed;\n- current PR CI: ruff format/lint, mypy, pyright, benchmark smoke, Ubuntu coverage tests, and Sphinx all passed.\n\nPost-ablation 64-env/64-variant spot benchmark remained finite and functionally complete. CPU median construction over three runs was ~0.181 s with ~48.7 MB construction RSS delta; MJWarp construction was 0.970 s with ~420.6 MB delta. The small timing cost buys shared-field fail-closed validation and MJWarp derived-constant correctness; memory did not regress.

@TATP-233

Copy link
Copy Markdown
Collaborator Author

Closing cleanup at 6d1fef60271700527b15b6947f6d612735563961: unilab.dr is now physically absent and import fails with ModuleNotFoundError; its API-reference page/card and active provider-language docs are removed. Manager-Based construction/reset/interval paths are the sole DR lifecycle, and the UniSim dependency removes the old init-time model-variant adapter path. Unsupported capabilities continue to fail closed with backend/term-specific errors. Final local gate: 1592 passed / 26 skipped and make test-all passed; current CI and Docs checks are green.

@TATP-233

Copy link
Copy Markdown
Collaborator Author

Final dependency-only head is 1e772530a3969a92765dc06f2759c1ac94a5ae5d, pinning UniSim a020f8b after its stale DR-manager doc cleanup. Current CI and Docs checks passed again; no main changes.

@TATP-233

Copy link
Copy Markdown
Collaborator Author

mjbatch-uni 0.2.0 is now published. Head 7564d029389f7fcaff4120018f53b958caea7080 consumes mjbatch-uni~=0.2.0, bumps UniLab to 1.3.0, records the release changelog, and temporarily pins release-candidate UniSim 2060563. Full local suite and make test-all passed; current CI and Docs checks passed.

@TATP-233

Copy link
Copy Markdown
Collaborator Author

UniSim 1.3.0 is now published. Head eb3e664d58fd9424781775e64f171079f434cdc3 removes the final UniSim git pin and consumes unisim-core>=1.3.0; both default and ROCm locks resolve from PyPI. Full local suite and make test-all passed against the published artifacts.

@TATP-233

Copy link
Copy Markdown
Collaborator Author

Version bump withdrawn at `c414cbf8d5ce9f3877af76712985a4bdea692c0b`: `pyproject.toml`, `pyproject.rocm.toml`, both locks, and the changelog heading restore/keep UniLab at 1.2.0 / Unreleased. Dependencies remain `unisim-core>=1.3.0` and `mjbatch-uni~=0.2.0` from PyPI. This PR targets main only; no UniLab tag, release, or publication is performed.

@TATP-233
TATP-233 merged commit b4e6b58 into main Sep 13, 2026
8 checks passed
@TATP-233
TATP-233 deleted the dev/issue-1563-per-env-model-contract branch September 13, 2026 15:56
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