Skip to content

[Feature] MicroDuck proprioceptive and visual prior recipes - #4379

Closed
vmoens wants to merge 9 commits into
codex/microduck-ppo-recipesfrom
codex/microduck-sensors
Closed

vmoens wants to merge 9 commits into
codex/microduck-ppo-recipesfrom
codex/microduck-sensors

Conversation

@vmoens

@vmoens vmoens commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

MicroDuck priors can train from proprioception or proprioception plus a sampled head camera, with an explicit choice of actor-input or privileged-state critic. The legacy 56-value walker and nine-skill ordering remain compatible. Skills, prior training and controllers stay in TorchRL; the optional games zoo reuses the sensor sampler and encoder for recurrent game selectors.

The 53-value proprioceptive schema excludes simulator linear velocity and world pose. Camera inputs expose uint8 RGB, age and validity, with configurable rate, delay, dropout and noise. Camera history survives snapshots independently and clears on reset. The loader restores the recorded sensor architecture; controllers use the matching command and clock offsets.

What changes

The legacy state observation contains privileged simulator velocity. The sensor actor instead receives an explicitly ordered deployable input:

before, state (56):
  gravity[0:3], gyro[3:6], body_velocity[6:9], command[9:11],
  joint_position[11:25], joint_velocity[25:39], gait[39:42], action[42:56]

after, proprioception (53):
  gravity[0:3], gyro[3:6], command[6:8],
  joint_position[8:22], joint_velocity[22:36], gait[36:39], action[39:53]

Noise is applied only to gyro[3:6], joint_position[8:22], and joint_velocity[22:36]. A parametrized regression now proves that each option leaves every other field unchanged.

The pinned robot asset’s camera quaternion faces into its own head. The implementation preserves lens position and converts the matching camera site’s outward/up axes to MuJoCo’s optical frame. Native rendering retains at most two resolution-specific contexts, avoiding repeated context creation when policy cameras and spectator videos alternate. Snapshot renderers remain independent. Eviction and environment close make each renderer’s own graphics context current before releasing GPU objects, preventing cleanup from damaging another environment’s images.

Hydra observation groups compose with PPO/PPO-EWMA and the complete-episode prior recipe from #4378. This PR stacks on #4378 above #4375. Documentation cites the stock camera/IMU sources and records simulation/deployment limitations; no onboard-compatibility claim is made for the legacy 14-actuator simulator.

Validation

  • The sensor-noise layout regression passes for gyro, joint-position, and joint-velocity noise.
  • 37 native, prior, loader, controller and rendering checks passed; one CUDA case skipped. Three optional accelerated-backend cases encounter the existing local mujoco-torch/MuJoCo 3.10 import incompatibility.
  • All six prior combinations of sensor mode and critic inputs pass recurrent PPO-EWMA update/resume checks.
  • Camera mount, ordered images, sample timing, reset and snapshot ownership regressions pass. Downloaded-asset images show an outward upright view; sustained discovery with the same corrected mount passes in the zoo.
  • Installed zoo consumer: 44 tests passed, one accelerated skip. A visual hide-and-seek PPO-EWMA smoke with a frozen opponent and reference KL passes without importing examples.
  • Sensor collection benchmarks pass in all three modes. A ten-pair 64-square/160-square render probe fell from 3.61 s to 0.55 s with identical pixels; the dedicated mixed-resolution benchmark passes.

The installed integration CI pins zoo commit b1a4dcbdfd232f7c84ccf5190ea7ac4493842f2e. Linux CI exposed a cross-environment rendering regression during clone cleanup. The strengthened pixel regression passes on Mac CGL and GLFW after the cleanup fix in 8c4cc4e725c12fa072df70cd1cd9dda45878237c; the dedicated Linux GLFW regressions pass with MuJoCo 3.10 and 3.8.1, as do isolated ARM64 Linux tests with stable and nightly torch. The earlier x86 bulk-suite failure remains under investigation; the current full-suite rerun is pending. Installed integration and zoo native CI are green. Sensor prior learning and hardware deployment remain unevaluated.

@vmoens vmoens added the ci/optdeps Run the full tests-optdeps suite on this PR label Sep 14, 2026
@pytorch-bot

pytorch-bot Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4379

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 62 Pending

As of commit 164b903 with merge base a2acf99 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 14, 2026
@github-actions github-actions Bot added CI Has to do with CI setup (e.g. wheels & builds, tests...) Feature New feature Benchmarks rl/benchmark changes Environments Adds or modifies an environment wrapper Examples labels Sep 14, 2026
@vmoens

vmoens commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Closing because this draft is the third layer of the orphaned #4375/#4378 stack and therefore cannot land independently. The sensor and rendering work is preserved on codex/microduck-sensors; it should be reconstructed as focused main-based PRs after the controller and loader dependencies settle.

@vmoens vmoens closed this Sep 18, 2026
@vmoens
vmoens deleted the codex/microduck-sensors branch September 22, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Benchmarks rl/benchmark changes ci/optdeps Run the full tests-optdeps suite on this PR CI Has to do with CI setup (e.g. wheels & builds, tests...) CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Environments Adds or modifies an environment wrapper Examples Feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant