{
  "format": "microduck-so101-residual-policy/1",
  "adapter": "so101-residual-single-step/1",
  "robotId": "so101",
  "scene_profile": "so101-residual-archive400/1",
  "observation_contract": "q6_prev_applied_target6_env12_v1",
  "contract_status": "local-experimental-design; runtime preflight and numerical parity required",
  "inputs": [
    {
      "name": "state",
      "dtype": "float32",
      "shape": [
        1,
        12
      ],
      "semantic": "measured-q-and-previous-applied-target"
    },
    {
      "name": "env",
      "dtype": "float32",
      "shape": [
        1,
        12
      ],
      "semantic": "so101-scene-state/1"
    }
  ],
  "output": {
    "name": "absolute_target",
    "dtype": "float32",
    "shape": [
      1,
      6
    ],
    "semantic": "absolute-joint-target",
    "formula": "clip(raw_measured_q6 + denormalized_learned_delta6, action_limits)",
    "browser_must_not_add_measured_q_again": true,
    "float32_boundary_rounding": "Final float32 rounding can place a joint limit a few ULP beyond original double bound; adapter must validate/reclip against original action_limits before actual application and store actual applied target."
  },
  "joints": [
    "shoulder_pan",
    "shoulder_lift",
    "elbow_flex",
    "wrist_flex",
    "wrist_roll",
    "gripper"
  ],
  "units": {
    "joints": [
      "degree",
      "degree",
      "degree",
      "degree",
      "degree",
      "percent"
    ],
    "delta": [
      "degree",
      "degree",
      "degree",
      "degree",
      "degree",
      "percentage_point"
    ],
    "position": "m",
    "angle": "degree",
    "time": "s",
    "ctrl": "radian"
  },
  "control_dt": 0.03333333333333333,
  "timestep": 0.004761904761904762,
  "substeps": 7,
  "action_steps": 1,
  "episode_steps": 600,
  "action_limits": [
    [
      -109.99987525598623,
      109.99987525598623
    ],
    [
      -100.00004285756798,
      100.00004285756798
    ],
    [
      -96.82986737710912,
      96.82986737710912
    ],
    [
      -94.99984017946129,
      94.99984017946129
    ],
    [
      -157.21102461697095,
      162.78934171036462
    ],
    [
      0.0,
      100.0
    ]
  ],
  "normalization": {
    "kind": "embedded",
    "statistics_member": "models/step_10000/normalization.npz",
    "semantics": "state/env double norm then float32 MLP and float32 delta denorm; add raw measured q and clip in double, final output float32",
    "extra_browser_normalization": false,
    "legacy_comparison_tolerance_absolute_per_component": 0.0001,
    "legacy_input_quantization": "state/env tensors are float32 and differ from original double raw observation; measure against real archive targets"
  },
  "state_layout": [
    {
      "slice": [
        0,
        6
      ],
      "name": "measured_q6",
      "formula": "first5=f32(qpos[joint]*180/pi); gripper=f32(100*(qpos[gripper]-ctrl_lo)/(ctrl_hi-ctrl_lo))",
      "joint_address_resolution": "resolve by exact names; archive qpos indices28:34 are fixture-specific"
    },
    {
      "slice": [
        6,
        12
      ],
      "name": "previous_actually_applied_target6",
      "initialization": "initial.targets from validated restored control context, full precision; no zero or measured-q fallback",
      "update": "only after all six validated ctrl writes succeed; reflect any actual clipping/conversion or explicitly reject an unmodeled controller"
    }
  ],
  "environment_layout": [
    {
      "index": 0,
      "name": "cube_x",
      "unit": "m",
      "coordinate_frame": "world",
      "source": "data.xpos[red_cube*3]"
    },
    {
      "index": 1,
      "name": "cube_y",
      "unit": "m",
      "coordinate_frame": "world",
      "source": "data.xpos[red_cube*3+1]"
    },
    {
      "index": 2,
      "name": "cube_z",
      "unit": "m",
      "coordinate_frame": "world",
      "source": "data.xpos[red_cube*3+2]"
    },
    {
      "index": 3,
      "name": "cube_yaw_folded",
      "unit": "degree",
      "coordinate_frame": "world yaw, cube 90-degree symmetry",
      "source": "wrap90(atan2(2*(w*z+x*y),1-2*(y*y+z*z))*180/pi); cached data.xquat wxyz"
    },
    {
      "index": 4,
      "name": "tip_minus_cube_x",
      "unit": "m",
      "coordinate_frame": "world difference",
      "source": "FK.gripperframe.x - cube_x"
    },
    {
      "index": 5,
      "name": "tip_minus_cube_y",
      "unit": "m",
      "coordinate_frame": "world difference",
      "source": "FK.gripperframe.y - cube_y"
    },
    {
      "index": 6,
      "name": "tip_minus_cube_z",
      "unit": "m",
      "coordinate_frame": "world difference",
      "source": "FK.gripperframe.z - cube_z"
    },
    {
      "index": 7,
      "name": "jaw_minus_cube_yaw_folded",
      "unit": "degree",
      "coordinate_frame": "relative orientation modulo 90 degrees",
      "source": "wrap90(wrap90(atan2(R[4],R[1])*180/pi)-cube_yaw_folded)"
    },
    {
      "index": 8,
      "name": "box_x",
      "unit": "m",
      "coordinate_frame": "world",
      "source": "data.xpos[box*3]"
    },
    {
      "index": 9,
      "name": "box_y",
      "unit": "m",
      "coordinate_frame": "world",
      "source": "data.xpos[box*3+1]"
    },
    {
      "index": 10,
      "name": "tip_minus_box_x",
      "unit": "m",
      "coordinate_frame": "world difference",
      "source": "FK.gripperframe.x - box_x"
    },
    {
      "index": 11,
      "name": "tip_minus_box_y",
      "unit": "m",
      "coordinate_frame": "world difference",
      "source": "FK.gripperframe.y - box_y"
    }
  ],
  "feature_math": {
    "DEG": "180/pi",
    "wrap90": "((a+45)%90+90)%90-45",
    "world_pose_source": "cached data.xpos/xquat after ordinary mj_step; do not substitute integrated qpos or call forward on live data before observation",
    "fk": "separate MjData; qpos=model.qpos0; write measured f32 joint-state first five / DEG by name; mj_forward on fk only; gripperframe site xyz and row-major matrix; gripper remains qpos0",
    "control_conversion": "first5=target/DEG; gripper=ctrl_lo+target[5]/100*(ctrl_hi-ctrl_lo); clamp each to actuator ctrlrange"
  },
  "reset": {
    "source": "archive initial.model/data/time/targets; see evaluate_inline.restore",
    "order": [
      "wait for previous async inference/step to stop",
      "validate identity, all names, shapes, finite values before mutation",
      "restore model arrays, then data arrays; restore time and full precision targets",
      "mj_forward(model, data)",
      "restore saved qacc_warmstart",
      "clear step/acc/subLeft/result; previous target is restored initial.targets"
    ],
    "settling_steps": 0,
    "archive_seed_role": "label for saved initial state, never regenerate using a different PRNG"
  },
  "scheduling": {
    "physics_steps_per_inference": 7,
    "control_inferences_per_step": 1,
    "stale_async_results": "generation-token mismatch must not mutate ctrl/history/physics",
    "wall_time": "slow inference pauses physics; bounded RAF backlog may slow wall time but must never skip started control steps",
    "required_order": [
      "pre-step observations",
      "infer once",
      "validate output",
      "apply six ctrl",
      "update previous applied target",
      "seven fixed physics steps",
      "record post-step state and pre-step features"
    ]
  },
  "scene": {
    "archive_member": "scene/compiled-400.xml",
    "sha256_original": "5b4e2419dca2a6fed911fce5106606b4bae8f60cb74e4b70f4f10d4bacf76658",
    "allowed_rewrite": "file resource paths only; hash rewritten XML and verify all referenced asset bytes",
    "native_equivalence_scope": "archived zero-physics-step parameter comparison, not browser rollout acceptance",
    "website_scene_same_as_native": false,
    "joint_range_rounding_difference": "website shoulder_lift ±1.74533 vs native ±1.7453293000000001; gripper upper1.74533 vs1.7453292"
  },
  "provenance": {
    "source_commit": "cd3c8b5276f91481669aa8b8620c90e0c218a416",
    "checkpoint_step": 10000,
    "selection_reason": "latest-training-step-experimental-only",
    "selected_step_in_original_report": null,
    "all_checkpoints_eligible": false,
    "qualification": "not-accepted",
    "accepted_changed": false,
    "deployed": false,
    "onnx_sha256": "21db5220065d199826177f5fd3621186c456362291b738bbe87d9ee21550f355",
    "original_feature_source_missing": [
      "box_scene.py",
      "box_policy_history.py",
      "alignment_features.py",
      "simulation.py",
      "yaw_ik.py",
      "adapter.mjs"
    ],
    "feature_mapping_evidence": [
      "archive evidence/export_browser_candidate.py lines93-98 (gated design, not a completed export)",
      "current app.js sceneState implementation",
      "actual archive input24/control traces"
    ],
    "feature_source_status": "needs_review: original implementation absent; formulas/trace consistency confirmed; local FK/runtime golden still required",
    "source_hashes": [
      {
        "path": "public/sim/v1/app.js",
        "sha256": "6c145b883d2889334df54507a6e8ccea98d1b0e9e46651f207c2154f984c0346"
      },
      {
        "path": "public/tools/v1/policy-contract.mjs",
        "sha256": "c8dcfdfef4ba153f5b59348d37dc8adc95371cc9a57428eda6ddc120e2e969ac"
      },
      {
        "path": "public/tools/v1/experiment.mjs",
        "sha256": "95731e40b5473d8308ef3c852fac814c58fcae3864e9b3a52686c3c07fe00e55"
      },
      {
        "path": "public/tools/v1/sim-experiment-ui.mjs",
        "sha256": "2ded31ca8a1afea9c74071bab5edc04c9f8b703f821acc49d1c84561d1e50a16"
      },
      {
        "path": "scripts/sim-page.mjs",
        "sha256": "966690edd86201d8ab04e2f9a4178f4d3d148b3a5d6d35f186d4276ed0c29fc4"
      },
      {
        "path": "public/sim/v1/so101-task/scene.xml",
        "sha256": "55dd27997cd6e6d1676fd5d64104574507d1d416359654ad75fcb1af6fed86d3"
      },
      {
        "path": "public/sim/v1/so101-task/manifest.json",
        "sha256": "88bb40393a382a8983cd0aa35c5c962ddbadc50d92507265c9c8fb559c261443"
      },
      {
        "path": "public/sim/v1/vendor/mujoco-4.0.0/mujoco.js",
        "sha256": "85fdadb2c5acee97756e2b0257085f795a2af542f0c4cb97412a6d377abe39e2"
      },
      {
        "path": "public/sim/v1/vendor/mujoco-4.0.0/mujoco.wasm",
        "sha256": "51ae58ae3c69145f6570aeb1fae27f8f142b2d883c804c4747c1a0c3bc80b0de"
      }
    ],
    "archive_sha256": "4eda9820c118eeefc775f4044c6d245f849fedd6a40d688eebed6fed8eb5921e",
    "checkpoint": "models/step_10000",
    "safetensors_sha256": "433a7167b6d91731dab85e3960d4de59cb2c0876ab35f37d1605d0e32af78f35",
    "normalization_npz_sha256": "17e92e5008a9f882cdb7b5ef0960e57788bfed780854b59648c7b546c49934d8",
    "config_sha256": "e81511e70dbaca3a61356c196a795e4c123067368921d69fb4a7907e56ff34ae",
    "wrapper_sha256": "6f4bd0df532147e78cf5656a1ff06f450e160b6f52c9b2ad2e1c9533df502de4",
    "observation_contract_sha256": "be853f1902ca6952507bfb14323847c6fd338538ada6e6909edc50cd611f55b6",
    "derived_contract_sha256": "768022022f4af8c3ece72021e4a336dae87eb109e778c64513820bcf1f68c43e",
    "training_versions": {
      "lerobot": "0.6.1",
      "torch": "2.11.0+cpu",
      "numpy": "2.2.6",
      "safetensors": "0.8.0"
    },
    "website_rule_baseline_lerobot": "0.7.0"
  },
  "recording": {
    "format": "microduck-experiment/1 only with truthful local execution manifest hash and extended policyContract/controlContext",
    "engine_hash_must_include": [
      "actual MuJoCo JS/WASM",
      "actual ORT JS/WASM",
      "local adapter/runner/host overlay",
      "local experiment logic"
    ],
    "model_hash_must_include": [
      "rewritten XML",
      "all mesh/texture bytes",
      "effective manifest"
    ],
    "policy_hashes": [
      "ONNX",
      "weights",
      "normalization",
      "contract"
    ],
    "controller_state": [
      "previous_applied_target6",
      "control_step",
      "subLeft",
      "acc",
      "generation boundary"
    ],
    "max_sim_seconds": 60,
    "separate_modes": [
      "trajectory-playback",
      "physics-rerun-with-recorded-controls",
      "fresh-policy-rerun"
    ],
    "physical_success_criterion": "box-placement-v2-physical-release must be independently implemented and tested, or strict acceptance remains not-run; legacy center-in-box never promotes candidate"
  },
  "required_preflight": [
    "spec exact names/shapes/units/timing/limits",
    "session names and tensor types",
    "actual ONNX hash",
    "finite pre-step state/env/previous target",
    "named model body/site/joint/actuator IDs and ctrlrange consistency",
    "archived initial/model compatibility",
    "real trace FK golden",
    "real native wrapper numerical target parity",
    "no changes to builtin production contracts or defaults"
  ],
  "status": "local_experimental_not_accepted",
  "model": {
    "file": "candidate-step10000.onnx",
    "sha256": "21db5220065d199826177f5fd3621186c456362291b738bbe87d9ee21550f355",
    "bytes": 824981,
    "ir_version": 8,
    "opset": 13
  },
  "numerical_evidence": {
    "file": "reference-vectors.json",
    "sha256": "74b8b621344916006a6fca69fbd358085fa8f8b2ccfa8c8ca1a98ae2ce3737c8",
    "cases": {
      "mean": 1,
      "synthetic_boundary": 48,
      "archived_real": 40,
      "total": 89
    },
    "absolute_tolerance": 0.0001,
    "offline_reconstruction_passed": true,
    "official_onnx_checker_run": false,
    "trusted_pytorch_reexecuted": false,
    "browser_ort": "pending_parent_verification",
    "quality_acceptance": "not-passed; original checkpoint remains ineligible"
  }
}
