extension-and-control
This skill guides users through IR-SIM registry extensions, external state ownership, and keyboard or Matplotlib control integration.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- extension-and-control
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- This skill guides users through IR-SIM registry extensions, external state ownership, and keyboard or Matplotlib control integration.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/custom-behaviors.md8.9 KB
- 参考文档references/external-control.md5.6 KB
- 参考文档references/gui-control.md4.4 KB
- 参考文档references/troubleshooting.md6.3 KB
- 脚本scripts/custom_behavior_smoke.py5.0 KB
03 SKILL.md 正文
Extension and control
Use this route when a task involves a custom individual or group behavior, kinematics or map-generator registration, an external state owner, keyboard or mouse input, or a controller boundary such as a CBF/QP wrapper. Keep ordinary YAML scene authoring in scene-configuration, the simulation lifecycle in simulation-environments, sensor/map consumption in sensing-and-mapping, and built-in behavior or planner selection in navigation-and-planning.
Start safely
-
Install the base distribution and verify the import before adding optional input or solver packages:
python -m pip install ir-sim python -c "import irsim; print(irsim.__version__)" -
Decide who owns state. Use normal
internalstepping for IR-SIM kinematics, behaviors, or an action supplied toenv.step(action). Useexternalstepping when another simulator/controller supplies every object's state and velocity; follow the external sequence. -
Load custom behavior modules explicitly with
env.load_behavior("module_name")after the module is importable onsys.path. The loader reinitializes registered individual and group class handlers; it does not make a file importable by filename alone. -
Run the bundled, headless registration check from the sub-skill directory:
python scripts/custom_behavior_smoke.pyIt uses process-local registries and in-memory fixtures; it does not open a GUI or require
pynput,pyrvo, or a QP solver. Check its parser without running it withpython scripts/custom_behavior_smoke.py --help.
Choose the extension contract
- Per-object, group, stateful, or map/kinematics registration: read custom behaviors and registries.
- Caller-supplied states, velocity ownership, refresh ordering, or CBF/QP integration boundaries: read external control.
- Interactive keyboard, MPL fallback, mouse zoom/clicks, and headless limits: read GUI control.
- Import, duplicate-key, dimension, stale-cache, and backend recovery: read troubleshooting.
Non-negotiable checks
- Registry keys are exact
(kinematics, name)pairs. Register the behavior for the kinematics used by the YAML object and return an action with that kinematics' action dimension; a behavior name alone is not portable. - Do not register over a built-in or previously imported custom key. The
behavior decorators reject duplicate keys with
ValueError; kinematics registration also rejects a different class under the same normalized key. Use an isolated process or unique test names for experiments. - A custom map generator must be imported before the YAML map is built. Its
non-empty
name,yaml_param_names, constructor, and_build_grid()define the YAML-facing contract; the framework injects gridwidthandheightand computes them fromresolution. - In external mode, update state and velocity, then call
env.step()with no action. Do not mixenv.step(action=...)with external state ownership. Useenv.refresh()when a direct state mutation must be observable before a step; never mutate private state fields as a shortcut. - Treat live keyboard input, OS global hooks, and external CBF/QP solvers as integration surfaces. Validate their mocked/headless paths first and report optional or unverified dependencies rather than claiming a live test.
The helper and references are self-contained runtime material. The source checkout, usage scripts, native tests, and private inspection environment are evidence only and are not runtime dependencies.
04 同仓库更多 Skills
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.
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.
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.
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.
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.
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).