Skip to content

Implement improvement plan (phases 0-8): agent-native creature workbench - #15

Merged
iodriller merged 1 commit into
mainfrom
feat/improvement-plan-phases-0-8
Jun 23, 2026
Merged

Implement improvement plan (phases 0-8): agent-native creature workbench#15
iodriller merged 1 commit into
mainfrom
feat/improvement-plan-phases-0-8

Conversation

@iodriller

@iodriller iodriller commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Implements all 8 phases of docs/IMPROVEMENT_PLAN.md, turning Creature Lab from a single stationary tripod demo into an agent-native articulated-creature workbench. Every behavioural claim was verified against the live PyBullet/MuJoCo backends.

What's in it

  • Phase 0 — Demo UX. Diagnosed the real "stationary creature" cause (1 m spawn crash-land + a no-thrust tripod gait). Default demo is now a forward-walking quadruped (+0.58 m); added a worm; demo --creature {quadruped,worm,tripod}.
  • Phase 1 — Scaffolds. scaffold/ generators (worm, quadruped, hexapod, humanoid) + mirror_limb; export-urdf (verified loadable in PyBullet).
  • Phase 2 — Creature Zoo. Curated gallery (zoo.py + zoo/ data) with computed baselines; zoo list|run|validate-all.
  • Phase 3 — Failure diagnosis. diagnosis.py with 8 locomotion failure patterns; diagnose explains why a run failed and suggests fixes.
  • Phase 4 — Closed-loop control. ObservationSpec/ActionSpec, a Gymnasium-style CreatureEnv, and CPG/PID/pose-sequence controllers; run --controller {sinusoid,cpg}.
  • Phase 5 — Debug viewer. CoM/root trails + fall marker overlays, side-by-side compare, and matplotlib plot.
  • Phase 6 — Humanoid kit. humanoid_minimal/humanoid_12dof zoo entries, impulse events for push-recovery, and 4 biped-specific diagnosis patterns.
  • Phase 7 — Evolution. Typed mutation operators + crossover and four strategies (hill_climb, genetic, map_elites, cmaes); lineage tree; archive/lineage JSON.
  • Phase 8 — Bridges. Full MJCF export + a MuJoCo backend, URDF <transmission> blocks, and best-effort URDF import; export-mjcf, import-urdf, run --backend mujoco.

Re-audit fixes (post-implementation review)

  • Control-mode bug: CreatureEnv velocity/torque actions were silently applied as position targets, and the env could not drive hinges lacking a MotorSpec. Added PyBulletBackend.apply_joint_control (drives any hinge by id in position/velocity/torque); the env now uses it. MuJoCo supports position only (raises clearly otherwise). Regression tests added.
  • CI: now installs the evolve + mujoco extras so CMA-ES and the MuJoCo backend are actually exercised (previously always skipped).
  • Housekeeping: gitignore MUJOCO_LOG.TXT and *.urdf; fixed a FutureWarning/latent bug in URDF import (childless-element truthiness).

Notable judgments (documented in the plan)

  • MJCF maps motors to <position> servos (not plain <motor>) so the exported model is actually drivable; added joint damping/armature + implicitfast integrator for solver stability.
  • Per the project's portability promise, PyBullet-tuned gaits don't reproduce their exact motion under MuJoCo — the backend runs stably and scores finitely, which is the contract.
  • Evolution lineage is stored as a self-contained lineage.json rather than new TraceMeta fields.

Tests

232 passing (from 132), ruff check + format clean. MuJoCo/CMA-ES tests skip gracefully when their extras are absent.

Turns Creature Lab from a single stationary tripod demo into an agent-native
articulated-creature workbench. Each phase is verified against the live backend.

Phase 0 - Demo UX: diagnosed the real "stationary creature" cause (1m spawn
  crash-land + no-thrust tripod gait). Default demo is now a forward-walking
  quadruped; added a worm; `demo --creature {quadruped,worm,tripod}`.
Phase 1 - Scaffolds: scaffold/ generators (worm, quadruped, hexapod, humanoid)
  + mirror_limb; export-urdf (loads in PyBullet).
Phase 2 - Creature Zoo: curated gallery (zoo.py + zoo/ data) with baselines;
  `zoo list|run|validate-all`.
Phase 3 - Failure diagnosis: diagnosis.py with 8 locomotion failure patterns;
  `diagnose` explains why a run failed and suggests fixes.
Phase 4 - Closed-loop control: ObservationSpec/ActionSpec, Gymnasium-style
  CreatureEnv, CPG/PID/pose-sequence controllers; `run --controller`.
Phase 5 - Debug viewer: CoM/root trails, fall marker, side-by-side `compare`,
  and matplotlib `plot`.
Phase 6 - Humanoid kit: humanoid_minimal/humanoid_12dof zoo entries, impulse
  events for push-recovery, 4 biped-specific diagnosis patterns.
Phase 7 - Evolution: typed mutation operators + crossover and four strategies
  (hill_climb, genetic, map_elites, cmaes); `lineage` tree; archive/lineage JSON.
Phase 8 - Bridges: full MJCF export + MuJoCo backend, URDF transmissions,
  best-effort URDF import; `export-mjcf`, `import-urdf`, `run --backend mujoco`.

Re-audit fixes:
- CreatureEnv velocity/torque actions silently applied as POSITION targets, and
  the env could not drive hinges without a MotorSpec. Added
  PyBulletBackend.apply_joint_control (drives any hinge by id, in
  position/velocity/torque); env now uses it. MuJoCo supports position only
  (raises clearly otherwise).
- CI now installs the evolve + mujoco extras so those paths are exercised.
- gitignore MUJOCO_LOG.TXT and *.urdf; fix a FutureWarning/latent bug in URDF
  import (childless-element truthiness).

232 tests pass; ruff check + format clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@iodriller
iodriller merged commit 7681dda into main Jun 23, 2026
1 check passed
@iodriller
iodriller deleted the feat/improvement-plan-phases-0-8 branch June 23, 2026 00:39
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.

1 participant