smarts
Use SMARTS 2.0.1 for multi-agent autonomous-driving simulation, Gymnasium environments, scenario generation, sensor and Envision workflows, agent-zoo/RL integration, and the scl command-line tools.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- smarts
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use SMARTS 2.0.1 for multi-agent autonomous-driving simulation, Gymnasium environments, scenario generation, sensor and Envision workflows, agent-zoo/RL integration, and the scl command-line tools.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/repo-provenance.md2.0 KB
- 参考文档references/repo-routing-metadata.json509 B
- 参考文档references/troubleshooting.md4.7 KB
- 脚本scripts/check_smarts_install.py4.1 KB
03 SKILL.md 正文
SMARTS
Use this repo skill when the task involves SMARTS (Scalable Multi-Agent
Reinforcement Learning Training School), autonomous-driving simulation,
scenario maps and traffic, multi-agent Gymnasium environments, agent policies,
road/sensor observations, Envision replay, or the scl CLI.
Operating contract
- Identify the workflow before acting: environment lifecycle, scenario authoring, sensors/visualization, policy/RL/agent-zoo packaging, or CLI and external integrations.
- Read the owning sub-skill and its linked references before writing code or commands. Keep paths to scenarios, models, records, and outputs explicit; do not assume a SMARTS source checkout.
- Start with read-only import, signature, and CLI-help checks. Build or clean scenario artifacts, launch services, install optional stacks, and run training/benchmarks only after the user explicitly needs that operation and its inputs are validated.
- Treat the core baseline as CPU-verified. Camera/Panda3D, Envision service, SUMO/TraCI, Ray/RLlib, Torch/TensorFlow, ROS, Waymo, Argoverse, Visdom, and downloaded datasets are optional capability boundaries; never infer their runtime success from a base import.
- Keep a bounded run and deterministic seed for smoke tests. Close every environment/service/client that the task starts.
Install and verify
For the core Python API:
python -m pip install "smarts"
python -c "import smarts; print('SMARTS import OK')"
Add only the extras required by the workflow:
python -m pip install "smarts[gymnasium]" # Gymnasium environments
python -m pip install "smarts[camera-obs]" # camera/grid/Panda3D paths
python -m pip install "smarts[envision]" # Envision client/server path
python -m pip install "smarts[sumo]" # SUMO-backed traffic/maps
python -m pip install "smarts[ray,rllib]" # optional Ray/RLlib stack
The exact extra names and compatible versions can change; inspect installed
metadata and run the shared diagnostic before relying on an optional branch:
scripts/check_smarts_install.py. The
prepared baseline verified package smarts 2.0.1, core imports, Gymnasium,
OpenDRIVE, Envision/Panda3D imports, and scl help on Python 3.11. It did not
verify external SUMO/ROS/Waymo/Argoverse services or RL training stacks.
Route the task
| User intent | Read first | Typical deliverable |
|---|---|---|
| Create/reset/step a single or multi-agent simulator, configure interfaces, observations, actions, rewards, or controllers | simulation-environments |
Bounded HiWayEnvV1/parallel environment loop and policy contract |
| Define maps, traffic, missions, social actors, bubbles, friction, or replay histories; generate or validate scenario assets | scenario-studio |
smarts.sstudio DSL, deterministic generation, layout validation |
| Add lidar, grid/RGB/occlusion/signal sensors, camera rendering, Envision recording, or replay | sensors-visualization |
Sensor interface, renderer/service probe, record inspection |
Implement a policy, AgentSpec, locator, social agent, bubble, RLlib adapter, or benchmark inference package |
rl-agent-zoo |
Importable/versioned agent package and optional RL integration plan |
Use scl, diagnostics, scenario build/clean, benchmarks, zoo commands, SUMO/TraCI, Waymo, OpenDRIVE, or ROS boundaries |
cli-integrations |
Safe command plan, prerequisite probe, and recovery steps |
Cross-route handoffs are deliberate: scenario-studio owns authoring while
cli-integrations owns scl scenario build; simulation-environments owns the
reset/step contract while sensors-visualization owns rendered observation
prerequisites; rl-agent-zoo owns policies while CLI owns zoo/benchmark commands.
Core safety rules
- A scenario must already have the generated map/traffic artifacts before a core environment smoke. Use scenario-studio and then the CLI route to build it; do not silently substitute a different map.
- In multi-agent mode, observations and actions contain only currently active
agents. An empty active-agent dictionary can be a valid intermediate state;
keep stepping with
{}until the global done flag or the bound is reached. - Match policy outputs to
env.action_space[agent_id]; do not guess action tuples from an interface name. Usespace.contains(action)when debugging. - Use
headless=Truefor CPU checks. Image observations can require the camera extra and a display/offscreen backend, and can dominate step time. scl --help,scl scenario --help, andscl run --helpare safe first checks.--clean,--auto-install, server startup, benchmark execution, and external-service commands have side effects or trust boundaries.
Read references/troubleshooting.md for
cross-cutting installation, optional-extra, path/configuration, port, and
lifecycle failures. Read references/repo-provenance.md
before deciding whether this graph is stale for another SMARTS checkout.
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).