grid-world-dp-and-control
Use and adapt GridWorld dynamic programming, tabular control, Deep SARSA, and REINFORCE workflows distilled from the reinforcement-learning examples.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- grid-world-dp-and-control
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use and adapt GridWorld dynamic programming, tabular control, Deep SARSA, and REINFORCE workflows distilled from the reinforcement-learning examples.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/algorithm-guide.md11.6 KB
- 参考文档references/troubleshooting.md8.4 KB
- 脚本scripts/grid_world_smoke.py23.3 KB
03 SKILL.md 正文
GridWorld DP and Control
Use this sub-skill when the task is about the repository's 5x5 GridWorld workflows: policy iteration, value iteration, tabular SARSA, tabular Q-learning, Deep SARSA, or REINFORCE. It is self-contained; do not depend on the original checkout at runtime.
Route here for
- Explaining, adapting, or debugging GridWorld dynamic programming (
1-policy_iteration.py,2-value_iteration.py) as provenance workflow labels. - Explaining, adapting, or debugging tabular control (
3-sarsa.py,4-q_learning.py) as provenance workflow labels. - Making tiny CPU checks for Deep SARSA and REINFORCE neural update logic (
5-deep_sarsa.py,6-reinforce.py) as provenance workflow labels. - Diagnosing row/column versus column/row coordinate mistakes, action-order mismatches, and render/headless behavior.
Route away from
- Gymnasium CartPole DQN/A2C/PPO: use the CartPole sub-skill.
- Atari Breakout/Pong DQN/PPO, preprocessing, ROMs, or W&B: use the standard Atari sub-skill.
- Montezuma/Pitfall/PrivateEye hard-exploration, RND, Go-Explore, or robustification: use the hard Atari sub-skill.
Start here
- Read
references/algorithm-guide.mdfor the MDP layout, coordinate conventions, formulas, API-shaped examples, and safe adaptation patterns. - Read
references/troubleshooting.mdwhen a grid policy points in the wrong direction, rendering blocks on a server, tabular values do not update, or Torch neural checks fail. - Run the bundled smoke script when you need a self-contained, non-rendering API check:
python scripts/grid_world_smoke.py --help
python scripts/grid_world_smoke.py
python scripts/grid_world_smoke.py --section dp
python scripts/grid_world_smoke.py --section neural --strict-torch
The smoke script intentionally reimplements tiny fixtures and update steps. It does not import source repository files, open Pygame, train to convergence, or require a display.
Critical facts to preserve
- DP workflows use state as
[row, col]; drawing helpers usually need(col, row), so swap before rendering arrows or markers. - Tabular
Env-style workflows use state as[col, row]and actions0=up, 1=down, 2=left, 3=right. - Dynamic
DynamicEnv-style workflows also use[col, row], but actions are0=up, 1=down, 2=right, 3=left; the distilled source agents expose a fifth network output/action that behaves as a no-op in the dynamic environment. - GUI examples are interactive and render-oriented. For validation or CI, use headless logic equivalent to
render_mode=Nonerather than opening Pygame loops.
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).