AGENT SKILL

composer-environments

Create and validate custom dm_control Composer entities, tasks, observables, variations, and Environment loops.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
composer-environments
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Create and validate custom dm_control Composer entities, tasks, observables, variations, and Environment loops.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

composer-environments

Use this sub-skill when a task needs a custom dm_control.composer environment: new Entity subclasses, a Task with lifecycle hooks and rewards, entity or task observables, per-episode randomization, or a composer.Environment reset/step loop.

Do not use this sub-skill for ready-made locomotion, manipulation, or soccer task catalogs; route those to ../locomotion-manipulation/SKILL.md. Route raw MJCF parsing/exporting/model surgery to ../mjcf-mujoco-models/SKILL.md, and Control Suite benchmark loading/wrappers to ../suite-rl-workflows/SKILL.md. If a custom observable renders camera pixels and the error is OpenGL/backend-specific, use ../rendering-viewer-assets/SKILL.md for backend selection.

Prerequisites and safe default

Use an installed dm_control package. Public install commands only:

python -m pip install dm_control
# For unreleased source snapshots only:
python -m pip install git+https://github.com/google-deepmind/dm_control.git

Do not use editable installs; dm_control does not support editable mode. Composer model construction and non-rendering reset/step loops are CPU workflows. Camera observables are rendering workflows and need a separately validated OpenGL backend.

First decisions

  1. Entity structure: implement composer.Entity._build(...), store a mjcf.RootElement or attached model, return it from mjcf_model, and return a composer.Observables subclass from _build_observables() when the entity exposes observations.
  2. Task contract: implement root_entity, get_reward(physics), optional task_observables, optional termination/discount/spec methods, and lifecycle hooks only where needed.
  3. Timing: set physics_timestep and control_timestep through Task.set_timesteps(...) or the task properties. Ensure the control timestep is an integer multiple of the physics timestep.
  4. Environment options: choose random_state, time_limit, max_reset_attempts, recompilation behavior, observation buffer shape options, and physics error policy before training.
  5. Validation before training: instantiate the task, create composer.Environment, run reset() and several step(action) calls with actions from action_spec(), verify observation keys/shapes against observation_spec(), confirm reward/discount/termination behavior, and exercise any stochastic episode initialization with fixed seeds.

Bundled operating files

  • Read references/composer-api-reference.md when implementing Composer class contracts, lifecycle hooks, environment options, observable key qualification, random-state handling, or recompilation behavior.
  • Read references/observables-and-variation.md when configuring enabled observables, buffers, delays, aggregators, corruptors, @composer.observable, or variation/distribution/noise randomizers.
  • Read references/troubleshooting.md when abstract method errors, missing mjcf_model/root_entity, bad observable keys, dead physics proxies, reset retry failures, or action-shape mismatches appear.
  • Run scripts/composer_minimal_task.py to smoke-test an installed-package Composer entity/task/environment loop and inspect action specs, observation specs, fully qualified keys, hook counts, and short rollout behavior.

Minimal validation command

From this sub-skill directory:

python scripts/composer_minimal_task.py --steps 5 --seed 7

Expected signal: the script prints one bounded action spec, observation specs containing a task-level key and entity-qualified keys, a control_timestep, a physics_steps_per_control_step, several successful step lines, and hook counts consistent with the configured number of physics substeps. If this smoke fails, fix import/install or core Composer construction before using the custom environment for training.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351