Skip to content

feat(cli): eval 在缺少目标后端 owner YAML 时回退到兄弟 owner - #1469

Merged
TATP-233 merged 2 commits into
dev/issue-1042-manager-based-apifrom
feat/eval-sim-owner-fallback
Sep 3, 2026
Merged

feat(cli): eval 在缺少目标后端 owner YAML 时回退到兄弟 owner#1469
TATP-233 merged 2 commits into
dev/issue-1042-manager-based-apifrom
feat/eval-sim-owner-fallback

Conversation

@TATP-233

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

Copy link
Copy Markdown
Collaborator

动机

uv run eval 此前要求任务必须存在所请求后端的 owner YAML(conf/<algo>/task/<task>/<sim>.yaml),缺失即拒绝。eval 只是回放训练好的 checkpoint,并不需要该后端专属的 owner 配置;train 才必须要求 owner YAML 存在。

改动

  • src/unilab/cli.pybuild_command 在 eval 模式下,当目标后端 owner YAML 缺失时,按 SUPPORTED_SIMS 顺序回退到同任务、同 profile 形态的兄弟后端 owner(新增 _eval_fallback_owner),并追加 sim2sim ALLOWLIST 中的 training.sim_backend=<sim> override 重新指定目标后端;回退发生时向 stderr 打印提示。train 的拒绝行为不变。
    • profile 场景只回退到同 profile 的兄弟 owner(如 mujoco_hora),避免静默加载架构不匹配的 checkpoint;没有任何同形态兄弟 owner 时仍然报错。
    • MuJoCo interactive viewer 路径(play_interactive.py)同样支持回退:--sim 传入回退 owner 名并带 training.sim_backend=mujoco override。
    • 安全性不变:运行时各 play 入口的 resolve_sim2sim_config 预检仍对照源 run 的 contract_snapshot 校验 DENYLIST 字段,policy_load_dim_guard 维度守卫仍然生效。
  • tests/test_cli.py:新增 6 个测试(eval 回退路由、train 仍拒绝、无兄弟 owner 时 eval 拒绝、profile 同形态优先、无同 profile 兄弟时拒绝、interactive viewer 回退)。
  • 文档:en / zh_CN3-deployment/2-sim_to_sim/7-config_guard.md 生效链路一节补充 eval 回退行为。

Validation

  • 最终 head dd3bbfac(含与 base 的 merge commit,冲突已解决) 本地 make test-all 通过(check + test-cov + test-benchmark-smoke,exit 0;benchmark smoke 35/36 与 36/37,仅平台可选的 mlx 项跳过)。
  • uv run pytest tests/test_cli.py tests/test_cli_runtime_requirements.py tests/test_completion.py tests/scripts/test_check_docs.py -q — 82 passed。
  • 真实配置树端到端验证:eval --algo ppo --task microduck_sitstand_flat --sim mujoco(该任务只有 mjwarp.yaml)现在路由为 task=microduck_sitstand_flat/mjwarp training.sim_backend=mujoco training.play_only=true;相同参数 train 仍被拒绝。

… owner YAML

Eval replays a trained checkpoint, so a missing owner YAML for the
requested backend no longer aborts the route: the CLI reuses a sibling
backend owner of the same task (same profile shape) and re-applies the
requested backend via the sim2sim-allowlisted training.sim_backend
override. The runtime sim2sim preflight still validates the composed
config against the source run contract. Train keeps requiring the owner
YAML to exist.
@TATP-233
TATP-233 merged commit d9859c6 into dev/issue-1042-manager-based-api Sep 3, 2026
@TATP-233
TATP-233 deleted the feat/eval-sim-owner-fallback branch September 3, 2026 14:23
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