{{ message }}
Repository navigation
[2474-P2] 清理 env/command 静默缝:删孤儿 hook、metric fail-closed、注释改写 - #2493
Merged
Merged
Conversation
The _suppress_hot_state_refresh getattr hook and its _enter/_exit_suppressed_hot_state_refresh pair were introduced in fc45ec2 for _DeviceResidentColdContractProxy in the motion-tracking torch_flashsac_env; that sole consumer was removed in 736025b, leaving a silent getattr(..., False) hook with no in-repo implementation. Delete it outright instead of promoting an unused extension point. Refs #2474, #2492
UniformVelocityCommand._metric_velocities silently returned zero tensors when the scene's packed tensor read plan was not compiled yet, which would mask an ordering bug since metrics are only consumed by per-step command compute after plan compilation. Raise an explicit RuntimeError naming the required lifecycle order, and pin it with a test. Refs #2474, #2492
5 tasks done
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.

Closes #2492。父审计 issue:#2474(P2 行)。
改动
src/unilab/base/env_factory.py:Genesis spawn 设备绑定注释改写为"必需冷路径",移除 "compatibility shim" 字样,保持 shim 关键词扫描可信(纯注释,零行为变化)。src/unilab/envs/manager_based_rl_env.py:删除孤儿 hook_suppress_hot_state_refresh(_enter/_exit_suppressed_hot_state_refresh+getattr(..., False)分支,-17 行)。历史查证:由 fc45ec2 引入,唯一消费方torch_flashsac_env.py已随 736025b 整文件删除,全库无残留引用。src/unilab/envs/mdp/commands/velocity_command.py:_metric_velocities在read_plan is None时由静默返回零张量改为抛RuntimeError(指明正确生命周期顺序),新增测试test_metrics_fail_closed_before_read_plan_compilation钉住。验证(隔离 worktree @ origin/main 3e528bd)
pytest -q tests/envs/mdp/:174 passed, 2 skippedpytest -q tests/envs tests/base tests/managers:957 passed, 38 skippedmake check:ruff + mypy(210 files) + pyright 全绿make test(非 slow 全量):2737 passed, 60 skipped, 0 failed备注
velocity_command.py的_heading()在read_plan is None时同样返回零张量(:292-298),不在本 issue 范围,留待 #2474 后续跟踪。