跳转至

GRAIL-Min:SMPL-X / PHC-X 最小适配实验计划

Material Passport

  • Origin Skill: ars-codex:academic-research-suite
  • Origin Workflow: experiment-agent
  • Origin Mode: plan
  • Origin Date: 2026-07-24
  • Verification Status: UNVERIFIED
  • Version Label: code_plan_v15_single_condition_runtime_evidence
  • Scope: 一个训练条件、一个 motion、一个 frozen tracker、一个 GRAIL 训练流程

UNVERIFIED 表示代码、内部资格门、smoke 和训练尚未全部实际通过。本文是 预注册执行合同,不是结果报告。

1. 唯一实验条件

最终只有一个训练条件:

条件 runtime / robot frozen controller policy output 训练
GRAIL-Min GRAIL / Isaac Lab / SMPL-X PHC-X 63D body residual + 2D hand primitive

E0、E1、P0、P1、S0仅是这一个条件进入训练前的内部资格门。它们不是 baseline、control、ablation、实验组或额外模型。T0/T1只是相同条件的不同 seed 重复,最终结果表仍只有一行 GRAIL-Min

本轮不运行第二种 observation、reward、controller、time base、residual scale 或训练配置。

2. 研究问题与假设

研究问题:

在严格保留 GRAIL manipulation observation、reward、termination、PPO 和 训练日程的前提下,能否只替换 embodiment 与 frozen tracker 接口,使一条 SMPL-X HOI motion 在 GRAIL 中完成训练?

假设:

frozen PHC-X 提供足够强的人体跟踪先验;GRAIL policy只需学习原方法风格的 小尺度63D normalized body-action residual,因此单 motion 训练应比从零学习 更快收敛。

该假设只能由实际训练曲线和预注册 evaluation 验证,不能由 checkpoint 存在 本身推出。

3. Minimal-adaptation 边界

3.1 必须保持不变

  • GRAIL pnp_table manipulation observation term集合、顺序和 frame stack;
  • object、hand contact、task support、object future、BPS awareness;
  • GRAIL reward函数、reduction、权重和阈值;
  • 除明确 embodiment/entity binding 外的 termination语义;
  • GRAIL PPO、actor/critic trunk、rollout、optimizer和训练 budget;
  • physics 200 Hz、control 50 Hz
  • policy的原 residual-style控制语义。

3.2 允许且必须的差异

  • G1 articulation → 52-body / 153-DOF SMPL-X;
  • SONIC frozen latent controller → PHC-X frozen PNN;
  • G1 joint/body/link/index → SMPL-X exact-name permutation;
  • G1 action interface → 63D body residual + 2D hand primitive
  • PHC-X 2026D → 153D direct action interface;
  • release中固定的 right_hand / 单一 table 实体绑定 → task/motion metadata解析的 active_hand / active_support
  • reference、object、support和contact sensor的数据源转换;
  • checkpoint-interface要求的同义 buffer: GRAIL full-latent-rate项作用于最终63D controller input,不冒充PHC latent。

3.3 禁止

  • 针对当前左手 sequence 写死 left/right reward分支;
  • 针对当前两个 support 写死 source/destination reward分支;
  • 改 observation term、reward weight、termination threshold;
  • 增加 curriculum、reward shaping或 residual-scale sweep;
  • 以 PPO 掩盖 PHC-X / runtime 接口错误;
  • 以手写 passed=true 文件代替 raw evidence;
  • gate失败后临时增加另一训练条件绕过。

4. 冻结输入

motion:
  output/auto_experiments/20260723_cup_left_hand_object_interaction_v20/motion.npz
task plan:
  output/auto_experiments/20260705_hsi_generation_task_inputs/task_plan_left.json
layout:
  data/selected_SAGE10k/e2e_test_scenes/2cdc81db/layout_2cdc81db.json
motion key:
  cup_left_pick_place_v20
source fps:
  30
PHC-X checkpoint:
  submodules/PHC/output/HumanoidIm/phc_x_pnn/Humanoid.pth
PHC-X affine:
  submodules/PHC/data/action_offset_smplx.pkl
GRAIL-Min config:
  manager/universal_token/hoi/pnp_table_smplx_phcx_minimal

所有 source、checkpoint、affine、USD、reference contract 和关键源码都必须 由 E0 SHA-256 map绑定。任一关键文件改变后,旧 gate自动失效。

5. Reference contract

converter必须生成:

  • robot_motion.pkl
  • object_motion.pkl
  • robot_motion_humanoid.xml
  • robot_motion_humanoid.usd
  • object/support USD
  • BPS basis与object BPS
  • primitive_open_closed.json
  • task_roles.json
  • scene_contract.json
  • canonical_runtime_reference.npz
  • reference_contract.json

5.1 Canonical 50 Hz reference

canonical_runtime_reference.npz 必须独立由 source motion、MJCF、 primitive contract和role contract构造,不能由 E1/P1 runner回写。 reference_contract.json 以artifact key canonical_runtime_reference_50hz 绑定其路径和SHA-256。

当前 exact timing:

source frames = 597
source fps = 30
duration = (597 - 1) / 30 = 19.866666... s
target fps = 50
target sampling = arange(0, duration, 1/50)
target frames T = 994

canonical artifact至少包含:

  • source interpolation index_0/index_1/blend 与 discrete nearest index;
  • root position/quaternion/linear velocity/angular velocity;
  • 153D joint position;
  • 52-body position/quaternion/linear velocity/angular velocity;
  • object pose/linear velocity/angular velocity;
  • 2D {-1,+1} hand scalar;
  • 双侧 2×45D normalized primitive target;
  • 双侧 contact label;
  • active hand与active support逐帧index;
  • P1固定22-body reference;
  • exact body/joint/hand/support name order。

完成 SMPL-X 153D MotionLib修复后,需再加入 exact 153D joint velocity并与 runtime验证;未验证前不得声称 reference contract完整。

5.2 当前冻结时序

active contact target frames = 130..960
active contact frame count = 831
support transition target frame = 250
P0 sampled frames = [0,129,130,131,249,250,251,993]

role resolver必须按物理时间工作,不按原始 source frame硬编码。

6. Embodiment 与 action contract

6.1 SMPL-X

  • exact 52 canonical body names;
  • exact 153 joint names,每个非根body按 body-major x,y,z
  • runtime traversal order必须按名字生成 canonical↔runtime permutation;
  • 禁止 identity-order假设;
  • body partition: 0..50 + 96..107,共63D;
  • hand partition: 51..95 + 108..152,共90D;
  • 禁止把 body/hand当连续slice。

GRAIL MotionLib 只在确认完整 51 × xyz = 153D 球关节合同时展平 axis-angle;G1与其他legacy机器人继续走原 scalar-DOF路径。

6.2 PHC-X transform

human observation: 2026D
frozen PNN base action: 153D
learned body residual: 63D
residual scale: 0.1
motion hand scalar: 2D
primitive-expanded hand target: 90D
final normalized PHC action: 153D

body residual只加到exact 63D body indices;90D hand由motion primitive覆盖。 最终normalized action只经过一次 PHC action affine,随后进入GRAIL原 JointPositionAction term。

wrapper必须在同一次forward暴露:

  • exact 2026D input;
  • exact 153D base PNN action;
  • 63D residual;
  • 2D raw primitive;
  • 90D normalized hand target;
  • 153D final normalized action;
  • same-source PD diagnostic;
  • simulator-order pre-clip与post-global-clip action。

same-source PD diagnostic不能单独通过P0;P0还必须读取真实ActionManager processed target与articulation target。

7. Object / scene awareness

原 GRAIL manipulation observation保持 term-for-term 对齐。适配只替换数据源 和link/index:

  • object状态来自 converted dynamic object;
  • hand frame/contact slots从G1 link换成SMPL-X exact link;
  • left/right各保留8个object contact slots;
  • support contact保留双侧16个broad hand links;
  • active hand由motion/task role解析;
  • active support由stage segment解析;
  • object future和BPS保持原 term、顺序、维度与语义;
  • inactive hand和非active support不得泄漏到active reward/termination channel。

当前 sequence是左手并跨两个 support,但实现必须能由 metadata解析镜像右手 和任意合法support列表。

8. 内部资格门

这些门只回答“同一个 GRAIL-Min 实现是否有资格继续”,不产生额外实验结果。

8.1 E0 — Static contract

检查:

  • mother/adapted resolved-config全量diff;
  • 只允许第3.2节差异;
  • observation/reward/termination term顺序;
  • body/joint/contact/role mapping;
  • checkpoint/RMS/PD affine/eval/frozen/optimizer isolation;
  • actual Isaac Lab USD load;
  • exact body/joint set、唯一性和permutation round trip;
  • runtime hard joint limits;
  • reference exact artifact/source key set;
  • current critical-source SHA-256 map。

通过:

  • unexpected config diff = 0;
  • 63+90=153
  • 52 bodies / 153 joints exact;
  • 14-body GRAIL tracking subset order exact;
  • contact slots per side = 8;
  • left/right mirror reward parity max abs ≤1e-6
  • all required artifacts存在且hash匹配;
  • USD hard limits finite且lower < upper。

任何 critical source或artifact变化后必须重跑E0。

8.2 E1 — Full reference replay

在无policy条件下显式审计target frame 0..993,每帧恰好一次。 禁止直接以 step_replay() 作为首帧路径,因为它先increment后apply。

每帧分两个状态:

  1. teleport后、physics前的state parity;
  2. 固定reference重新写入并完成physics/sensor refresh后的contact sample。

object必须写完整13D state,不能只写pose。

阈值:

root position max       ≤ 1e-4 m
root orientation max    ≤ 1e-4 rad
joint position max      ≤ 1e-5 rad
body position max       ≤ 1e-4 m
body orientation max    ≤ 1e-4 rad
object position max     ≤ 1e-5 m
object orientation max  ≤ 1e-5 rad
nonfinite count         = 0

contact raw evidence:

object forces:
  [T, side=2, slot=8, xyz=3]
support forces:
  [T, side=2, support=2, broad_link=16, xyz=3]
sensor timestamps:
  [T, four exact sensors]

同时检查:

  • exact sensor name、tracked-body/filter order;
  • converted contact interval;
  • primitive scalar→90D parity;
  • active hand/support routing;
  • support只在frame 250切换;
  • non-zero inactive-channel adversarial probe无泄漏;
  • root与Pelvis一致;
  • quaternion norm;
  • open/closed fingertip geometry;
  • primitive joint limits;
  • replay self/non-task collision。

raw trace中的reference必须逐项等于hash-bound canonical artifact;actual复制给 reference不得通过。

8.3 P0 — PHC-X tensor / PD parity

固定frames:

[0,129,130,131,249,250,251,993]

同一静态state/reference分别走:

  1. PHC native observation functions + checkpoint RMS/PNN;
  2. GRAIL wrapper PHC-X transform。

冻结exact入口:

phc.utils.isaacgym_humanoid_funcs.compute_humanoid_observations_smpl_max
phc.utils.isaacgym_humanoid_funcs.compute_imitation_observations_v6
phc.learning.network_loader.load_pnn
gear_sonic.envs.wrapper.phcx_action_adapter.compute_phcx_human_observation
ManagerEnvWrapper.transform_phcx_actions

raw evidence包含native inputs、wrapper inputs、RMS mean/var、normalized/clipped observation、同一次forward的base PNN action、primitive、final action、PD offset/scale、ActionManager processed target、robot target、source path/hash和 E0 frozen digest。

阈值:

pre-normalization observation max abs  ≤ 1e-4
normalized observation max abs         ≤ 1e-4
base PNN action max abs                 ≤ 1e-6
ActionManager PD target max abs         ≤ 1e-5 rad
robot joint target max abs              ≤ 1e-5 rad
ordering mismatch count                 = 0
nonfinite count                         = 0

P0使用独立暂停audit env。process_action/apply_action 可改变manager/target buffer但不得推进physics。

8.4 P1 — Frozen zero-residual closed loop

physics = 200 Hz
control = 50 Hz
delta_63 = 0
hand primitive = motion labels
PPO = disabled

必须记录 T=994 state frames与 T-1=993 control transitions:

Isaac Lab先计算termination、后推进command cursor,因此第993个transition到达 terminal reference state时原版tracking_time_out仍为false;它只会在额外的 terminal-hold action上触发。P1不增加该第994个transition,993个transition内 time_out=false,以同时保持原GRAIL termination语义和exact T-1合同。

  • current/reference PHC inputs及next-reference index;
  • same-forward 153D base PNN action;
  • zero 63D residual;
  • primitive-overridden final action;
  • ActionManager processed target;
  • robot joint target;
  • control/simulation timestamps;
  • reset后state-write/teleport计数;
  • resolved termination与safe-NaN状态;
  • E0-bound hard joint limits; -真实pairwise self-collision sensor evidence。

只在P1诊断中禁用object-position-deviation termination,以隔离human tracker; 其他human tracking termination保持。disabled reason单独记录,不伪装成 TerminationManager false列。safe-NaN recovery必须关闭。

主指标:

sequence completion                 = 100%
non-object human termination        = 0
22-body world-space MPJPE mean      ≤ 0.10 m
22-body world-space MPJPE p95       ≤ 0.20 m
root position p95                   < 0.25 m
joint hard-limit excess >0.001 rad  = 0
persistent nonadjacent self-collision
  force >200 N for ≥5 frames        = 0
reset count                         = 0
invalid recovery count              = 0
nonfinite count                     = 0

22-body集合:

Pelvis,
L/R_Hip, L/R_Knee, L/R_Ankle, L/R_Toe,
Torso, Spine, Chest, Neck, Head,
L/R_Thorax, L/R_Shoulder, L/R_Elbow, L/R_Wrist

误差使用world-space、不做root alignment;先body mean再统计frame mean/p95。

自碰撞不能用全零占位。诊断环境需为每个source body建立single-body filtered contact reporter并映射全部非相邻pair;在真实采集器可用前P1必须fail closed。

8.5 S0 — Two-env smoke

num_envs = 2
num_learning_iterations = 1
num_steps_per_env = 24
seed = 0

检查:

  • reset / step / backward / save / load;
  • actor 65D
  • body / hand / env action 63 / 90 / 153D
  • 两个env注入left/right镜像role;
  • rollout跨一次support boundary;
  • inactive hand/non-active support隔离;
  • reward各项finite;
  • PHC-X无grad且不在optimizer;
  • checkpoint round-trip exact;
  • evaluation callback可读取trace。

S0仍是工程smoke,不是第二个训练条件。

9. Stage artifact 与 fail-closed 规则

每个gate exact top-level keys:

schema, stage, passed, command, started_at, completed_at,
upstream_hashes, code_hashes, prerequisite_gate_hashes,
runtime, thresholds, metrics, checks, artifacts, errors

规则:

  • artifacts 每项必须为 {path,sha256}
  • raw validator只接受artifact record,不接受bare path;
  • validator重新计算artifact hash、metric和check;
  • JSON/NPZ missing/extra key、bad type、empty frame、NaN/Inf全部返回 passed=false + errors,不得抛出使preflight崩溃;
  • E1/P0 prerequisite为空;
  • P1 exact绑定E1/P0 gate hash;
  • S0 exact绑定E1/P0/P1;
  • training preflight exact绑定E1/P0/P1/S0;
  • passed = errors为空 and all(checks)
  • source/code/artifact hash漂移立即失败;
  • E1/P1 reference必须等于canonical artifact;
  • P0/P1 frozen digest必须等于E0 checkpoint audit;
  • P1 hard limits必须等于E0 USD audit。

10. 唯一训练

10.1 T0 development repetition

condition = GRAIL-Min
seed = 0
num_envs = 4096
num_steps_per_env = 24
num_learning_iterations = 20000
save_frequency = 500
motion_resample_frequency = 250

每500 iterations固定evaluation。不得根据中途结果修改observation、reward、 termination、residual scale或budget。

允许提前停止:

  • NaN/Inf;
  • frozen/checkpoint/code gate失败;
  • action/observation schema漂移;
  • 连续3个eval checkpoint出现同一 catastrophic human termination,且确认 不是 evaluator bug。

10.2 T1 preregistered repetitions

T0执行正确后,完全相同条件运行 seeds 0,1,2。seed 0若配置和artifact完全相同 可复用T0,不重复训练。不得只报告最好seed。

11. Evaluation

每个seed固定start offsets:

[0,7,14,21,29]

主成功定义沿用GRAIL:

从允许的pre-contact start到reference结束前,不发生任何非-timeout early termination。

每个seed报告:

  • 五个start的sequence success;
  • start 0完整994-frame trace;
  • object deviation;
  • active hand/support termination;
  • reward各term;
  • MPJPE/root error;
  • residual L2、residual-rate、full-controller-input-rate;
  • checkpoint与所有raw artifact。

最终表只有一行 GRAIL-Min,行内汇报三个seed的均值、离散度和逐seed原始值。

12. 实施状态

截至当前:

  • minimal SMPL-X robot/config/role/contact/reference/PHC-X adapter代码已开始实现;
  • canonical runtime reference CPU tests通过,真实source得到994帧;
  • wrapper action transform已由独立review确认: same-forward base action、audit snapshot、global clip与rollout性能问题已修;
  • 发现并修复GRAIL MotionLib的SMPL-X 51D→153D blocker,等待独立review; -第一版raw trace被adversarial reviewer以全合成数据绕过,v2 validator正在加固;
  • USD audit已增加runtime hard-limit contract,尚需重新实际生成;
  • 因critical source继续变化,旧E0已经失效;
  • E1/P0/P1/S0和训练尚未正式运行。

因此当前不允许声称实验完成、tracker闭环通过或训练快速收敛。

13. 执行与确认

所有实现诊断、CPU tests、compose和静态审计可在本任务内继续。正式 E1/P0/P1/S0/T0运行前,按experiment-agent工作流向用户展示:

  • exact command;
  • working directory;
  • expected artifacts;
  • success criteria;
  • timeout与monitor paths。

得到确认后才启动正式simulator/GPU gate或训练。任何正式命令失败时不自动 重试、不静默改配置;先报告原始错误和受影响的唯一条件 GRAIL-Min