Letting the Safety Filter Decide When to Switch Modes: Feasibility-Triggered Replanning for Hybrid-Action Diffusion Planners

Many robots and vehicles act through a menu of discrete maneuvers, each with continuous settings. A car picks "change lane left" and an acceleration. A parking agent picks "curve right" and a travel distance. When something changes mid-execution, such as an obstacle moving into the path, the agent faces two kinds of repair. It can adjust the continuous settings and keep the same maneuver sequence, or it can abandon that sequence and choose different maneuvers. This note proposes a planner that makes this choice through the safety check itself. A diffusion model (a generator that turns random noise into samples by gradually denoising it) proposes multi-step plans made of discrete maneuvers and continuous parameters. When the world changes, we first try to repair only the continuous parameters with a small constrained optimization that enforces a safety barrier. If that optimization has no solution, the infeasibility shows that no safe plan exists with the current maneuver sequence. Only then do we resample the discrete sequence.

This matters because the two existing ways of combining diffusion planning with online change each miss half of the problem. One triggers replanning when the model's own likelihood of the plan drops. That signal tracks how unusual the plan looks, not whether it is safe. The other projects plans onto a safe set, but only once, before execution, and only over continuous variables. Our claim is that for parameterized actions, the safety projection and the replanning trigger should be the same object. Its failure should mark exactly the moments when the agent must commit to a different discrete maneuver sequence. The expected payoff is safe, low-latency adaptation that does not oscillate between plans.

Core Claim

Consider a planner over a hybrid trajectory with horizon $T$, $\tau = (d_{1:T}, x_{1:T})$, where $d_t$ is a discrete maneuver and $x_t$ its continuous parameter vector. We factor generation into two stages. First, a discrete (masked-token) diffusion model samples the maneuver sequence $d_{1:T}$. Second, a continuous diffusion model samples the parameters $x_{1:T}$ conditioned on that sequence. At execution time, suppose the environment shifts or the robot drifts from its plan. We then keep $d_{1:T}$ fixed and solve

$$x^\star = \arg\min_{x} \|x - \hat{x}\|^2 \quad \text{s.t.} \quad \dot h_j(s_t) + \alpha\, h_j(s_t) \ge 0 \;\; \forall j, t, \qquad s_{t+1} = A_{d_t} s_t + B_{d_t} x_t,$$

where the terms are as follows. $\hat{x}$ is the parameter plan warm-started by the diffusion model after a few denoising steps. Each $h_j$ is a barrier function whose positive region is the safe set for constraint $j$; $\dot h_j$ is its rate of change along the predicted trajectory, and $\alpha$ is a positive gain. $A_{d_t}, B_{d_t}$ are the maneuver-specific dynamics, linearized around the current plan.

Because the discrete sequence is fixed, this is a quadratic program (an optimization with a quadratic objective and linear constraints) and is cheap to solve. If it is feasible, the agent executes $x^\star$ and keeps its maneuver commitment. If it is infeasible, we resample the maneuver sequence from the discrete model, conditioned on the new state, and repeat.

We hypothesize three consequences. Safety violations during adaptation should approach zero wherever the linearization is accurate. Plan switching should become rare and meaningful. And compute should concentrate on the few moments that actually need a new discrete decision.

Relation to Prior Work

Two papers supply the mechanisms we reuse, and both leave the combination open. SafeDiffuser solves a barrier-constrained quadratic program at each denoising step, so that continuous diffusion plans stay inside a safe set. On Maze2D Large it reports near-100% constraint satisfaction with a task score of about 1.5, while classifier guidance collapsed to about 0.38. It works only over continuous waypoints, and it plans once before execution. We borrow its projection. We apply it at execution time, to parameters under a fixed discrete sequence, and we read its infeasibility as a signal.

Adaptive Online Replanning with Diffusion Models (RDM) triggers replanning from the diffusion model's likelihood. It chooses between re-noising the remaining plan and replanning from scratch, and it reports a 38% gain over Diffuser on Maze2D and 77.3% success on RLBench. Its trigger is not safety-aware, and it has no notion of discrete maneuvers. We keep its two-tier repair structure. We replace its trigger with feasibility, and we map its tiers onto parameter repair and maneuver resampling.

A second group of papers motivates the hybrid structure. HyAR embeds hybrid actions into a continuous latent space so that continuous RL can optimize them. Hybrid Actor-Critic (H-PPO) uses separate discrete and continuous actor heads; it reports 90.45% success on Moving against 1.56% for P-DQN. CHPO adds cost constraints by switching between maximizing reward and minimizing cost, reporting a Parking reward of 37.63 against 20.01 for HPPO-Lag at cost at most 1. PASAC-PIDLag applies hybrid safe RL to lane changing. All four are single-step reactive policies with no look-ahead. They show that discrete-continuous coupling needs explicit modeling, which is why we factor the diffusion model instead of relaxing discrete choices into continuous numbers. They are also our main competitors: if a reactive safe policy matches us, the planning machinery is unnecessary.

One paper constrains the design. Breaking Safety Paradox with Feasible Dual Policy Iteration argues that strictly safe data starves a learner of boundary information. We take this seriously for the online fine-tuning phase, described below. There, infeasible-QP events are logged as labeled near-boundary data, instead of being discarded.

Research Program

The build has three parts.

The first part is the factored hybrid diffusion planner. A masked discrete diffusion model over maneuver tokens (in the spirit of the masked-diffusion fine-tuning in Full-length mRNA Design) is paired with a 1D temporal U-Net over parameters conditioned on the maneuver tokens. This follows Diffusion Policy's receding-horizon execution. We train it offline on trajectories from H-PPO and CHPO policies with injected noise, so the data contains several ways of solving each task.

The second part is the execution-time repair loop. At every control step we compute barrier values on the predicted state trajectory. If any becomes negative within the horizon, we run a few warm-started denoising steps on the parameters and then the fixed-sequence quadratic program. Infeasibility triggers maneuver resampling: we draw $K$ sequences, run the quadratic program on each in parallel, and execute the feasible one with the highest predicted return. If none is feasible, the agent falls back to a designated safe maneuver, such as braking or stopping.

The third part is a short online fine-tuning phase framed as safe exploration. Only certified plans are executed. The planner is updated on its own executed trajectories, and QP-infeasible states are logged as boundary examples.

The central analysis asks when feasibility is a correct trigger. We will measure false negatives: cases where the quadratic program is feasible under the linearized dynamics, but the true dynamics violate a constraint. We will also measure false positives: cases where the program is infeasible, yet a safe plan with the same maneuvers existed under the nonlinear dynamics. Both will be measured as a function of disturbance size. This analysis tells us where the method's guarantee actually holds.

Baselines

The naive reference is the factored hybrid diffusion planner with no safety repair, replanned at a fixed interval. It shows what diffusion alone achieves under disturbances. It receives the same model, the same data, and the same number of denoising steps per control step on average.

The strongest existing method for safe hybrid control is CHPO, which reports a Parking reward of 37.63 at cost at most 1 in static environments. We will retrain it on our disturbed variants with its published configuration and a matched hyperparameter search budget. It will receive at least as many environment interactions as our offline data plus fine-tuning combined. There is no reported result on Lacuna for CHPO under mid-episode obstacle motion. For lane changing we will compare against PASAC-PIDLag, which reports 0% collisions at 15 veh/km and 0.75% at 18 veh/km in SUMO. We will reproduce these static numbers before adding disturbances. Beating these baselines means lower cumulative cost during adaptation episodes at equal or higher task reward, with non-overlapping confidence intervals over at least ten seeds.

The strongest planning-side baseline is RDM with likelihood triggering, adapted to our factored model, with a SafeDiffuser projection applied once at plan time. This is the direct combination of the two closest works. We tune its likelihood threshold on a validation split with the same budget we use for our barrier gain $\alpha$.

Two ablations isolate the key ingredient. The first uses the likelihood trigger with our quadratic-program repair, which tests whether feasibility is the better trigger. The second resamples both maneuvers and parameters at every trigger, which tests whether preserving maneuver commitment is what reduces oscillation.

Why not just…?

Why not just sample many hybrid plans and keep the first one a safety checker accepts? Rejection sampling from the diffusion model is simple and is our most serious threat. When disturbances are small, the diffusion model probably produces many feasible samples, and filtering may match us. Our argument is that under larger disturbances, most samples miss the safe set by small margins. A projection turns those near-misses into feasible plans, while a filter must keep drawing samples. We will settle this by comparing both at matched wall-clock compute per control step, sweeping the number of samples $K$ and the disturbance size. If filtering matches our method across the sweep, the projection is not earning its place. In that case we will reframe the contribution around the feasibility trigger alone, which rejection sampling cannot supply.

Why not just use a reactive safe hybrid policy like CHPO and skip planning? CHPO satisfies cost limits in static tasks, but it acts one step at a time with no look-ahead. A moving obstacle may require committing early to a different maneuver, such as changing lanes before the gap closes. A one-step policy only notices this once the cost begins to rise. The CHPO baseline tests this directly. If CHPO matches us in the disturbed tasks, look-ahead is not needed in these domains, and we will report that.

Why not just treat the maneuver choice as a continuous number and use SafeDiffuser as is? Relaxing discrete choices produces intermediate values with no physical meaning. The hybrid-action literature (HyAR, H-PPO) motivates explicit modeling of the coupling instead. A barrier projection over a relaxed maneuver variable would move it toward values that have no meaning. We will still run this relaxed variant, rounding to the nearest maneuver after projection, so the claim rests on measurement and not on argument.

Why not just use fixed-interval receding-horizon replanning? RDM already reports that likelihood-triggered replanning beats fixed replanning of Diffuser by 38% on Maze2D, attributing the difference partly to plan-switching oscillation. Our naive baseline covers this case, and we additionally count maneuver switches per episode.

Proposed Experiments

The testbeds are DI-engine Moving, Sliding, and Parking, and SUMO discretionary lane change. In Moving, Sliding, and Parking, the danger zones are circles and the barrier functions are analytic. We modify these tasks so that zones move to random new positions mid-episode, at controlled speeds. For lane change, the discrete maneuver is the lane and the continuous parameter is acceleration, with a time-to-collision barrier set at the 2.7 s threshold used by PASAC-PIDLag. We raise traffic density from 15 to 18 veh/km and inject sudden cut-ins.

The metrics are task reward or success, cumulative cost during adaptation windows, collision rate, maneuver switches per episode, and control-step latency. For the fine-tuning phase we also report the number of violations accumulated during training, which is the actual safe-exploration measure.

Three checks are decisive. First, against the RDM-plus-SafeDiffuser baseline, our method should cut adaptation-window cost substantially at no loss of reward. Most of this gain should disappear in the likelihood-trigger ablation. If it does not, feasibility triggering is not the reason for the improvement. Second, maneuver switches per episode should be lower than under full resampling, at equal safety. Third, the false-negative rate of the linearized feasibility check should stay low up to a disturbance size we can report. Beyond that size, we will state plainly that the certificate stops being meaningful.