Shield-Certified Progress: Dense Rewards from a Real-Time Safety Filter in Moving-Obstacle Worlds

A robot learning by trial and error on a long task, say reaching a goal on the far side of two sliding gates, faces two problems at once. It must never collide during learning, and it gets almost no feedback, because reward arrives only on success. Methods for safe learning usually attach a "shield," a fast optimizer that checks each proposed action a few steps ahead and replaces it if it would lead to a collision. Methods for sparse reward usually add hand-designed intermediate rewards or subgoals. This proposal notices that the shield already computes something the reward problem needs. To certify safety, it solves a small constrained reachability problem at every step: can the robot get somewhere safe within a few steps, given where obstacles will be? Asked slightly differently, the same optimizer can report how soon the robot can safely reach the next doorway or gate at the current moment. That number is a time-aware, safety-aware measure of progress, and it can be turned into a dense reward that provably leaves the optimal policy unchanged.

Concretely, we extend a Koopman-linearized multi-step shield to moving obstacles while keeping it a convex quadratic program that runs within the control loop. We then use its feasibility answers, computed off the control loop on logged data, as a progress potential over a static bottleneck graph whose edges open and close in time. The goal is a learner that stays collision-free in dynamic scenes, stays within millisecond control budgets, and still solves sparse-reward tasks where both a plain shield and distance-based shaping stall.

Core Claim

The claim is that in dynamic environments with sparse terminal rewards, the most informative dense signal is the shield's own answer to "what is the minimum number of steps in which I can safely reach the next bottleneck, starting now?" This signal beats geometric distance and static subgoals because it accounts for moving obstacles and timing, for example waiting for a gate. It beats barrier-style rewards because it points toward the goal instead of toward the middle of the safe region. It also costs no extra control-loop time, since the shaping reward is computed after the fact from the replay buffer using recorded obstacle trajectories. Only the safety filter itself has to meet the real-time deadline.

What Prior Work Gives and Leaves Open

Three shielding lines frame the gap. Dynamic Model Predictive Shielding (DMPS) handles moving obstacles and gates without freezing. It plans recovery maneuvers with a continuous Monte Carlo tree search scored by the policy's learned task value. The authors acknowledge substantial computational latency, and under sparse reward that learned value carries almost no information early in training. Robust Adaptive Multi-Step Predictive Shielding (RAMPS) supplies our method. It learns a Koopman model, meaning a lifting of nonlinear dynamics into a space where they evolve linearly. Over that model it imposes multi-step control barrier constraints (conditions that keep a safety margin from shrinking too fast) and solves the result as a quadratic program in under 0.51 ms. It tightens constraints using empirical error tubes, in the spirit of tube-based Koopman MPC. RAMPS was evaluated only against stationary constraints on dense locomotion tasks. Kiel et al. run in real time around moving obstacles, using 8–18% of the control step, but switch hard between the task policy and an evasive policy and optimize dense tracking rewards. Lubars et al. likewise pair RL with an MPC supervisor under an engineered dense reward.

Two papers motivate the dynamic extension. Schmerling et al. show that safety certificates computed for static scenes evaporate once agents move. Janson et al. argue that planners must reason about obstacle trajectory distributions rather than treat obstacles as frozen boxes. On the reward side, BASS supplies the subgoal structure. It finds bottlenecks by spectral clustering of offline data and plans over a keypoint graph. It explicitly leaves dynamic topology, such as doors opening and closing, unsolved. Barrier-function reward shaping constrains the design: its reward $\dot h + \gamma h$ encodes only distance from boundaries. With no dense task term it pulls the agent toward the interior of the safe set, which is the "safe but useless" behavior Li et al. document for heavy safety penalties. Vector-field frontier shaping likewise shows that safety-derived shaping can make an agent park at a boundary. That result warns us that the shaping must be goal-directed.

Mechanism

We keep the robot's position among the Koopman observables so obstacle constraints remain expressible in the lifted linear model. Each moving obstacle $j$ has a predicted position $o_j(t+k)$ for $k = 1,\dots,H$, from a constant-velocity or learned predictor with empirically calibrated error radius $\rho_k$. Excluding a moving disc is non-convex, which is the trade-off Wang et al. describe between collision-model fidelity and solve speed. We convexify it the way sequential convex MPC does. Around the previous step's warm-start trajectory $\bar p_{t+k}$, each obstacle is replaced by the separating half-space

$$n_{jk}^\top \big(p_{t+k} - o_j(t+k)\big) \ge r_j + \rho_k + \epsilon_k,$$

where $p_{t+k}$ is the predicted robot position, $n_{jk}$ is the unit vector from $o_j(t+k)$ to $\bar p_{t+k}$, $r_j$ is the obstacle radius, and $\epsilon_k$ is the RAMPS-style Koopman error tube at step $k$. This constraint is conservative, since it only removes feasible space. The shield therefore stays a convex quadratic program with $H \times$(number of nearby obstacles) extra linear rows, and it minimally modifies the policy's action rather than switching to an evasive policy.

For shaping, fix the static keypoint graph built by BASS from the walls alone, and let $D(\kappa)$ be the graph distance from keypoint $\kappa$ to the goal. Moving gates and obstacles do not change the nodes; they change when an edge can be crossed. For logged state $s$ at time $t$ with next keypoint $\kappa$, we solve a family of feasibility programs. Each is the same convex program with a terminal constraint "within radius of $\kappa$ at step $\tau$," evaluated for $\tau$ on a small grid up to $\tau_{\max}$. Let $T^\star(s,t)$ be the smallest feasible $\tau$, or $\tau_{\max}+c$ if none is feasible. The potential is

$$\Phi(s,t) = -\big(T^\star(s,t) + D(\kappa)\big),$$

and the shaping reward is $\gamma\Phi(s',t+1) - \Phi(s,t)$. Treating time, or the obstacle phase, as part of the state, this is potential-based shaping and preserves the optimal policy of the sparse task. That property addresses the policy-distortion concern that dogs heuristic densification. If a gate will open in eight steps, $T^\star$ correctly rewards waiting in front of it, which Euclidean distance cannot do. Because $\Phi$ is computed from recorded obstacle trajectories during replay, it can use the true future obstacle motion in simulation or on logged hardware data. The shield at execution time uses only predictions.

Research Program

The work has three parts. The first is building and verifying the moving-obstacle convex shield. We measure its worst-case solve time, violation rate under prediction error, and conservatism, the fraction of truly feasible states it rejects. We compare it against RAMPS on RAMPS's own static tasks to confirm it does not regress. The second is the certified-progress potential and its integration with an off-policy learner (SAC), with the potential computed asynchronously on replay batches. The third is analysis. We separate what the time-awareness of $T^\star$ contributes from what the keypoint graph contributes. We also characterize when conservative half-space convexification makes $\Phi$ pessimistic enough to hide real routes, for instance crowded scenes where a warm-start on the wrong side of an obstacle blocks the correct gap. A secondary question is cold start. Since RAMPS accumulates violations before its Koopman model matures, we pretrain the lifting on random safe-by-construction motion in open space before task learning. We report violations from step zero.

Baselines

The naive reference point is SAC on the sparse task with a large collision penalty and no shield. It shows how often sparse-reward learning succeeds at all and how many collisions it incurs. Next is SAC with our dynamic shield but no shaping. This is the "do nothing on the reward side" point, and it tests whether safe learning alone solves the task.

The strongest existing method in the dynamic setting is DMPS, run on its own 13-scenario suite with the authors' configuration. We give it identical environment steps and the same hyperparameter search budget (the same number of seeds and trials for every method). We run it twice: with its original dense reward, to reproduce its published regime, and with our sparse reward, which is the fair comparison. The reported numbers are that DMPS intervenes 76% less often than standard model predictive shielding and gets 29% higher episodic return, with zero violations in evaluation (DMPS). Beating it means higher sparse-task success with no more training violations, at control-loop latency at least an order of magnitude lower, measured on the same CPU.

The strongest real-time shield is RAMPS, reported at 11 violations over a million SafeHumanoid steps versus 319 for SauteRL and 172 for CUP, in under 0.51 ms per step (RAMPS). We run it unmodified in the moving-obstacle tasks to show where static constraints fail. The sparse-reward strongest baseline is BASS keypoint guidance, reported at 96.5% average AntMaze success against a previous best of 82.3% (BASS). We run it with our shield and its static keypoint graph, with no time-varying edge check. Barrier-function shaping (Nilaksh et al.) is added to the shielded learner with its grid-searched scales under the shared budget. For simulation-only safety comparison we include FDPI (Breaking Safety Paradox), reported as achieving near-zero violations across 14 Safety-Gymnasium environments. We note that it deliberately collects violations and so is not a hardware candidate.

Two ablations isolate the key ingredient. In the first, the potential uses straight-line distance to the next keypoint instead of $T^\star$, which keeps the graph but drops timing and obstacle awareness. In the second, $T^\star$ comes from the predicted rather than recorded obstacle trajectories. No reported result found on Lacuna for any of these methods on sparse-reward, moving-obstacle versions of these tasks, so those numbers are what this work produces.

Why not just…?

Why not just add distance-to-goal potential shaping on top of the shield? This is the most serious threat. In open scenes with few moving obstacles it may match our method at a fraction of the cost. It fails when geometric progress is deceptive: gates that are closed now, and corridors where the straight line runs into a wall or into an oncoming obstacle. The first ablation above is exactly this comparison, run with and without the keypoint graph. We commit to reporting environments where it ties. If it ties everywhere, including double-gate scenarios, the time-aware potential is not worth its cost and the paper's claim is false.

Why not just use BASS keypoints as fixed subgoals? BASS's authors themselves list dynamic topology as open. A static graph sends the agent toward a bottleneck that may be blocked at that moment, and the sparse reward gives no signal to wait or reroute. Our comparison keeps the graph identical and changes only whether edge availability is checked in time. Any gap is attributable to that check.

Why not just use DMPS, which already handles moving gates? DMPS scores recovery plans with the policy's own value estimate, which is flat under sparse reward before the first success. Its tree search also carries latency that its authors flag. Running DMPS in the sparse variant tests the first point, and per-step wall-clock timing on identical hardware tests the second.

Why not just penalize collisions heavily, or use hindsight relabeling? Heavy penalties produce frozen, safe-but-useless agents (Li et al.) and do not bound training-time collisions. Hindsight relabeling in the style of HAL turns failures into successes for other goals, but it does not tell the agent when a moving gate is passable. It is complementary, so we also run SAC with hindsight relabeling plus our shield. If hindsight relabeling alone closes the gap, we will report it as the simpler answer.

Proposed Experiments

The environments are the DMPS suite converted to sparse reward (+1 on reaching the goal, 0 otherwise), with both differential-drive and double-integrator kinematics. We also use Safety-Gymnasium Point and Car Goal tasks (Safety Gymnasium) with hazards given periodic and stochastic motion and the dense distance reward removed. Finally, AntMaze with doors that open and close on a schedule, so the BASS comparison lives on its home ground. Metrics are final and learning-curve success rate, cumulative training-time violations counted from the first step, shield intervention rate, and worst-case and median shield solve time. For the shaping computation we report both throughput and the fraction of replay samples it covers. We use ten seeds per method.

The decisive checks are three. First, in the double-gate and timed-door scenarios, certified-progress shaping must beat straight-line keypoint shaping and static BASS subgoals on success rate while matching the unshaped shield's violation count; otherwise the core claim fails. Second, worst-case shield latency must stay within a 1 ms budget with the obstacle rows added, as the RAMPS figure suggests is possible, while DMPS on the same hardware is timed for contrast. Third, under deliberately biased obstacle predictions, violations must degrade gracefully as the calibrated error radius grows, and we measure how conservative the half-space convexification becomes in crowded scenes. If conservatism erases the reward advantage in dense crowds, we report that as the regime boundary of the method. As a hardware stretch, the manipulator moving-obstacle setup of Kiel et al. would test whether the shield's smooth action modification removes the jerky switching they report, at a comparable fraction of the control step.