Registry Bootstrap¶
Registry bootstrap is an explicit import contract for environments. It is
defined by ADR-0004 Registry Bootstrap Contract and implemented in
src/unilab/base/registry.py.
Runtime Flow¶
Training entrypoints call
unilab.training.common.ensure_registries().That helper delegates to
unilab.base.registry.ensure_registries().The registry imports declared bootstrap packages:
unilab.envs.locomotion,unilab.envs.manipulation, andunilab.envs.motion_tracking.Each package exposes
__unilab_registry_modules__, a tuple of modules that contain registration side effects.Imported modules register configs with
@registry.envcfg(...)and env implementations with@registry.env(..., sim_backend=...)orregistry.register_env(...).Runtime construction goes through
registry.make(...), which applies env config overrides, validates the env config, selects the requested backend, and instantiates the registered env class.
Extension Rules¶
Add new env modules to the package-level
__unilab_registry_modules__tuple if they live in a new module that is not imported by an existing bootstrap entry.Keep registration cheap. Scene materialization, XML processing, asset access, and backend construction belong after
registry.make(...), not in decorator registration.Duplicate env configs and duplicate
(env, sim_backend)registrations raiseValueErrorinsrc/unilab/base/registry.py; preserve that failure boundary.
Evidence In Repo¶
Bootstrap helper:
src/unilab/base/registry.pyTraining helper:
src/unilab/training/common.pyPackage declarations:
src/unilab/envs/locomotion/__init__.py,src/unilab/envs/manipulation/__init__.py,src/unilab/envs/motion_tracking/__init__.pyTests:
tests/base/test_registry.py,tests/utils/test_algo_utils.py