highway-env
Use Farama HighwayEnv for Gymnasium autonomous-driving environments, simulation configuration, road/vehicle dynamics, and bounded RL rollouts.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- highway-env
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use Farama HighwayEnv for Gymnasium autonomous-driving environments, simulation configuration, road/vehicle dynamics, and bounded RL rollouts.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/environment-catalog.md4.8 KB
- 参考文档references/installation-and-smoke.md3.3 KB
- 参考文档references/repo-provenance.md2.5 KB
- 参考文档references/repo-routing-metadata.json438 B
- 参考文档references/troubleshooting.md4.4 KB
- 脚本scripts/check_highway_env_install.py5.8 KB
03 SKILL.md 正文
HighwayEnv repo skill
Use this repo skill when a task involves highway-env / HighwayEnv autonomous-driving simulation environments: creating Gymnasium envs, choosing scenario IDs, configuring observations/actions/rewards, rendering or recording rollouts, building custom road/vehicle scenarios, or preparing safe reinforcement-learning smoke tests.
HighwayEnv is a Python package named highway-env with import package highway_env. It registers Gymnasium environments for highway, merge, roundabout, parking, intersection, racetrack, lane-keeping, two-way, exit, and U-turn driving tasks.
Fast start
import gymnasium as gym
import highway_env
gym.register_envs(highway_env) # idempotent and useful for tools/linters
env = gym.make("highway-v0", config={"duration": 5, "vehicles_count": 10})
try:
obs, info = env.reset(seed=0)
terminated = truncated = False
while not (terminated or truncated):
obs, reward, terminated, truncated, info = env.step(env.action_space.sample())
finally:
env.close()
If the package or environment lookup is suspect, run scripts/check_highway_env_install.py. It imports the package, lists registered HighwayEnv IDs, makes a selected env, runs a bounded sampled-action rollout, and can optionally check rgb_array rendering.
Route map
- Read sub-skills/simulation-environments/SKILL.md for built-in environment IDs,
gym.make, registration, reset/step/close loops, config update timing, render modes, vectorization, multi-agent wrappers, and finite-MDP helpers. - Read sub-skills/observations-actions-rewards/SKILL.md for
config={...}dictionaries that change observation spaces, action spaces, reward components, goal observations,infofields, or action availability. - Read sub-skills/road-vehicle-dynamics/SKILL.md for
RoadNetwork, lanes, roads, vehicles, controllers, behaviour models, obstacles/landmarks, connected-lane neighbour detection, and custom environment classes. - Read sub-skills/training-and-evaluation/SKILL.md for bounded random-policy rollouts, Stable-Baselines3/Torch/rl-agents optional integration, vectorized training skeletons, policy evaluation, videos, and long-run safety limits.
Root references
- Read references/installation-and-smoke.md when installing, verifying imports, selecting a smoke-check command, or separating package dependencies from optional RL dependencies.
- Read references/environment-catalog.md when choosing a built-in environment family, version suffix, action style, or common configuration knobs.
- Read references/troubleshooting.md for cross-cutting install/import, registration, headless rendering, optional dependency, config, and long-run failures.
- Read references/repo-provenance.md to check the source version, commit, tag, evidence baseline, and refresh triggers for this generated skill.
references/repo-routing-metadata.jsoncontains managed router placement metadata for DisCo's repo-skill library.
Operating guardrails
- Import
highway_envbeforegym.make("highway-v0"); direct Gymnasium lookup can fail if environments were not registered in the current process. - Use current Gymnasium signatures:
obs, info = env.reset(...)andobs, reward, terminated, truncated, info = env.step(action). - Use bounded loops in automation. Do not copy examples with
while Trueunless an external runner imposes a hard timeout. - Use
render_mode="rgb_array"for headless frame capture. Userender_mode="human"only for local interactive viewing. - Treat Stable-Baselines3, Torch, rl-agents, old baselines/HER stacks, display servers, and Colab helpers as optional project dependencies, not as dependencies installed by
highway-env. - Do not depend on the original repository checkout for runtime work. The bundled references and scripts in this skill are the reusable operating context.
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).