Skip to content

Shielding

MASA provides tutorials for both risk-budget-based probabilistic shielding and winning-region safety-game shielding.

Winning-region Mini PacMan example

The winning-region safety-game shielding guide explains support-based synthesis and the preemptive and postposed interfaces.

The companion Mini PacMan notebook uses the safety property

\[ \mathbf{G}\neg \mathit{ghost} \]

and compares:

  • mask-aware preemptive action selection;
  • postposed uniform-random replacement of unsafe proposals.

The notebook is a small shielding-interface demonstration rather than a training benchmark or a guarantee of task completion.

Open tutorial/05_minipacman_deterministic_shielding.ipynb

It uses replacement_strategies.random_safe. The replacement random generator is independent of the environment seed.

Probabilistic shielding tutorials

These tutorials show how MASA's probabilistic shielding wrappers turn risk-bound analysis into environment interfaces that reinforcement-learning algorithms can consume.

  • Probabilistic Shielding MiniPacman builds a PCTL-constrained MiniPacman environment, wraps it with ProbShieldWrapperDisc, and inspects safety bounds, successor dynamics, and projected safe actions.
  • Safety Abstractions Pacman Coins shows why structured Pacman coin observations need a discrete safety abstraction before probabilistic shielding can compute safety bounds.
  • FrozenLake Shielding shows how the same discrete shield-synthesis path applies to Gymnasium-style FrozenLake dynamics.

Runnable notebooks: