Skip to content

feat(humanoid-walk): holosoma-parity g1-walk-flat recipe with reset-time dynamics randomization - #91

Merged
wlgys8 merged 1 commit into
mainfrom
feat/g1-walk-flat-holosoma-parity
Oct 2, 2026
Merged

wlgys8 merged 1 commit into
mainfrom
feat/g1-walk-flat-holosoma-parity

Conversation

@wlgys8

@wlgys8 wlgys8 commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Align the g1-walk-flat fastsac recipe with holosoma's g1_29dof_fast_sac configuration. Both nightly tracking gates pass under the full randomization stack: lin-vel exp 0.522 (gate >= 0.475), ang-vel exp 0.660 (gate >= 0.533) at 30k iterations.

Recipe changes

  • sim dt 0.01 (100 Hz physics; retained for the validated recipe and performance budget)
  • position action scale 0.5 → 0.25 — larger scales caused per-step joint-target churn (~0.7 rad/step at 0.8) that suppressed yaw tracking (exp 0.30 → 0.73 across the sweep)
  • alpha_init 0.001 / target_entropy_ratio 0.0, 30k iteration budget

Domain randomization (holosoma parity, push excluded)

  • New WalkRandomizationCfg with independently disable-able items, sampled in-kernel at reset through the sim write program:
    • kp/damping ×U(0.9, 1.1), ground friction ×U(0.5, 1.25)
    • non-base link mass ×U(0.9, 1.2), base mass +U(-1, 3) kg, base com ±0.05 m
  • New BodyMassesQuery (core contract + MotrixSim backend) returning a body's nominal link masses in body order
  • Dedicated randomized reset kernel: numba Map getitem is statically compiled, so enabled configs declare a stable write-key schema; degenerate ranges perform no randomized writes
  • WbtJointPositionActionCfg.action_delay_steps: per-lane control-step delay queue (resampled at reset); observations and the action-rate penalty keep tracking the raw undelayed actions
  • WalkCommandCfg.gait_period_randomization_width: per-episode gait-period jitter (±0.2 s) via a per-lane phase_dt buffer
  • BadDofVelocityTerminationCfg: reusable core termination shared by WBT and other manager tasks; resets lanes whose joint speeds exceed any healthy gait after harsh impacts

Results (30k iters, 25–30k window)

metric no DR + full DR holosoma gate
lin-vel exp 0.599 0.522 ≥ 0.475 ✅
ang-vel exp 0.725 0.660 ≥ 0.533 ✅
mean ep_len 1000 991 —

Training is stable under the joint perturbation stack (near-full episodes, zero collapses).

Test plan

  • new test_walk_randomization.py (cfg validation, delay behavior, gait band, query wiring)
  • existing test_humanoid_walk.py / test_wbt_numba.py suites pass unchanged
  • 30k end-to-end training run with gates verified above

@wlgys8
wlgys8 force-pushed the feat/g1-walk-flat-holosoma-parity branch 8 times, most recently from d6584d9 to 8d5c98c Compare October 2, 2026 13:45
@wlgys8
wlgys8 requested a balanced review from Copilot October 2, 2026 13:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

It spans a core sim-API rename, numba-kernel compilation semantics (a latent build failure for partially-disabled randomization configs), and an RL recipe change whose committed dt contradicts the PR description, warranting human review.

Review effort: Balanced
Findings: 2 High severity · 2 Low severity

Open (4)
What changed in this PR

This PR aligns the g1-walk-flat FastSAC recipe with holosoma's g1_29dof_fast_sac configuration by adding reset-time dynamics randomization. It introduces a new WalkRandomizationCfg (kp/damping/friction/mass/base-com randomized in-kernel at reset via the sim write program), per-episode gait-period jitter, a per-lane action-delay queue, and a BadDofVelocityTerminationCfg. Supporting this, it renames the single-link sim queries/writes to a Link* namespace and adds a tree-scoped BodyMassesQuery to the backend-neutral sim contract.

Changes:

  • Rename BodyMass*/BodyCom*/BodyCenterOfMass* queries & writes to Link*, add BodyMassesQuery (core contract + MotrixSim backend) returning a body tree's nominal link masses in tree order.
  • Add reset-time domain randomization (WalkRandomizationCfg + dedicated randomized reset kernel), gait-period jitter (WalkCommandCfg.gait_period_randomization_width), action-delay config, and BadDofVelocityTerminationCfg.
  • Retune the g1-walk-flat recipe/config (action scale 0.25, alpha/entropy, 30k iterations) and add test_walk_randomization.py.
File Description
motrix_env_core/​src/​.../​sim/​model.py Rename to LinkMassQuery/LinkCenterOfMassQuery, add BodyMassesQuery + abstract compile_body_masses.
motrix_env_core/​src/​.../​sim/​write.py Rename BodyMassWrite/BodyComWrite → LinkMassWrite/LinkComWrite; document Link/Body naming.
motrix_env_core/​src/​.../​sim/​__init__.py Update exports for renamed/new query types.
motrix_env_core/​src/​.../​mdp/​terminations.py Add BadDofVelocityTerminationCfg + kernel (not wired into any recipe; duplicates WBT name).
motrix_env_motrixsim/​src/​.../​runtime.py Rename compile hooks; implement compile_body_masses (tree-order link masses).
motrix_env_motrixsim/​src/​.../​write_compiler.py Rename compile_link_mass/compile_link_com.
motrix_envs/​src/​.../​humanoid/​walk_manager_mdp/​randomization.py New WalkRandomizationCfg with range validation.
motrix_envs/​src/​.../​humanoid/​walk_manager_mdp/​reset.py New randomized reset kernel + param assembly; conditional write declaration.
motrix_envs/​src/​.../​humanoid/​walk_manager_mdp/​command.py Per-lane phase_step buffer with gait-period jitter.
motrix_envs/​src/​.../​humanoid/​cfg.py Wire randomization model queries when enabled.
motrix_envs/​src/​.../​humanoid/​g1.py Enable full randomization stack on g1-walk-flat (sim still dt=0.01).
motrix_envs/​src/​.../​quadruped/​walk_np.py Adopt renamed Link* queries/writes.
configs/​task/​g1-walk-flat/​motrix.fastsac.yaml Alpha/entropy parity + 30k iterations.
motrix_env_core/​tests/​* Update dispatch tests for renamed hooks.
motrix_envs/​tests/​test_walk_randomization.py New behavioral tests (some assert exact tuning values).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread motrix_envs/src/motrix_envs/locomotion/humanoid/g1.py
Comment thread motrix_envs/src/motrix_envs/locomotion/humanoid/walk_manager_mdp/reset.py Outdated
Comment thread motrix_env_core/src/motrix_env_core/mdp/terminations.py
Comment thread motrix_envs/tests/test_walk_randomization.py Outdated
@wlgys8
wlgys8 force-pushed the feat/g1-walk-flat-holosoma-parity branch from 8d5c98c to f6bf17d Compare October 2, 2026 14:33
@wlgys8
wlgys8 force-pushed the feat/g1-walk-flat-holosoma-parity branch from f6bf17d to 3495ebf Compare October 2, 2026 15:33
@wlgys8
wlgys8 merged commit e6b8fbd into main Oct 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants