You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
reset 模式 DR 事件无法参与 masked_autoreset:缺少掩码化写入门,且 write_randomization_tensor_mask 每次调用伴随 H2D 同步 #2623
为常用模型字段提供公开的掩码化写入门,对齐已有的 write_actuator_gains_tensor_mask(如 write_geom_friction_tensor_mask / write_body_ipos_tensor_mask),并让自带 DR term 声明 ResetSelection 支持;
Activity
TATP-233 commentedon Nov 19, 2026
修复进展(全部三个缺口 + 跨仓库 sync)
排查结论与修复已拆成两个 PR,覆盖本 issue 的全部请求项:
UniLab 侧 — PR #2630(feat(reset): support ResetSelection in built-in model-field DR terms)
Entity.write_geom_friction_tensor_mask/write_joint_armature_tensor_mask/write_body_ipos_tensor_mask(镜像既有write_actuator_gains_tensor_mask);内置 reset DR termGeomFriction、DofArmature、PdGains、RandomizeRigidBodyCom、RandomizeEncoderBias现声明supports_reset_selection并接受ResetSelection。g1_motion_tracking/mjwarp 的reset_selection_blockers()已实测为空,验收测试(graph 捕获 + 40 步set_sync_debug_mode("error")重放)通过。_materialize_tensor_randomization_default改为按字段缓存 immutable device 默认表(重声明 packed reset device 时失效);KP/KD 此前每次调用的 H2D 也一并消除。write_randomization_tensor_mask首次调用后纯设备操作。env.require),无 host 读;RandomizeEncoderBias每步的torch.tensor(joint_ids, device=cuda)H2D 改为冷路径缓存。二者都是本 issue 复现条件(sync-debug 下 graph 捕获)的阻断点。RandomizeRigidBodyMass、RandomizeBodyMassInertia、RandomizePhysicsSceneGravity三个 term 结构不同,留待后续。UniSim 侧 — PR unilabsim/unisim#537(fix(mjwarp): replace per-reset host-blocking stream sync with cross-stream event wait)
backend.py:4781的torch.cuda.current_stream().synchronize()替换为_torch_execution_stream(device).wait_stream(producer)(先例_upload_persistent_body_force)。deferred 模式(unilab 默认)下 reset 热路径从此全程无 host 阻塞;external-capture 分支不动。三个 focused 测试锁定"零 synchronize、一次 wait_stream"(旧代码会在首测失败)。请求 3(文档)
8-sync_free_autoreset.mdBehavior notes 新增 "Reset-mode DR replay cannot be disabled" 条目:在 reset 时恢复模型字段默认值的后端(如 MJWarp)上,禁用重放会让特权观测与物理从第一步分叉。验证
make check、make test-all全绿(最终 head)。make lint/make typecheck/make test全过;真实 CUDA 全量 mjwarp 测试通过(20 个 superdex/viser 失败经 stash 对照确认是先于补丁的存量环境问题)。两个 PR 合并后,本 issue 的全部请求项即闭环(follow-up 三个 term 除外)。
Merge pull request #2630 from Motphys/feat/issue-2623-masked-dr-reset…