Skip to content

refactor!: Roadmap #2434 API 命名规范化收尾 + unisim-core 2.0.0 集成 - #2453

Merged
TATP-233 merged 17 commits into
mainfrom
dev/issue-2434-api-naming
Oct 20, 2026
Merged

TATP-233 merged 17 commits into
mainfrom
dev/issue-2434-api-naming

Conversation

@TATP-233

Copy link
Copy Markdown
Collaborator

Roadmap #2434 收尾:API 命名规范化 + unisim-core 2.0.0 集成

Closes #2434.

交付内容

API 命名审计(8 通道并行只读审计)发现的问题已全部落地,共 7 个子 PR 合入本集成分支:

子 issue 子 PR 内容
#2437 #2446 零风险死代码清理(19 处)
#2438 #2447 误导性命名修正(skip_scene_reset、reset_root_state_uniform_fused、PlaybackConfig)+ 过期文档
#2439 #2448 tensor/torch 后缀规范统一(env_origins、commit_tensor、ManagerRng 等)
#2440 #2451 平行 API 收敛(checkpoint 单入口、render_many 分叉删除、设备选择收敛、dof_armature)
#2441 #2450 私有协议转正(managers/types.py、read_plan、reset_scoped 等)
#2442 #2449 模块名/类名口吃清理(resolution.py、objectives.py、EnvConfigAdapter 等)
#2443 #2452 动词与生命周期钩子统一(reset(mask) 一族、build_*、to_dict())
#2444 42cb92d unisim-core 1.9.0→2.0.0 依赖 bump(双轨同步)+ 调用点适配

本分支在子 PR 之上的增量提交(42cb92d0):

  • pyproject.toml / pyproject.rocm.toml:unisim-core ==1.9.0 → ==2.0.0;uv.lock 与 uv.rocm.lock 同步重新生成
  • 适配 unisim 2.0.0 改名面:PackedResetTransaction、MocapPoseBinding/RootStateLayout/SensorView/PlayRenderPlan、bind_* 冷路径动词(bind_packed_reset/bind_host_bridge_io/bind_height_scanner/bind_renderer)、get_tensor_execution()、torch_device_matches/validate_torch_device、get_default_geom_sizes()、unisim.backend.playback 与 unisim.backend.motrix.camera 模块迁移、去引擎前缀的适配器函数
  • en + zh_CN 文档同步(21 个文件);ADR 历史记录按惯例不改写
  • AGENTS.md 新增 "API naming rules" 一节([Roadmap] API 命名规范化:清理迁移期残留限定词、平行 API 与私有协议泄漏 #2434 决策 D1,共 6 条)

影响面

验证(最终 head 42cb92d 本地执行)

  • make check:ruff + mypy + pyright 全过
  • make test:2678 passed, 60 skipped, 361 deselected (slow)
  • make test-all(check + test-cov + benchmark smoke):exit 0;benchmark 冒烟 module-mode 34/34、script-mode 35/35
  • uv run pytest tests/scripts/test_check_docs.py -q:20 passed

备注

TATP-233 and others added 17 commits October 19, 2026 23:50
refactor!: fix misleading public API names
Implements #2439 on top of dev/issue-2434-api-naming.

This is a naming/API cleanup with no intended behavior change. It renames the Manager RNG module/class and env attribute, unsuffixes tensor-only EntityData tables, unifies reset and RL runtime naming, removes the always-true uses_tensor_actions contract flag, and deletes duplicate motion-tracking properties. Documentation and tests are updated with the renamed public surface.

Validation: make check; make test; make test-all.
Integrate #2438 API naming updates with the #2439 Manager RNG and tensor-table names.
…ix-convention

refactor: unify tensor API naming
Implements #2442 on top of dev/issue-2434-api-naming.

Naming/API cleanup with no intended behavior change:

- rl/algos: build_sac_double_buffer_runner/build_flashsac_double_buffer_runner
  -> build_double_buffer_runner; flash_sac/update.py -> objectives.py;
  validate_flashsac_actor -> validate_custom_actor; EnsembleFlashSACEmbedder/
  EnsembleFlashSACBlock -> EnsembleEmbedder/EnsembleBlock;
  common/learner_boilerplate.py -> learner_base.py with LearnerBaseMixin;
  appo/runtime.py -> resolution.py
- rl/runtime: offpolicy/runtime.py -> resolution.py; logging/common.py ->
  base.py; fold SharedBufferBase into ReplayBuffer (delete shared_buffer.py)
- training: CudaMpsCliError -> CudaMpsError; TensorNanGuard -> NanGuard;
  move build_g1_flashsac_mjwarp_command to scripts/benchmark/torch_env/
  g1_flashsac_soak.py
- tasks: drop Tensor prefix from motion-tracking common runtime pieces
  (TensorResetPlan -> ResetMasks); Go2TensorParity* -> Go2Parity*;
  manager term classes moved to CamelCase per the function=snake_case /
  class=CamelCase convention (Hydra YAMLs updated)
- base: BackendAdapter -> EnvConfigAdapter; apply_env_cpu_runtime ->
  apply_cpu_confinement; demo._mxpython_executable -> _motrix_python_executable
- terrains: hf_pyramid_slope(_inv) presets -> pyramid_slope(_inv);
  utils.py -> heightfield_utils.py

Validation: make check; make test (2677 passed, 60 skipped).
Rename privately-named contract members that are consumed across module
boundaries so the public name is the only spelling, without changing any
protocol semantics, timing, or numerics:

- unilab.managers._types -> unilab.managers.types (git mv; all importers)
- EntityScene._tensor_read_plan -> scene.read_plan; env tensor reset bound
  attributes lose their underscore prefix; Entity._root_body_name ->
  root_body_name (EntityData internals stay private)
- envs/mdp/observations helpers -> quat_apply_inverse, require_read_plan,
  root_body_view, joint_view, world_to_body_vector (added to __all__)
- locomotion common manager_terms _command/_real -> require_command/
  require_real
- base/variants: build_fixed_variant_plan / require_fixed_variant_support
- scripts/play_interactive: build_play_args / compose_interactive_config /
  parse_interactive_cli
- utils/checkpoint: TEST_LOG_ROOT_ENV / normalize_load_run
- rl/runtime/settings: validated_positive_int
- manager hooks __call_reset__ -> reset_scoped, _update_command_reset ->
  update_command_reset
- visualization/playback: drop the unused private re-export alias

Out of scope per issue: remaining EntityScene/EntityData private members,
_SUPPORTED_SIM_BACKENDS, _resolve_backend_entity_contract, and
module-internal privates (#2440/#2442).

Adds tests/architecture/test_private_name_public_promotion.py to guard the
retired names against reintroduction.

Validation:
- make check (ruff format/fix, mypy, pyright): all green
- make test (pytest -m 'not slow'): 2680 passed, 60 skipped
…tocol-promotion

# Conflicts:
#	src/unilab/training/run.py
#	src/unilab/utils/checkpoint.py
…s-stutter

# Conflicts:
#	tests/rl/algos/test_sac_compile.py
Reset lifecycle hooks converge on the reset family: EventManager.apply_reset
becomes dispatch_reset, CommandManager.compute_reset loses its dead dt and
becomes refresh_reset alongside the term-side update_command_reset hook, and
the dead CurriculumManager.compute_reset forwarder is removed (the env calls
compute(reset_mask) directly). ResetOwner reset_transaction/reset_committed
and Recorder record_pre_reset/record_post_reset stay: they name distinct
transaction phases, not the same hook.

Construction verbs in rl/runtime unify on build_* (make_device_timer,
create_error_pipe, make_offpolicy_warmup_batch); host-side memory estimators
gain the host_ infix and the available-memory getters share one word order.
Play entrypoints name algorithms (play_rsl_rl -> play_ppo), the two Motrix
viewer loops converge into visualization.playback.run_native_viewer_play_loop,
and apply_appo_runtime_flags drops its dead cfg parameter. Serialization
verbs unify on to_dict() for the CUDA MPS/process-sharing dataclasses, with
the duplicated GPU-UUID canonicalizers extracted into the public
canonicalize_gpu_uuid (display form stays GPU-<id>; the comparison token is
case/dash-insensitive). Rename leftovers land: [dp_launcher] -> [launcher],
reject_removed_inference_request_timeout -> validate_no_inference_request_timeout,
off_policy_collector_fn -> offpolicy_collector_fn. rl/algos gain verbs:
compute_vtrace_advantages, sample_biased_replay_indices,
build_builtin/custom_actor_semantics, SACCritic.expected_value. Small items:
update_mask -> update_masked, support_sim_backend -> supports_sim_backend,
OnPlaybackFrameFn -> PlaybackFrameCallback, the CommandType error message now
says CommandTerm, and recorder docstrings reference reset_mask.

Validation: make check (ruff/mypy/pyright clean), make test (2678 passed,
60 skipped), docs check (20 passed), benchmark smoke (34/34 + 35/35).
test_train_scripts.py slow lane shows the same 5 pre-existing local
environment failures as the baseline.
…cle-consistency

refactor!: unify verbs and lifecycle hook naming (#2443)
…#2444)

- unisim-core 1.9.0 -> 2.0.0 in pyproject.toml and pyproject.rocm.toml;
  regenerate uv.lock and uv.rocm.lock (dual-track).
- Adapt UniLab call sites to the unisim 2.0.0 naming: PackedResetTransaction,
  MocapPoseBinding/RootStateLayout/SensorView/PlayRenderPlan, bind_* cold-path
  verbs (bind_packed_reset/bind_host_bridge_io/bind_height_scanner/bind_renderer),
  get_tensor_execution(), torch_device_matches/validate_torch_device,
  get_default_geom_sizes(), unisim.backend.playback and motrix.camera modules,
  prefix-free adapter helpers.
- Update en/zh_CN docs and tests to the new names; no aliases kept.
- Record the #2434 API naming rules in AGENTS.md (decision D1).
@TATP-233
TATP-233 requested a review from caozx1110 as a code owner October 20, 2026 02:47
@TATP-233
TATP-233 merged commit 5ed0ab6 into main Oct 20, 2026
12 checks passed
@TATP-233
TATP-233 deleted the dev/issue-2434-api-naming branch October 20, 2026 03:28
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.

[Roadmap] API 命名规范化:清理迁移期残留限定词、平行 API 与私有协议泄漏

1 participant