MEKAWIRE
ExpertarXiv

CS-Pi: Constraint-Satisfying Flow Policy Sampling

Soumojit Bhattacharya, Oliver Kroemer, Shubham Tulsiani
From the abstract

A flow-matching policy deployed in the field must often satisfy a constraint that was absent from its demonstrations, such as avoiding an obstacle it has never seen. Retraining for every new constraint is impractical, so the constraint must be enforced at inference time.

From the abstract. Our summary is in progress.

Full paper

CS-Pi: Constraint-Satisfying Flow Policy Sampling

Soumojit Bhattacharya, Oliver Kroemer, Shubham Tulsiani

Published under CC BY 4.0. Reproduced with attribution; original at arXiv:2611.08654 (PDF).

Abstract

A flow-matching policy deployed in the field must often satisfy a constraint that was absent from its demonstrations, such as avoiding an obstacle it has never seen. Retraining for every new constraint is impractical, so the constraint must be enforced at inference time. Enforcing it must not discard what the policy learned: an action the policy would rarely sample may avoid the obstacle yet fail the task. We therefore want actions that are both safe, satisfying the constraint, and plausible, remaining likely under the policy. Gradient guidance, the most common approach, steers noisy states, so it must evaluate its cost on the policy’s running estimate of the clean action; when the policy is uncertain between passing left or right of an obstacle, this estimate is their average and can pass straight through it. We instead build on rejection and projection. Rejection redraws actions until one is safe: every output is plausible, but the wait is intractable when safe actions are rare. Projection moves an action to the nearest safe one: it is efficient, but the result need not be plausible. Our key insight is that flow-matching sampling lets us combine the two, keeping projection’s efficiency and rejection’s plausibility. CS-Pi, our draw-project-renoise sampler, projects each draw to the nearest safe action, adds noise back scaled to how far the projection moved it, and re-runs the unmodified policy until a draw is safe. Replacing only the projection step extends CS-Pi to continuous costs. Across a 2D diagnostic, a 7-DoF shelf pick-and-place, an orientation preference, and a zero-shot Franka deployment, CS-Pi reaches 81\% safe success on the shelf and 55\% on hardware, against 55\% and 40\% for projection, while staying plausible.

1 Introduction

Large-scale flow-matching and diffusion policies have become capable generalist priors for robot manipulation[1, 2]: trained once on broad demonstrations, a single model can pick and place objects, open drawers, and fold clothes. Yet no training set anticipates every deployment, and such a policy will inevitably meet safety-critical scenarios its demonstrations never contained, for example: a wine glass left beside the drawer it must open, which the arm must not touch. This requirement is a constraint, supplied only at deployment. It defines a safe set: the set of actions that satisfy it; in our example, every action that does not touch the glass. Our goal is to sample actions that both come from the policy and lie in the safe set, without retraining the policy for each new constraint. The natural approach is to correct the policy’s output: sample an action and project it onto the safe set, moving it to the nearest safe action, or steer the denoising trajectory using a function of the constraint. Such corrections address the second half of this goal, moving the action into the safe set. They can lose the first: the correction can move the action somewhere the policy would rarely sample. This matters because the policy is what captures the task. An action it considers unlikely may clear the wine glass yet no longer reach the drawer handle. Such an action also loses what the policy learned from the demonstrations, beyond the task itself: smooth, kinematically feasible motion. We therefore require the sampled action to be both safe, satisfying the constraint, and plausible, remaining likely under the policy.

Figure 1: Sampling a flow-matching policy under a deployment-time constraint. Left: The policy \pi_{\theta} denoises Gaussian noise \mathbf{a}_{0}\sim\mathcal{N}(\mathbf{0},I) (t{=}0\to 1) into an action chunk \mathbf{a}\sim\pi_{\theta}, a short sequence of robot motions. Its draws are multimodal: three ways to reach the apple, drawn as paths in the real scene and as modes of the density \pi_{\theta}(\mathbf{a}); the most likely passes through the obstacle. Middle: Constraints such as obstacle avoidance or velocity and joint limits, and soft costs L, are supplied only at deployment. The obstacle constraint defines a safe set \mathcal{C}, the actions that avoid it. Right: We want actions that are safe (\mathbf{a}\in\mathcal{C}) and plausible (likely under \pi_{\theta}), i.e. draws from \pi_{\theta}(\mathbf{a})\,\mathbf{1}_{\mathcal{C}}(\mathbf{a}), where \mathbf{1}_{\mathcal{C}} is 1 on \mathcal{C} and 0 elsewhere: the unsafe mode is removed and the others keep their shape. CS-Pi (ours) targets this distribution without retraining the policy.

Among such training-free samplers, the most common is gradient guidance [3, 4, 5], which nudges each denoising step along the gradient of a cost on the action. Guidance has two shortcomings. First, safety constraints are typically hard constraints: an action either satisfies them or violates them, with no degree in between. An action either touches the wine glass or it does not; this yes-or-no answer says nothing about which way to move the arm, so a hard constraint offers no gradient to follow. Guidance must instead use a smooth cost, such as a collision cost that grows as the arm nears the glass, which discourages contact but does not rule it out. Second, even a smooth cost is meaningful only on a clean action, while guidance acts on noisy intermediate states. Guidance therefore evaluates the cost at a proxy: the policy’s running estimate of the clean action, an average over every clean action the noisy state could still become. This proxy is reliable only when the cost changes slowly across those actions, so sharpening the cost toward the true constraint makes guidance less reliable, not more. The proxy fails when the policy is uncertain between distinct modes, such as passing left or right of the glass. The average of the two can pass straight through the glass, an action the policy would never sample. The gradient evaluated there may point towards neither mode (App. E).

We instead build on rejection and projection, two classical mechanisms that act only on the final sampled action rather than guiding the intermediate noise levels. Rejection sampling redraws complete actions from the policy until one satisfies the constraint: every output is plausible, but the wait is intractable when safe actions are rare. Projection maps a sampled action to the nearest constraint-satisfying point: it is efficient, but the projected action need not be plausible and can be jerky or task-irrelevant. Our key insight is that flow-matching sampling lets us combine the two, keeping projection’s efficiency and rejection’s plausibility. When a projected action is implausible, we need not take rejection’s drastic step of restarting sampling from pure noise; we can instead resample from a reduced noise level around the projection, so the policy returns a safe and plausible action near the projection.

We operationalize this insight in CS-Pi, a draw-project-renoise sampler (Fig. 2). CS-Pi starts from a single draw from the policy and refines it in a loop. Each iteration projects the current draw onto the safe set and, rather than executing the possibly implausible projection, adds noise back to it, scaled to how far the projection moved the draw. It then re-runs the unmodified policy from that noise level to obtain the next draw. The loop ends once a draw is safe. Each draw comes from the policy and tends to land closer to the safe set than the last, so the draws approach the safe set while remaining plausible, at a compute cost far below rejection and with no constraint gradient at any noisy state. We first present CS-Pi for hard constraints, then extend it to continuous costs, such as an orientation preference, by replacing only the projection step. The same change lets CS-Pi combine hard constraints with costs. Across a 2D diagnostic, a 7-DoF shelf pick-and-place with deployment-time obstacles, the orientation preference above, and a zero-shot Franka deployment, CS-Pi is the only sampler that satisfies the constraint while staying plausible wherever the constraint permits; on the shelf it reaches 81\% safe success (completing the task without collision) against 55\% for projection and 32\% for gradient guidance.

Figure 2: Sampling a safe action from a flow-matching policy. Gradient guidance steers each denoising step with a cost gradient evaluated at a proxy and can still violate the constraint. Projection moves the draw to the safe set, yielding an action the policy would rarely sample. Rejection sampling redraws from pure noise until a draw is safe. CS-Pi projects the draw, renoises the projection to time n=k/(k+\delta) set by the projection residual \delta (larger \delta renoises more), and re-runs the policy until a draw is safe and plausible.

2 Related Work

Gradient guidance.

In the robotic settings we consider, constraints and preferences are typically expressed as analytic costs on the action, such as a signed-distance collision cost, a joint-limit penalty or an orientation error. The standard way to steer a diffusion or flow-matching policy [6] toward low cost at deployment is gradient guidance, which nudges each denoising step along the gradient of that cost: classifier-free guidance [4, 7], DPS [8], \PiGDM [9], MPGD [10], AdjointDPM [11], Diffuser [3], and Lan-o3dp [12]. But the cost is meaningful only on a clean action, so each method evaluates it at a proxy, the policy’s running estimate of the clean action. The proxy is accurate when the cost changes slowly and the policy has settled on one mode, and it breaks down otherwise, pushing the sample toward implausible actions (App. E). Trust Sampling [13] takes several guidance steps per denoising step, capping their number by how far the proxy can be trusted at that noise level and stopping early when the sample leaves the region the policy was trained on. It shares our aim of keeping samples plausible, but every step still follows the proxy’s gradient.

Rejection, reweighting, and projection.

A constraint can also be met without following the proxy’s gradient, by acting on the policy’s clean actions. Rejection sampling redraws complete actions until one is safe: every output is plausible, but the wait is intractable when safe actions are rare. Sequential Monte Carlo (SMC) samplers reweight and resample a population of particles rather than discarding them (the Twisted Diffusion Sampler [14], Feynman–Kac samplers [15, 16]); they need more particles as the safe set shrinks, and the weight that steers each particle at a noisy step is still evaluated at the proxy (App. E). Projection moves a sample to the nearest safe action without any cost gradient, either at every denoising step [17] or once, on the final action, which is then executed; in both cases the projected action need not be plausible. CS-Pi also avoids the proxy’s gradient but combines rejection and projection: it projects the final action, then renoises the projection rather than executing it and re-denoises it with the policy, returning a plausible draw closer to the safe set without rejection’s wait or SMC’s particle budget.

Control-barrier-function samplers.

SafeDiffuser [18] enforces forward invariance by solving a control-barrier-function (CBF) quadratic program at each denoising step; SafeFlowMatcher [19] alternates flow prediction with barrier-based correction; and SAD-Flower [20] augments a flow with a virtual safe control input and a learned dynamics model. These methods are designed to certify safety under their respective assumptions, but the certificate says nothing about plausibility. Their corrections continuously deform the current sample: when a constraint blocks the mode the sample has committed to, a correction can push it out of the unsafe region but does not redraw it from another mode of the policy. CS-Pi instead projects, renoises and re-denoises with the policy, which allows such a mode switch while keeping each draw plausible.

CBF samplers also require a differentiable barrier with the structure needed to evaluate its Lie derivatives and relative degree; SAD-Flower additionally assumes a learned dynamics model. CS-Pi requires only a projection onto the safe set, which enables its zero-shot use with existing policies, such as \pi_{0.5}, and obstacle bounding boxes estimated from vision (Sec. 4.4). We test SafeDiffuser and SafeFlowMatcher on the same policies and report them in Tables 1 and 2 and App. B. SAD-Flower is not evaluated as it requires a learned dynamics model, which our setups do not provide.

Deployment-time safety for vision-language-action models.

Recent work shares our practical motivation of enforcing constraints on a pretrained vision-language-action (VLA) policy at deployment. OmniGuide [5] steers flow-matching VLAs [2, 21] toward collision avoidance and semantic targets with gradient guidance on differentiable energy fields, and thus evaluates its cost at the proxy. VLSA [22] instead acts once, on the final action, much as projection does: a CBF filter changes the VLA’s output action as little as possible to satisfy the barrier condition, and the robot executes the filtered action. Its authors report that this filter causes a safety-induced distribution shift. Our hardware experiment uses a similar setup, a \pi_{0.5} policy on a Franka arm, and there CS-Pi improves on both gradient guidance and projection (Sec. 4.4).

Partial renoising.

Adding noise to an input and denoising it again is an established way to make an edited input plausible under a generative model. SDEdit [23] renoises a user’s stroke painting and denoises it into a realistic image; RePaint [24] renoises around known pixels to inpaint the rest; and DemoDiffusion [25] renoises a human demonstration retargeted to the robot into actions the policy would plausibly produce. In each, the renoised input is given in advance and the amount of noise is set by hand, once. CS-Pi instead renoises the policy’s own draw after projecting it onto the safe set, sets the amount of noise from how far the projection moved the draw, and repeats until a draw is safe. This turns a one-shot edit into a loop that drives the draw toward the safe set (Sec. 3).

3 Approach

We want to sample from a flow-matching policy under a constraint supplied only at deployment time. The action we draw must satisfy two equally important requirements: it must be safe, satisfying the constraint, and plausible, remaining likely under the policy. An action the policy would essentially never draw, even one that satisfies the constraint, may be jerky, kinematically infeasible, or task-inappropriate.

Setup and notation. The policy \pi_{\theta} generates a clean action \mathbf{a}\in\mathbb{R}^{D} by integrating a learned velocity field along an ODE, from Gaussian noise \mathbf{a}_{0}\sim\mathcal{N}(\mathbf{0},I) at time t=0 to the clean action at t=1. We write \mathbf{a}=\pi_{\theta}(\mathbf{a}_{n};\,n) for integrating from an intermediate state \mathbf{a}_{n} at time t=n\in[0,1] to t=1, so an ordinary draw is \mathbf{a}=\pi_{\theta}(\mathbf{a}_{0};\,0) with \mathbf{a}_{0}\sim\mathcal{N}(\mathbf{0},I), abbreviated \mathbf{a}\sim\pi_{\theta}; we overload \pi_{\theta}(\mathbf{a}) for the marginal density it induces over clean actions. At deployment we are given a safe set \mathcal{C}\subseteq\mathbb{R}^{D}, absent at training, through its Euclidean projection \mathcal{P}(\mathbf{a})=\arg\min_{\mathbf{a}^{\prime}\in\mathcal{C}}\|\mathbf{a}^{\prime}-\mathbf{a}\|, which is closed-form or a cheap iterative solve for the constraints we consider. Our goal is to draw \mathbf{a}\sim\pi_{\theta} with \mathbf{a}\in\mathcal{C}. We generalize our method to admit continuous cost functions at the end of the section.

Overview. We want samples that are both safe and plausible. Rejection sampling and projection are two classical approaches, each achieving one of these: rejection redraws unmodified policy samples until one is safe, so every draw is plausible, but almost all are wasted when safe actions are rare; projection maps the clean sample to the nearest point in the safe set, so every action is safe, but the projected action is one the policy is unlikely to produce. Our insight is to strike a balance between the two, projection’s efficiency and rejection’s plausibility, by using the projection not as the action to execute but as an anchor for the next draw. Concretely, we draw a clean action, project it onto \mathcal{C}, renoise the projection to a noise level set by how far the projection moved the draw (the projection residual), and re-denoise from there; we iterate until a draw is itself safe.

From projection to a resampling target. Projection gives us a useful starting point for the next draw. The projected sample \mathbf{a}_{c}^{(i)}=\mathcal{P}(\hat{\mathbf{a}}^{(i)}) of the current clean draw \hat{\mathbf{a}}^{(i)}, which we call the anchor, is cheap to compute and safe by construction, and it sits closer than \hat{\mathbf{a}}^{(i)} to the safe actions the policy is likely to draw. It therefore tells us where the next draw should concentrate, i.e. near \mathbf{a}_{c}^{(i)}, without executing \mathbf{a}_{c}^{(i)}. The corresponding idealized target biases the policy toward \mathbf{a}_{c}^{(i)} while preserving its own structure:

q^{(i)}(\mathbf{a})\;\propto\;\pi_{\theta}(\mathbf{a})\cdot\mathcal{N}(\mathbf{a};\,\mathbf{a}_{c}^{(i)},\,(\sigma^{(i)})^{2}I).
(1)

Drawing from Eq. (1), projecting the result, and recentering the next target on that projection defines one iteration of a loop that terminates when a draw lands in \mathcal{C}.

Setting \sigma^{(i)} from the projection residual. We set \sigma^{(i)} from the projection residual \delta^{(i)}=\|\hat{\mathbf{a}}^{(i)}-\mathbf{a}_{c}^{(i)}\| itself, because \delta^{(i)} already encodes how much trust to place in \mathbf{a}_{c}^{(i)} as an anchor. A small \delta^{(i)} means the current draw was nearly safe, so plausible actions likely lie near \mathbf{a}_{c}^{(i)} and the next draw should concentrate there. A large \delta^{(i)} means the current draw was far from \mathcal{C}, so \mathbf{a}_{c}^{(i)} may sit in a region the policy assigns vanishing mass; the next draw should be loose enough to give a different policy mode (e.g., passing right of an obstacle rather than left) a chance to be reached. We therefore set \sigma^{(i)}=\delta^{(i)}/k for a positive coefficient k, the only hyperparameter introduced in the loop. The hyperparameter k slides between the two extremes: k\to 0 gives \sigma^{(i)}\to\infty and recovers rejection, while k\to\infty gives \sigma^{(i)}\to 0 and recovers projection.

Realising the target via partial renoising. Sampling from Eq. (1) for an arbitrary \sigma^{(i)} is intractable in general as the policy density \pi_{\theta}(\mathbf{a}) is implicit, defined only through the ODE, and its product with a Gaussian has no closed form. We therefore renoise the projected point to the intermediate time n^{(i)}=k/(k+\delta^{(i)}),

\mathbf{a}_{n}^{(i)}=n^{(i)}\mathbf{a}_{c}^{(i)}+(1-n^{(i)})\bm{\epsilon}^{(i)},\qquad\bm{\epsilon}^{(i)}\sim\mathcal{N}(\mathbf{0},I),
(2)

and re-denoise from \mathbf{a}_{n}^{(i)}. This choice of n^{(i)} ties the amount of noise to \sigma^{(i)}: (1-n^{(i)})/n^{(i)}=\delta^{(i)}/k=\sigma^{(i)}, so a larger residual adds more noise. (App. F) states the exact rule for the next draw under this construction and its scope.

Iterating to safety. We pass each new draw back as the next \hat{\mathbf{a}}: project, renoise, re-run the policy, repeat, until the draw lands in \mathcal{C}. We refer to this draw-project-renoise loop as Constraint-Satisfying Flow Policy Sampling (CS-Pi; Fig. 2), stated in Algorithm 1; it terminates when \delta\leq\tau, i.e., once a draw lies within \tau of \mathcal{C}, or after a cap of K_{\max} iterations. On average each successive draw lands closer to the safe set (App. H), so the residual \delta shrinks (resulting in a larger n) with each iteration, bringing the current draw closer to a safe and plausible draw.

Algorithm 1 Constraint-Satisfying Flow Policy Sampling

Incorporating soft preferences as continuous costs. So far we have enforced a hard constraint, i.e. an action either lies in \mathcal{C} or it does not. Deployment also brings softer preferences, behaviors to favor rather than boundaries to clear, such as keeping the gripper near-vertical while carrying a full cup (Sec.4.3), and we generalize the same loop to express these preferences alongside hard constraints. This generalization needs only one change: CS-Pi uses the projection only to produce an anchor for the next draw; for a continuous cost L, that anchor comes instead from the proximal operator

\mathrm{prox}_{\beta L}(\hat{\mathbf{a}})\;=\;\arg\min_{\mathbf{a}^{\prime}\in\mathbb{R}^{D}}\,\Big[\,L(\mathbf{a}^{\prime})+\tfrac{1}{2\beta}\,\|\mathbf{a}^{\prime}-\hat{\mathbf{a}}\|^{2}\,\Big],
(3)

which trades reducing L against staying close to the current draw \hat{\mathbf{a}}, with \beta setting the balance; the rest of the algorithm is unchanged. Hard constraints and continuous costs are then composed by being applied in sequence to the same clean draw, with the operators encoding priority by their order. For example, CS-Pi can first pull toward the preferred orientation with the proximal operator and then project onto the safe set, so the constraint takes precedence. A gradient method would instead have to merge both into a single objective.

Optional terminal projection. If no draw lies within \tau of \mathcal{C} after K_{\max} iterations, CS-Pi can project the last draw and execute the result, trading plausibility for safety when safety must come first. Even then the loop pays off: in simulation, the executed actions are more likely under the policy than a typical one-shot projection. App. J studies how often the terminal projection is triggered and how likely the resulting actions are.

4 Experiments

Throughout, we measure two things for each sampler: whether it satisfies the constraint and whether its samples are plausible. We evaluate four settings: a 2D navigation task where the whole action distribution is easy to visualize, a 7-DoF shelf pick-and-place, an orientation-preference cost (3D-Orient), and a real-world Franka deployment; App. B adds a 3D obstacle-avoidance benchmark, Sphere-Avoid.

Our primary metric is the safe success rate (Safe-SR): the fraction of rollouts that satisfy the constraint and complete the task. Plausibility is measured by logL, the mean log-likelihood \pi_{\theta} assigns to a method’s actions (nats/dim; higher is more plausible). Compute is reported as NFE, the flow-network forward passes per rollout (not comparable across benchmarks). We compare against gradient guidance, Trust Sampling (step size w, at most J guidance steps per denoising step), rejection sampling (redraw budget B), projection, the unconstrained policy, and two CBF samplers (SafeDiffuser [18] and SafeFlowMatcher [19]), each reported at the best value of its main hyperparameters (App. G). CS-Pi has a single hyperparameter, k, and is robust across a broad range of it (App. L). It uses the terminal projection on every obstacle benchmark but not on 3D-Orient, where the target is a preference.

4.1 2D Avoidance: constraint satisfaction without distribution shift

Avoidance is a 2D planar environment in which an agent travels from a fixed start position to a goal region. We collect demonstrations that reach the goal along distinct paths, so the policy is multimodal, mirroring real manipulation data where demonstrations of one task take different routes or have different styles. Because the action space is 2D, we can plot each sampler’s full distribution. Plausibility is measured by how many of the rollouts stay inside the demonstration support: the part of the plane the demonstrations pass through. At deployment we impose obstacles the policy never saw, in six scenarios of varying difficulty. Fig. 3 shows rollouts for one scenario; the remaining five are in App. D.

Figure 3: 2D Avoidance trajectory distributions, one scenario per method. 20 rollouts overlaid on the demonstration support (shaded); the obstacles are outlined. Gradient guidance and Trust Sampling visibly leave the support to reach the goal or cut through the obstacle; rejection stays on-support but only a few draws survive; CS-Pi keeps every trajectory in-distribution while routing around the obstacle. The other five scenarios are in App. D.

Three methods reach at least 99\% safe success: SafeDiffuser, projection and CS-Pi (Table 1). Among them, CS-Pi keeps the most rollouts fully on-support (0.857) and has the highest log-likelihood (1.53), while projection’s log-likelihood collapses to -85.89. Gradient guidance, Trust Sampling and rejection stay plausible but reach at most 79.4\% safe success.

Table 1: 2D Avoidance, macro over six scenarios (200 rollouts per cell; best hyperparameter per method). Safe-SR: rollouts reaching the goal collision-free. fully-in-supp.: fraction of rollouts whose every waypoint lies inside the demonstration support. logL: mean log-likelihood under \pi_{\theta}.
  • Unconstrained
    Safe-SR (%) \uparrow
    5.2
    fully-in-supp. \uparrow
    0.800
    logL \uparrow
    \mathbf{1.66}
    NFE \downarrow
    456
  • Gradient guidance
    Safe-SR (%) \uparrow
    67.2
    fully-in-supp. \uparrow
    0.410
    logL \uparrow
    1.49
    NFE \downarrow
    298
  • Trust Sampling
    Safe-SR (%) \uparrow
    34.9
    fully-in-supp. \uparrow
    0.350
    logL \uparrow
    1.43
    NFE \downarrow
    4421
  • Rejection
    Safe-SR (%) \uparrow
    79.4
    fully-in-supp. \uparrow
    0.750
    logL \uparrow
    \mathbf{1.66}
    NFE \downarrow
    73921
  • Projection
    Safe-SR (%) \uparrow
    99.8
    fully-in-supp. \uparrow
    0.640
    logL \uparrow
    -85.89
    NFE \downarrow
    \mathbf{52}
  • SafeDiffuser
    Safe-SR (%) \uparrow
    \mathbf{100.0}
    fully-in-supp. \uparrow
    0.830
    logL \uparrow
    1.44
    NFE \downarrow
    92
  • SafeFlowMatcher
    Safe-SR (%) \uparrow
    45.2
    fully-in-supp. \uparrow
    0.000
    logL \uparrow
    -463
    NFE \downarrow
    220
  • CS-Pi
    Safe-SR (%) \uparrow
    99.0
    fully-in-supp. \uparrow
    \mathbf{0.857}
    logL \uparrow
    1.53
    NFE \downarrow
    283
Composing a hard constraint with a soft preference.

A safe set cannot express a preference among feasible actions. On the same 2D Avoidance environment we add to the obstacle constraint a soft preference toward a height y_{\mathrm{ref}}{=}0.7. CS-Pi applies the two in sequence by priority, whereas the baselines must fold them into one weighted cost; only CS-Pi satisfies both (App. D, Fig. 8).

4.2 Shelf pick-and-place with deployment-time obstacles

The shelf benchmark tests whether a sampler can satisfy a deployment-time obstacle constraint without discarding the task semantics encoded by the policy. A 7-DoF Franka picks a 4 cm cube from a three-rung shelf and places it on the table; at inference we add obstacles absent at training (App. C). A rollout is safe and successful if it is collision-free, picks the cube, and places it. CS-Pi and projection share the same L-BFGS [26] proximal step, so any gap between them is due to the iterative loop of CS-Pi.

CS-Pi reaches the highest safe success rate (81.3\%; Table 2) and is the only method whose actions score above the unconstrained policy in mean log-likelihood; projection and the gradient baselines satisfy the obstacle only by making the chunk implausible. CS-Pi, projection, gradient guidance and SafeFlowMatcher collide on at most 8\% of rollouts, so among them performance depends mainly on whether the gripper still reaches the cube. Projection and the gradient baselines avoid the obstacles by moving the arm away from them, and often away from the cube as well; CS-Pi instead re-denoises a trajectory that passes between the obstacles and still reaches the cube (84.7\% goal reaching, above even the unconstrained policy’s 75.3\%).

Table 2: Shelf pick-and-place, 5 scenarios, 150 tasks (30/scenario). Safe-SR: collision-free rollouts that pick and place the cube. logL: mean log-likelihood under \pi_{\theta} (nats/dim; the unconstrained policy scores 15.02). NFE: flow-model calls per trajectory. †Median: a few diverged SafeDiffuser chunks make its mean uninformative.
  • Unconstrained
    Safe-SR (%) \uparrow
    3.3
    Goal reaching (%) \uparrow
    75.3
    Collision (%) \downarrow
    80.0
    logL \uparrow
    15.02
    NFE \downarrow
    240
  • Gradient guidance (\alpha{=}0.20)
    Safe-SR (%) \uparrow
    32.0
    Goal reaching (%) \uparrow
    32.0
    Collision (%) \downarrow
    \mathbf{0.7}
    logL \uparrow
    10.42
    NFE \downarrow
    240
  • Trust Sampling (w{=}0.1, J{=}5)
    Safe-SR (%) \uparrow
    53.3
    Goal reaching (%) \uparrow
    60.7
    Collision (%) \downarrow
    12.0
    logL \uparrow
    12.23
    NFE \downarrow
    1104
  • Rejection (B{=}100)
    Safe-SR (%) \uparrow
    34.7
    Goal reaching (%) \uparrow
    68.0
    Collision (%) \downarrow
    38.7
    logL \uparrow
    14.22
    NFE \downarrow
    8745
  • Projection
    Safe-SR (%) \uparrow
    55.3
    Goal reaching (%) \uparrow
    58.7
    Collision (%) \downarrow
    6.0
    logL \uparrow
    11.41
    NFE \downarrow
    240
  • SafeDiffuser
    Safe-SR (%) \uparrow
    13.3
    Goal reaching (%) \uparrow
    16.7
    Collision (%) \downarrow
    19.3
    logL \uparrow
    7.50^{\dagger}
    NFE \downarrow
    240
  • SafeFlowMatcher
    Safe-SR (%) \uparrow
    44.7
    Goal reaching (%) \uparrow
    48.7
    Collision (%) \downarrow
    8.0
    logL \uparrow
    10.90
    NFE \downarrow
    432
  • CS-Pi (k{=}50, K_{\max}{=}5)
    Safe-SR (%) \uparrow
    \mathbf{81.3}
    Goal reaching (%) \uparrow
    \mathbf{84.7}
    Collision (%) \downarrow
    3.3
    logL \uparrow
    \mathbf{17.96}
    NFE \downarrow
    271

4.3 3D-Orient: reaching with an orientation preference

3D-Orient tests CS-Pi on a continuous cost. The task is a 7-DoF reach to a goal sampled anywhere in the robot’s reachable workspace; on top of it we add a soft preference to hold a top-down orientation R^{*}, encoded as the cost \mathcal{L}(q)=\lambda\sum_{t=1}^{H}\lVert R(q_{t})-R^{*}\rVert_{F}^{2}. The test is whether a method can achieve the orientation without giving up the reach. Projection, rejection and the CBF samplers require a safe set and do not apply to a continuous cost.

CS-Pi is the only method that does both (Table 3): 65.6\% success, with goal reaching (98.9\%) and end-effector step (0.07 m) matching the unconstrained policy. Gradient guidance loses the reach and roughens the path (<7\% success); Trust Sampling keeps the reach and a high log-likelihood only by barely changing the orientation (1.1\% success). CS-Pi’s lower log-likelihood (10.21 vs. 13.46) is the cost of moving the gripper away from the policy’s preferred orientations. Guidance fails because of IK redundancy: many configurations reach the same point at different orientations, so the proxy averages them into an invalid configuration with an uninformative gradient (App. E).

Table 3: 3D-Orient, 90 rollouts per cell. Success: rollouts with a step simultaneously within 10 cm of the target position and within 0.36 rad of the target orientation. Goal reaching: rollouts ending within 10 cm of the target position. logL: mean log-likelihood under \pi_{\theta}; comparisons are meaningful only at comparable success, since the guidance configurations attain only 2.2\% and 6.7\% success. Max EE step: largest single-step end-effector displacement. EE-prox: proximal step on the orientation cost (Eq. (3)). NFE: mean number of model evaluations per rollout.
  • Unconstrained
    Success \uparrow
    2.2\%
    Goal reaching \uparrow
    \mathbf{98.9\%}
    logL \uparrow
    13.46
    Max EE step (m)
    \mathbf{0.07}
    NFE \downarrow
    \mathbf{138}
  • Gradient guidance (\alpha{=}0.003)
    Success \uparrow
    2.2\%
    Goal reaching \uparrow
    70.0\%
    logL \uparrow
    12.30
    Max EE step (m)
    0.08
    NFE \downarrow
    154
  • Gradient guidance (\alpha{=}0.03)
    Success \uparrow
    6.7\%
    Goal reaching \uparrow
    7.8\%
    logL \uparrow
    9.62
    Max EE step (m)
    0.40
    NFE \downarrow
    160
  • Trust Sampling (w{=}0.001)
    Success \uparrow
    1.1\%
    Goal reaching \uparrow
    \mathbf{98.9\%}
    logL \uparrow
    13.44
    Max EE step (m)
    \mathbf{0.07}
    NFE \downarrow
    1379
  • CS-Pi + EE-prox (k{=}10, K_{\max}{=}3)
    Success \uparrow
    \mathbf{65.6\%}
    Goal reaching \uparrow
    \mathbf{98.9\%}
    logL \uparrow
    10.21
    Max EE step (m)
    \mathbf{0.07}
    NFE \downarrow
    210

4.4 Real-world deployment

We evaluate CS-Pi on a Franka arm with a Robotiq 2F-85 gripper, ZED 2 external and ZED Mini wrist cameras, and a DROID-finetuned \pi_{0.5}[27] policy used without further finetuning. The task is pick up the apple and place it on the blue plate. A vision pipeline conditioned on the ZED 2 RGB and depth images generate obstacle bounding boxes that form the constraint \mathcal{C}; deployment is zero-shot. We test over two layouts (Fig. 4), 10 trials per method per layout, and compare CS-Pi, gradient guidance, and projection against the unguided policy. Table 4 reports the safe-success rate, per-step latency, and the log-likelihood the frozen prior assigns to the executed actions.

Table 4: Hardware: pick the apple, place it on the blue plate on a Franka FR3 with \pi_{0.5}. Zero-shot; \mathcal{C} is obstacle bounding boxes from a ZED 2 RGB-D vision pipeline. Two layouts, 10 trials per method per layout (20 in total). CS-Pi has the highest safe success rate in each layout and averaged over both. logL is the log-likelihood \pi_{\theta} assigns to executed actions (the unconstrained policy’s own draws score -470.2; higher is more plausible): CS-Pi stays close to the unconstrained policy, while projection and Trust Sampling fall below it.
  • Method
    Safe-SR (%) \uparrow
    Layout 1
    Safe-SR (%) \uparrow
    Layout 2
    Safe-SR (%) \uparrow
    Averaged
    Time/step (s) \downarrow
    logL \uparrow
  • Unconstrained
    Safe-SR (%) \uparrow
    20
    Safe-SR (%) \uparrow
    0
    Safe-SR (%) \uparrow
    10
    0.069
    -470.2{\pm}1.0
  • Gradient guidance
    Safe-SR (%) \uparrow
    40
    Safe-SR (%) \uparrow
    10
    Safe-SR (%) \uparrow
    25
    0.139
    -464.9{\pm}1.4
  • Trust Sampling
    Safe-SR (%) \uparrow
    20
    Safe-SR (%) \uparrow
    20
    Safe-SR (%) \uparrow
    20
    0.135
    -474.8{\pm}2.1
  • Projection
    Safe-SR (%) \uparrow
    40
    Safe-SR (%) \uparrow
    40
    Safe-SR (%) \uparrow
    40
    0.099
    -473.2{\pm}2.3
  • CS-Pi
    Safe-SR (%) \uparrow
    \mathbf{60}
    Safe-SR (%) \uparrow
    \mathbf{50}
    Safe-SR (%) \uparrow
    \mathbf{55}
    0.143
    -471.8{\pm}1.7

CS-Pi reaches the highest safe success rate in both layouts (60\% and 50\%) and averaged over both (55\%), versus 40\% for projection, 25\% for gradient guidance, 20\% for Trust Sampling, and 10\% for the unconstrained policy. Its per-step latency (0.143 s) matches gradient guidance (0.139 s) and Trust Sampling (0.135 s); projection is cheaper (0.099 s) but enforces \mathcal{C} with a one-shot projection that drops its log-likelihood below the unconstrained policy’s (-473.2 versus -470.2), whereas CS-Pi stays close to it (-471.8) while satisfying the constraint. The runs are small-sample (10 trials per layout), but CS-Pi leads in both layouts.

Figure 4: Hardware rollouts; frames run left-to-right within each strip. Green-bordered strips are CS-Pi, which enforces the deployment-time obstacle constraint and completes the pick-and-place; red-bordered strips are the same \pi_{0.5} policy run unconstrained. Layout 1 (first two): CS-Pi grasps the apple and places it, while the unconstrained policy clips the cup and loses the grasp. Layout 2 (last two): CS-Pi reaches down and lifts the apple cleanly, while the unconstrained policy collides with the obstacle.

5 Conclusion

CS-Pi samples safe and plausible actions from a flow-matching policy with a draw-project-renoise loop: it projects each draw onto the safe set, adds noise back scaled to how far the projection moved the draw, and re-runs the unmodified policy. It needs no constraint gradient at noisy states and no auxiliary network. CS-Pi also extends to continuous costs by replacing only the projection step with a proximal operator. Across a 2D diagnostic, a 7-DoF shelf pick-and-place, an orientation preference, and a zero-shot Franka deployment, CS-Pi is the only sampler that satisfies the constraint while staying plausible wherever the constraint permits. On hardware it reaches 55\% safe success against 40\% for projection and 25\% for gradient guidance. A policy can thus meet a safety constraint it never trained on, without surrendering the behaviour that made it useful.

Limitations

Our theory covers a single iteration, we characterize the per-iteration sampling distribution, the distribution of the next draw given the current one (App. F), but we do not prove that the loop converges. In practice, CS-Pi does not always reach an action that is both safe and plausible. Therefore, when no draw lies within \tau of \mathcal{C} after K_{\max} iterations, it must choose between the last draw, which may be unsafe, and the terminal projection, which is safe but often less likely under the policy (App. J).

CS-Pi also needs a usable projection \mathcal{P} (or proximal operator \mathrm{prox}_{\beta L}): the obstacle and joint-limit sets we use admit closed-form or cheap iterative solutions, but more complex sets need more complex solvers. It is also only as good as \mathcal{C}: on hardware we estimate \mathcal{C} from vision once per rollout and evaluate in static scenes, so dynamic obstacles and errors from segmentation, depth and registration can misplace or mis-size \mathcal{C}. Finally, like every sampler we evaluate, CS-Pi operates on action chunks, the fixed-length sequences of actions a policy predicts at each query, and is therefore myopic: when the policy commits to a mode that is safe for the current chunk but has no safe continuation, CS-Pi cannot recover; trajectory-level planning is out of scope.

References

  1. [1] K. Black, N. Brown, D. Driess, A. Esmail, M. Equi, C. Finn, N. Fusai, L. Groom, K. Hausman, B. Ichter, S. Jakubczak, T. Jones, L. Ke, S. Levine, A. Li-Bell, M. Mothukuri, S. Nair, K. Pertsch, L. X. Shi, J. Tanner, Q. Vuong, A. Walling, H. Wang, and U. Zhilinsky. \pi_{0}: A vision-language-action flow model for general robot control, 2026. URL https://arxiv.org/abs/2410.24164.
  2. [2] P. Intelligence, K. Black, N. Brown, J. Darpinian, K. Dhabalia, D. Driess, A. Esmail, M. Equi, C. Finn, N. Fusai, M. Y. Galliker, D. Ghosh, L. Groom, K. Hausman, B. Ichter, S. Jakubczak, T. Jones, L. Ke, D. LeBlanc, S. Levine, A. Li-Bell, M. Mothukuri, S. Nair, K. Pertsch, A. Z. Ren, L. X. Shi, L. Smith, J. T. Springenberg, K. Stachowicz, J. Tanner, Q. Vuong, H. Walke, A. Walling, H. Wang, L. Yu, and U. Zhilinsky. \pi_{0.5}: a vision-language-action model with open-world generalization, 2025. URL https://arxiv.org/abs/2504.16054.
  3. [3] M. Janner, Y. Du, J. B. Tenenbaum, and S. Levine. Planning with diffusion for flexible behavior synthesis, 2022. URL https://arxiv.org/abs/2205.09991.
  4. [4] J. Ho and T. Salimans. Classifier-free diffusion guidance, 2022. URL https://arxiv.org/abs/2207.12598.
  5. [5] Y. Song, L. Le, Y.-H. Park, J. Wang, J. Shi, L. Liu, J. Gu, E. Eaton, D. Jayaraman, and K. Daniilidis. Omniguide: Universal guidance fields for enhancing generalist robot policies, 2026. URL https://arxiv.org/abs/2603.10052.
  6. [6] Y. Lipman, R. T. Q. Chen, H. Ben-Hamu, M. Nickel, and M. Le. Flow matching for generative modeling, 2023. URL https://arxiv.org/abs/2210.02747.
  7. [7] P. Dhariwal and A. Nichol. Diffusion models beat gans on image synthesis, 2021. URL https://arxiv.org/abs/2105.05233.
  8. [8] H. Chung, J. Kim, M. T. Mccann, M. L. Klasky, and J. C. Ye. Diffusion posterior sampling for general noisy inverse problems, 2024. URL https://arxiv.org/abs/2209.14687.
  9. [9] J. Song, A. Vahdat, M. Mardani, and J. Kautz. Pseudoinverse-guided diffusion models for inverse problems. In International Conference on Learning Representations, 2023.
  10. [10] Y. He, N. Murata, C.-H. Lai, Y. Takida, T. Uesaka, D. Kim, W.-H. Liao, Y. Mitsufuji, J. Z. Kolter, R. Salakhutdinov, and S. Ermon. Manifold preserving guided diffusion, 2023. URL https://arxiv.org/abs/2311.16424.
  11. [11] J. Pan, J. H. Liew, V. Y. F. Tan, J. Feng, and H. Yan. Adjointdpm: Adjoint sensitivity method for gradient backpropagation of diffusion probabilistic models, 2024. URL https://arxiv.org/abs/2307.10711.
  12. [12] H. Li, Q. Feng, Z. Zheng, J. Feng, Z. Chen, and A. Knoll. Language-guided object-centric diffusion policy for generalizable and collision-aware robotic manipulation, 2025. URL https://arxiv.org/abs/2407.00451.
  13. [13] W. Huang, Y. Jiang, T. V. Wouwe, and C. K. Liu. Constrained diffusion with trust sampling, 2024. URL https://arxiv.org/abs/2411.10932.
  14. [14] L. Wu, B. L. Trippe, C. A. Naesseth, D. M. Blei, and J. P. Cunningham. Practical and asymptotically exact conditional sampling in diffusion models, 2024. URL https://arxiv.org/abs/2306.17775.
  15. [15] M. Skreta, T. Akhound-Sadegh, V. Ohanesian, R. Bondesan, A. Aspuru-Guzik, A. Doucet, R. Brekelmans, A. Tong, and K. Neklyudov. Feynman-kac correctors in diffusion: Annealing, guidance, and product of experts, 2025. URL https://arxiv.org/abs/2503.02819.
  16. [16] R. Singhal, Z. Horvitz, R. Teehan, M. Ren, Z. Yu, K. McKeown, and R. Ranganath. A general framework for inference-time scaling and steering of diffusion models, 2025. URL https://arxiv.org/abs/2501.06848.
  17. [17] J. Zhang, L. Zhao, A. Papachristodoulou, and J. Umenberger. Constrained diffusers for safe planning and control, 2025. URL https://arxiv.org/abs/2506.12544.
  18. [18] W. Xiao, T.-H. Wang, C. Gan, and D. Rus. Safediffuser: Safe planning with diffusion probabilistic models, 2023. URL https://arxiv.org/abs/2306.00148.
  19. [19] J. Yang, S. Jang, and S. Han. Safeflowmatcher: Safe and fast planning using flow matching with control barrier functions, 2026. URL https://arxiv.org/abs/2509.24243.
  20. [20] T.-Y. Huang, A. Lederer, D.-J. Wu, X. Dai, S. Zhang, H.-C. Lin, S.-H. Sun, S. Sosnowski, and S. Hirche. Sad-flower: Flow matching for safe, admissible, and dynamically consistent planning, 2026. URL https://arxiv.org/abs/2511.05355.
  21. [21] NVIDIA, :, J. Bjorck, F. Castañeda, N. Cherniadev, X. Da, R. Ding, L. J. Fan, Y. Fang, D. Fox, F. Hu, S. Huang, J. Jang, Z. Jiang, J. Kautz, K. Kundalia, L. Lao, Z. Li, Z. Lin, K. Lin, G. Liu, E. Llontop, L. Magne, A. Mandlekar, A. Narayan, S. Nasiriany, S. Reed, Y. L. Tan, G. Wang, Z. Wang, J. Wang, Q. Wang, J. Xiang, Y. Xie, Y. Xu, Z. Xu, S. Ye, Z. Yu, A. Zhang, H. Zhang, Y. Zhao, R. Zheng, and Y. Zhu. Gr00t n1: An open foundation model for generalist humanoid robots, 2025. URL https://arxiv.org/abs/2503.14734.
  22. [22] S. Hu, Z. Liu, S. Liu, J. Cen, Z. Meng, and X. He. Vlsa: Vision-language-action models with plug-and-play safety constraint layer, 2025. URL https://arxiv.org/abs/2512.11891.
  23. [23] C. Meng, Y. Song, J. Song, J. Wu, J. Zhu, and S. Ermon. Sdedit: Image synthesis and editing with stochastic differential equations. CoRR, abs/2108.01073, 2021. URL https://arxiv.org/abs/2108.01073.
  24. [24] A. Lugmayr, M. Danelljan, A. Romero, F. Yu, R. Timofte, and L. V. Gool. Repaint: Inpainting using denoising diffusion probabilistic models, 2022. URL https://arxiv.org/abs/2201.09865.
  25. [25] S. Park, H. Bharadhwaj, and S. Tulsiani. Demodiffusion: One-shot human imitation using pre-trained diffusion policy, 2026. URL https://arxiv.org/abs/2506.20668.
  26. [26] D. C. Liu and J. Nocedal. On the limited memory bfgs method for large scale optimization. Mathematical Programming, 45:503–528, 1989. URL https://api.semanticscholar.org/CorpusID:5681609.
  27. [27] A. Khazatsky, K. Pertsch, S. Nair, A. Balakrishna, S. Dasari, S. Karamcheti, S. Nasiriany, M. K. Srirama, L. Y. Chen, K. Ellis, P. D. Fagan, J. Hejna, M. Itkina, M. Lepert, Y. J. Ma, P. T. Miller, J. Wu, S. Belkhale, S. Dass, H. Ha, A. Jain, A. Lee, Y. Lee, M. Memmel, S. Park, I. Radosavovic, K. Wang, A. Zhan, K. Black, C. Chi, K. B. Hatch, S. Lin, J. Lu, J. Mercat, A. Rehman, P. R. Sanketi, A. Sharma, C. Simpson, Q. Vuong, H. R. Walke, B. Wulfe, T. Xiao, J. H. Yang, A. Yavary, T. Z. Zhao, C. Agia, R. Baijal, M. G. Castro, D. Chen, Q. Chen, T. Chung, J. Drake, E. P. Foster, J. Gao, V. Guizilini, D. A. Herrera, M. Heo, K. Hsu, J. Hu, M. Z. Irshad, D. Jackson, C. Le, Y. Li, K. Lin, R. Lin, Z. Ma, A. Maddukuri, S. Mirchandani, D. Morton, T. Nguyen, A. O’Neill, R. Scalise, D. Seale, V. Son, S. Tian, E. Tran, A. E. Wang, Y. Wu, A. Xie, J. Yang, P. Yin, Y. Zhang, O. Bastani, G. Berseth, J. Bohg, K. Goldberg, A. Gupta, A. Gupta, D. Jayaraman, J. J. Lim, J. Malik, R. Martín-Martín, S. Ramamoorthy, D. Sadigh, S. Song, J. Wu, M. C. Yip, Y. Zhu, T. Kollar, S. Levine, and C. Finn. Droid: A large-scale in-the-wild robot manipulation dataset, 2025. URL https://arxiv.org/abs/2403.12945.
  28. [28] Y. Nesterov. Introductory Lectures on Convex Optimization: A Basic Course. Kluwer Academic Publishers, 2004.

Appendix A Project page

Qualitative videos of the 2D, simulated, and hardware rollouts, along with additional visualizations, are available at the project page:

https://babayaga840.github.io/CS-pi_site/

Appendix B 3D Sphere-Avoid: pure obstacle avoidance

This benchmark complements the shelf result (Sec. 4.2) by isolating obstacle avoidance, with no task-semantic tension between the constraint and the policy. Sphere-Avoid uses a simulated 7-DoF Franka Panda and a joint-space action: a flow-matching policy moves between a start and a goal configuration without colliding with sphere obstacles. The safe set \mathcal{C} is the collision-free set of the swept-sphere geometry plus joint limits. We test two layouts: L1 (10 spheres) and L2 (16 spheres). The policy was trained on demonstrations from both layouts.

Figure 5: The two Sphere-Avoid layouts (L2 adds six obstacles).

CS-Pi with the terminal projection reaches 99.9\% safe success on L1 and 91.8\% on L2, the highest in both layouts, and of the methods that enforce the constraint it loses the least from L1 to L2 (8.1 points, against 26.1 for projection; Table 5). The strongest baselines are projection (88.2\% / 62.1\% on L1 / L2) and Trust Sampling (77.0\% / 38.7\% at 64–69 NFE), followed by SafeFlowMatcher (61.8\% / 21.9\%), rejection (56.7\% / 14.1\% at 388–492 NFE), SafeDiffuser (36.4\% / 7.4\%), gradient guidance (23.6\% / 4.7\%) and the unconstrained policy (8.9\% / 0.8\%). CS-Pi uses 20–26 NFE. Its log-likelihood matches the unconstrained policy on L1 (2.87 vs. 2.88) and is 0.30 lower on L2; rejection has the highest log-likelihood on both layouts.

Table 5: 3D Sphere-Avoid. 120 tasks, of which 104 (L1) and 32 (L2) have a safe goal configuration; 8 samples per task. logL: mean log-likelihood under \pi_{\theta} (nats/dim; the unconstrained policy scores 2.88 / 2.84). †Median: a few diverged SafeDiffuser samples make the mean uninformative (-119.5 / -17.3). Baselines are at their best swept configuration (App. G).
  • Unconstrained
    L1 (10 spheres) Safe-SR
    8.9
    L1 (10 spheres) logL
    2.88
    L1 (10 spheres) NFE
    10
    L2 (16 spheres) Safe-SR
    0.8
    L2 (16 spheres) logL
    2.84
    L2 (16 spheres) NFE
    10
  • Gradient guidance (\alpha{=}0.01)
    L1 (10 spheres) Safe-SR
    23.6
    L1 (10 spheres) logL
    2.73
    L1 (10 spheres) NFE
    10
    L2 (16 spheres) Safe-SR
    4.7
    L2 (16 spheres) logL
    2.32
    L2 (16 spheres) NFE
    10
  • Trust Sampling (w{=}0.3, J{=}5)
    L1 (10 spheres) Safe-SR
    77.0
    L1 (10 spheres) logL
    3.03
    L1 (10 spheres) NFE
    64
    L2 (16 spheres) Safe-SR
    38.7
    L2 (16 spheres) logL
    2.68
    L2 (16 spheres) NFE
    69
  • Rejection
    L1 (10 spheres) Safe-SR
    56.7
    L1 (10 spheres) logL
    \mathbf{3.47}
    L1 (10 spheres) NFE
    388
    L2 (16 spheres) Safe-SR
    14.1
    L2 (16 spheres) logL
    \mathbf{3.19}
    L2 (16 spheres) NFE
    492
  • Projection
    L1 (10 spheres) Safe-SR
    88.2
    L1 (10 spheres) logL
    2.67
    L1 (10 spheres) NFE
    10
    L2 (16 spheres) Safe-SR
    62.1
    L2 (16 spheres) logL
    2.28
    L2 (16 spheres) NFE
    10
  • SafeDiffuser
    L1 (10 spheres) Safe-SR
    36.4
    L1 (10 spheres) logL
    2.51^{\dagger}
    L1 (10 spheres) NFE
    10
    L2 (16 spheres) Safe-SR
    7.4
    L2 (16 spheres) logL
    1.83^{\dagger}
    L2 (16 spheres) NFE
    10
  • SafeFlowMatcher
    L1 (10 spheres) Safe-SR
    61.8
    L1 (10 spheres) logL
    2.30
    L1 (10 spheres) NFE
    12
    L2 (16 spheres) Safe-SR
    21.9
    L2 (16 spheres) logL
    1.82
    L2 (16 spheres) NFE
    12
  • CS-Pi (k{=}50, K_{\max}{=}20)
    L1 (10 spheres) Safe-SR
    \mathbf{99.9}
    L1 (10 spheres) logL
    2.87
    L1 (10 spheres) NFE
    20
    L2 (16 spheres) Safe-SR
    \mathbf{91.8}
    L2 (16 spheres) logL
    2.54
    L2 (16 spheres) NFE
    26

Appendix C Shelf task scenarios

Figure 6: The five shelf scenarios (blue: cube to grasp, orange: obstacles).
Table 6: Shelf safe success (%) per scenario, 30 tasks each. CS-Pi’s mean logL per scenario: 19.29 / 17.56 / 17.63 / 17.08 / 18.26. Trust Sampling (53.3\% overall) is not broken down by scenario.
  • Unconstrained
    Clutter
    3.3
    Pillar
    3.3
    Flankers
    3.3
    Mid-rung
    6.7
    Low-rung
    0.0
    Mean
    3.3
  • Gradient guidance
    Clutter
    16.7
    Pillar
    70.0
    Flankers
    16.7
    Mid-rung
    33.3
    Low-rung
    23.3
    Mean
    32.0
  • Rejection
    Clutter
    20.0
    Pillar
    83.3
    Flankers
    20.0
    Mid-rung
    33.3
    Low-rung
    16.7
    Mean
    34.7
  • Projection
    Clutter
    40.0
    Pillar
    63.3
    Flankers
    46.7
    Mid-rung
    66.7
    Low-rung
    60.0
    Mean
    55.3
  • SafeDiffuser
    Clutter
    6.7
    Pillar
    33.3
    Flankers
    3.3
    Mid-rung
    23.3
    Low-rung
    0.0
    Mean
    13.3
  • SafeFlowMatcher
    Clutter
    43.3
    Pillar
    46.7
    Flankers
    53.3
    Mid-rung
    56.7
    Low-rung
    23.3
    Mean
    44.7
  • CS-Pi
    Clutter
    \mathbf{80.0}
    Pillar
    \mathbf{93.3}
    Flankers
    \mathbf{83.3}
    Mid-rung
    \mathbf{76.7}
    Low-rung
    \mathbf{73.3}
    Mean
    \mathbf{81.3}

Appendix D Additional 2D Avoidance results

Figure 7: 2D Avoidance trajectory distributions, all six scenarios. 20 rollouts overlaid on the demonstration support (shaded); the obstacles are outlined.
Table 7: 2D Avoidance safe success (%) per scenario for the baselines, 200 rollouts each (CS-Pi: 99.0\% overall, Table 1). Gradient guidance succeeds where one safe corridor dominates (left, cluttered, narrow) and fails where the safe set is a narrow passage the policy rarely uses (both, narrower).
  • Unconstrained
    left
    20.0
    right
    0.0
    both
    0.0
    clutt.
    1.0
    narrow
    10.0
    narrower
    0.0
    Mean
    5.2
  • Gradient guidance
    left
    99.5
    right
    84.0
    both
    15.0
    clutt.
    98.0
    narrow
    100
    narrower
    7.0
    Mean
    67.2
  • Trust Sampling
    left
    9.0
    right
    65.5
    both
    1.0
    clutt.
    18.0
    narrow
    99.0
    narrower
    17.0
    Mean
    34.9
  • Rejection
    left
    60.0
    right
    95.0
    both
    70.5
    clutt.
    71.5
    narrow
    86.0
    narrower
    93.5
    Mean
    79.4
  • Projection
    left
    100
    right
    100
    both
    100
    clutt.
    100
    narrow
    99.0
    narrower
    100
    Mean
    99.8
  • SafeDiffuser
    left
    100
    right
    100
    both
    100
    clutt.
    100
    narrow
    100
    narrower
    100
    Mean
    100
  • SafeFlowMatcher
    left
    95.0
    right
    77.5
    both
    88.0
    clutt.
    10.5
    narrow
    0.0
    narrower
    0.0
    Mean
    45.2
Composing a hard constraint with a soft preference.

On the cluttered scenario we add to the obstacle constraint the preference L(\mathbf{a})=(y-y_{\mathrm{ref}})^{2} with y_{\mathrm{ref}}{=}0.7. CS-Pi applies the proximal step for the preference and then the projection, so the constraint takes precedence; gradient guidance and Trust Sampling descend a single weighted sum of the collision cost and the preference. A rollout meets both if it is collision-free and its mean height error \overline{|y_{t}-0.7|} is below 0.05. CS-Pi meets both on every rollout for k\in\{30,100,200\}; no setting of gradient guidance or Trust Sampling meets both (Table 8, Fig. 8): low settings collide and high settings stay far from y_{\mathrm{ref}}. Projection alone and rejection cannot target a preference and are omitted.

Table 8: Constraint and preference on 2D Avoidance (cluttered), 150 chunks per setting.
  • Unconstrained
    Setting
    –
    Both met (%)
    0
    Collision (%)
    35.3
    Mean |y-0.7|
    0.195
    NFE
    10
  • Gradient guidance
    Setting
    \alpha{=}0.1
    Both met (%)
    0
    Collision (%)
    31.3
    Mean |y-0.7|
    0.194
    NFE
    10
  • No data
    Setting
    \alpha{=}0.3
    Both met (%)
    0
    Collision (%)
    28.0
    Mean |y-0.7|
    0.193
    NFE
    10
  • No data
    Setting
    \alpha{=}1
    Both met (%)
    0
    Collision (%)
    19.3
    Mean |y-0.7|
    0.189
    NFE
    10
  • No data
    Setting
    \alpha{=}3
    Both met (%)
    0
    Collision (%)
    0
    Mean |y-0.7|
    0.178
    NFE
    10
  • No data
    Setting
    \alpha{=}10
    Both met (%)
    0
    Collision (%)
    0
    Mean |y-0.7|
    0.150
    NFE
    10
  • Trust Sampling
    Setting
    w{=}0.01
    Both met (%)
    0
    Collision (%)
    25.3
    Mean |y-0.7|
    0.190
    NFE
    70
  • No data
    Setting
    w{=}0.05
    Both met (%)
    0
    Collision (%)
    0
    Mean |y-0.7|
    0.166
    NFE
    70
  • No data
    Setting
    w{=}0.1
    Both met (%)
    0
    Collision (%)
    0
    Mean |y-0.7|
    0.135
    NFE
    70
  • CS-Pi
    Setting
    k{=}1
    Both met (%)
    0
    Collision (%)
    0
    Mean |y-0.7|
    0.188
    NFE
    110
  • No data
    Setting
    k{=}10
    Both met (%)
    0
    Collision (%)
    0
    Mean |y-0.7|
    0.099
    NFE
    82
  • No data
    Setting
    k{=}20
    Both met (%)
    0
    Collision (%)
    0
    Mean |y-0.7|
    0.065
    NFE
    63
  • No data
    Setting
    k{=}30
    Both met (%)
    \mathbf{100}
    Collision (%)
    0
    Mean |y-0.7|
    0.043
    NFE
    45
  • No data
    Setting
    k{=}100
    Both met (%)
    \mathbf{100}
    Collision (%)
    0
    Mean |y-0.7|
    0.010
    NFE
    23
  • No data
    Setting
    k{=}200
    Both met (%)
    \mathbf{100}
    Collision (%)
    0
    Mean |y-0.7|
    \mathbf{0.007}
    NFE
    21
Figure 8: Constraint and preference on 2D Avoidance (cluttered). No setting of gradient guidance (\alpha) or Trust Sampling (w) satisfies both the obstacle constraint and the (y-0.7)^{2} preference: low settings collide, high settings stay far from y_{\mathrm{ref}}{=}0.7. CS-Pi meets both.

Appendix E Why gradient guidance fails

Gradient guidance steers a flow-matching policy toward a cost L defined on the clean action a_{1}, such as a collision cost or an orientation error. During sampling the integrator only ever holds a partially denoised state a_{t} at time t\in(0,1), and the cost of a noisy state carries no information about the cost of the clean action it will become: L(a_{t}) and L(a_{1}) are unrelated. Guidance therefore cannot evaluate the cost at a_{t}. It must instead predict the clean action the current state will denoise into and evaluate the cost there. This requirement, forced by the cost being defined on a_{1}, is the root of the failure.

The guidance direction one would want.

Guidance aims to sample from the tilted distribution p^{\star}(a)\propto\pi_{\theta}(a)\,\exp(-\beta L(a)), which concentrates the policy on low-cost actions with strength \beta. The exact correction this adds to the velocity at a_{t} is the score of the tilt, \nabla_{a_{t}}\log\mathbb{E}_{p(a_{1}\mid a_{t})}[\exp(-\beta L(a_{1}))]. To first order in \beta this reduces to the posterior-mean gradient

g^{\star}(a_{t})\;=\;\mathbb{E}_{p(a_{1}\mid a_{t})}\!\big[\nabla L(a_{1})\big],
(4)

the cost gradient averaged over every clean action the noisy state could still become, weighted by the denoising posterior p(a_{1}\mid a_{t}). Equation (4) is the guidance one would want: it accounts for the policy’s remaining uncertainty about a_{1}.

The Jensen swap.

The expectation in Eq. (4) is intractable. The posterior p(a_{1}\mid a_{t}) is defined only implicitly through the flow and has no closed form. Every gradient-guidance method makes the same substitution: it moves the gradient outside the expectation,

\mathbb{E}_{p(a_{1}\mid a_{t})}\!\big[\nabla L(a_{1})\big]\;\approx\;\nabla L\!\big(\mathbb{E}_{p(a_{1}\mid a_{t})}[a_{1}]\big)\;=\;\nabla L(\bar{a}(a_{t})),
(5)

replacing the expected gradient by the gradient at the expected action, the proxy \bar{a}(a_{t})=\mathbb{E}[a_{1}\mid a_{t}]. This is exact only when \nabla L is affine over the support of the posterior, that is, when L is quadratic there. For a general cost the two sides differ by the Jensen gap; a second-order expansion of L about \bar{a} gives

\underbrace{\mathbb{E}[L(a_{1})]-L(\bar{a})}_{\text{Jensen gap}}\;=\;\tfrac{1}{2}\,\big\langle\nabla^{2}L(\bar{a}),\,\mathrm{Cov}(a_{1}\mid a_{t})\big\rangle+\dots,
(6)

and differentiating leaves a drift error of the same character: it scales with the curvature of the cost and with the spread of the denoising posterior. Both factors are largest exactly where guidance must act. The covariance \mathrm{Cov}(a_{1}\mid a_{t}) is wide at high noise, before the policy has committed to an action; and a hard constraint is the limit of a cost that is 0 on \mathcal{C} and unbounded off it, whose curvature diverges at the boundary.

The proxy is the Tweedie mean.

The proxy \bar{a}(a_{t})=\mathbb{E}[a_{1}\mid a_{t}] is the posterior mean of the clean action (the Tweedie estimate); for a flow policy it is recovered by a single integration step from a_{t} to t=1. When the posterior is unimodal and narrow, the proxy is accurate and the swap is benign. When the policy is still uncertain between distinct clean actions, the posterior is multimodal and its mean lies between the modes, at an action the policy assigns almost no mass and that need not be valid. The gradient \nabla L(\bar{a}) is then computed at a point on no mode. No choice of \beta or step size repairs this, because the error is in where the gradient is evaluated, not in its magnitude.

3D-Orient: a worked failure.

The orientation preference of Sec. 4.3 is exactly this multimodal case. The cost L(q)=\lambda\lVert R(q)-R^{\star}\rVert_{F}^{2} on the seven joint angles has several minima because of inverse-kinematics redundancy: many distinct configurations reach the target orientation. When the denoising posterior places mass on two such branches, the proxy is their joint-space average, which lies between the basins and is not itself a valid configuration; it breaks both the position and the orientation target. Fig. 9 shows two minima 0.02 mm apart in end-effector position whose joint-space mean lands 31 cm away. The gradient there has no consistent relation to the gradient at either branch, so guidance that descends it cannot honor the orientation without abandoning the reach (Table 3). CS-Pi evaluates the cost only on clean draws, each inside a single basin.

Figure 9: Saddle-ridge configuration of the orientation cost, rendered on the Franka. Inverse kinematics on a central target p^{*}=(0.45,0.05,0.50). (A), (B): two minima of L at the same end-effector position (0.02 mm apart) with distinct joint configurations (blue: elbow up; red: elbow rotated and wrist twisted). (C): the configuration \bar{q}=(q_{1}+q_{2})/2 that gradient guidance evaluates when its posterior places mass on both branches; the black dot marks its end-effector position, \mathbf{31} cm from the target. The average breaks both the position and the orientation target, although both minima satisfy them.

Appendix F Exact per-iteration sampling law

This section makes precise the Gaussian-window interpretation of one CS-Pi iteration. The model’s conditional law admits the closed form below, whereas a deterministic numerical flow defines a pushforward kernel whose density need not equal that conditional law.

Setup.

Let the flow-matching interpolant be

\mathbf{A}_{t}=t\mathbf{A}_{1}+(1-t)\bm{\varepsilon},\qquad\bm{\varepsilon}\sim\mathcal{N}(\mathbf{0},I),\quad\mathbf{A}_{1}\sim\pi_{\theta},
(7)

so p(\mathbf{A}_{t}\mid\mathbf{A}_{1}=\mathbf{a})=\mathcal{N}(\mathbf{A}_{t};t\mathbf{a},(1-t)^{2}I). At iteration i, define

\mathbf{a}_{c}^{(i)}=\mathcal{P}(\hat{\mathbf{a}}^{(i)}),\qquad\delta^{(i)}=\|\hat{\mathbf{a}}^{(i)}-\mathbf{a}_{c}^{(i)}\|,\qquad n^{(i)}=\frac{k}{k+\delta^{(i)}}.
(8)

For \delta^{(i)}>0, the rule for n gives

\frac{1-n^{(i)}}{n^{(i)}}=\frac{\delta^{(i)}}{k}=\sigma^{(i)}.
(9)
Proposition 1 (Conditional law of one iteration).

Fix \bm{\mu}^{(i)}\in\mathbb{R}^{D} and form

\mathbf{a}_{n}^{(i)}=n^{(i)}\mathbf{a}_{c}^{(i)}+(1-n^{(i)})\bm{\mu}^{(i)}.
(10)

If re-denoising draws from the model conditional p(\mathbf{A}_{1}\mid\mathbf{A}_{n^{(i)}}=\mathbf{a}_{n}^{(i)}), then the next draw has density

q^{(i)}(\mathbf{a})=\frac{1}{Z_{i}}\,\pi_{\theta}(\mathbf{a})\exp\!\left[-\frac{\|\mathbf{a}-\tilde{\mathbf{a}}_{c}^{(i)}\|^{2}}{2(\sigma^{(i)})^{2}}\right],\qquad\tilde{\mathbf{a}}_{c}^{(i)}=\mathbf{a}_{c}^{(i)}+\sigma^{(i)}\bm{\mu}^{(i)},
(11)

where Z_{i} is independent of \mathbf{a}: the policy seen through a Gaussian window with standard deviation \sigma^{(i)}=\delta^{(i)}/k.

Proof.

Bayes’ rule and Eq. (7) give

\displaystyle q^{(i)}(\mathbf{a}) \\ \displaystyle\propto\pi_{\theta}(\mathbf{a})\,p(\mathbf{a}_{n}^{(i)}\mid\mathbf{A}_{1}=\mathbf{a})\propto\pi_{\theta}(\mathbf{a})\,\exp\!\left(-\frac{\|\mathbf{a}_{n}^{(i)}-n^{(i)}\mathbf{a}\|^{2}}{2(1-n^{(i)})^{2}}\right).
(12)

Using Eq. (10), \mathbf{a}_{n}^{(i)}-n^{(i)}\mathbf{a}=n^{(i)}\big(\mathbf{a}_{c}^{(i)}+\tfrac{1-n^{(i)}}{n^{(i)}}\bm{\mu}^{(i)}-\mathbf{a}\big). Substituting Eq. (9) yields Eq. (11). ∎

Center and endpoint cases.

For \bm{\mu}^{(i)}=\mathbf{0} the window is centered on the projection \mathbf{a}_{c}^{(i)}. Algorithm 1 uses \bm{\mu}^{(i)}=\bm{\epsilon}^{(i)}\sim\mathcal{N}(\mathbf{0},I); conditional on that draw, Proposition 1 remains exact with center \mathbf{a}_{c}^{(i)}+\sigma^{(i)}\bm{\epsilon}^{(i)}. At n=0 the iteration is an unconditional redraw, as in rejection sampling; at n=1 it returns the anchor, as in projection.

Scope.

Proposition 1 is a per-iteration statement. It assumes exact posterior re-denoising; it does not establish that deterministic ODE integration samples this conditional, nor does it imply a stationary distribution, a convergence rate, or a bound after several iterations. Empirically, the projection residual decreases across iterations (App. H).

Appendix G Hyperparameter sweeps and configuration selection

Every method in the main tables is reported at its best swept configuration. logL is the mean exact log-likelihood under \pi_{\theta} (nats/dim); NFE is the mean number of flow-model calls per rollout.

Swept hyperparameters.

For CS-Pi we sweep k, the iteration cap K_{\max} and the terminal projection (on/off). For gradient guidance we sweep the step size \alpha. For Trust Sampling we sweep the step size w, the maximum number of guidance steps per denoising step J, the schedule (constant vs. linear), whether a projection is applied after each step (“post-projection”), and, where a joint-limit penalty applies, its weight.

3D Sphere-Avoid.

Gradient guidance was swept over \alpha\in[3\cdot 10^{-4},0.3] (best \alpha{=}0.01: 23.6\% / 4.7\%) and Trust Sampling over w\in[0.01,1.0] with constant and linear schedules (best w{=}0.3, J{=}5: 77.0\% / 38.7\%). Table 9 gives CS-Pi across k (K_{\max}{=}20, no early stopping). Success rises with k and saturates on L1 by k{=}20. Table 5 uses k{=}50; k{=}100 is 4.3 points higher on L2.

Table 9: CS-Pi on Sphere-Avoid across k (K_{\max}{=}20, no early stopping; the same evaluation as the no-stopping row of Table 13). Table 5 is a separate evaluation, so its values at k{=}50 differ slightly.
  • Safe-SR L1 / L2
    1
    90.1 / 59.8
    10
    97.8 / 77.7
    20
    99.6 / 88.3
    50
    99.4 / 90.2
    100
    99.8 / 94.5
  • NFE L1
    1
    72.0
    10
    24.4
    20
    20.9
    50
    19.2
    100
    18.7
2D Avoidance.

Gradient guidance uses the best \alpha per scenario (macro 67.2\%; Table 7); Trust Sampling reaches 34.9\%. CS-Pi reaches 99.2–99.3\% for k\in\{5,10,20\} (Table 19).

Shelf.

Table 10 gives the full Trust Sampling sweep. Without post-projection Trust Sampling peaks at 53.3\% (w{=}0.1, J{=}5), the reported configuration. With post-projection it peaks at 43.3\%; post-projection is a terminal projection, which no baseline uses in the main tables. CS-Pi across k (K_{\max}{=}20, no early stopping): 70.7 / 78.7 / 80.0 / 76.7 / 69.3\% at k{=}5 / 10 / 20 / 50 / 100 (NFE 398 / 376 / 353 / 306 / 290); Table 2 uses k{=}50, K_{\max}{=}5 (81.3\%).

Table 10: Trust Sampling on Shelf: safe success (%) over w\times J, 150 tasks per cell (–: not run). Bold: the reported configuration (logL 12.23, NFE 1104).
  • 0.005
    no post-projection J{=}2
    2.7
    no post-projection J{=}5
    6.0
    no post-projection J{=}10
    4.0
    post-projection J{=}2
    29.3
    post-projection J{=}5
    30.7
    post-projection J{=}10
    32.7
  • 0.01
    no post-projection J{=}2
    3.3
    no post-projection J{=}5
    4.0
    no post-projection J{=}10
    11.3
    post-projection J{=}2
    30.0
    post-projection J{=}5
    33.3
    post-projection J{=}10
    34.0
  • 0.05
    no post-projection J{=}2
    9.3
    no post-projection J{=}5
    38.7
    no post-projection J{=}10
    –
    post-projection J{=}2
    31.3
    post-projection J{=}5
    36.0
    post-projection J{=}10
    35.3
  • 0.1
    no post-projection J{=}2
    28.0
    no post-projection J{=}5
    \mathbf{53.3}
    no post-projection J{=}10
    51.3
    post-projection J{=}2
    33.3
    post-projection J{=}5
    32.0
    post-projection J{=}10
    43.3
3D-Orient.

We report gradient guidance at two step sizes: \alpha{=}0.003 keeps most of the reach (70.0\%) and \alpha{=}0.03 gives its best success (6.7\%); larger and smaller values are worse. Trust Sampling uses w{=}0.001 with the joint-limit penalty. CS-Pi uses k{=}10, K_{\max}{=}3, \lambda_{ee}{=}3000, \beta{=}10^{6}.

Figure 10: Constraint and preference: sweep. Fraction of rollouts meeting both for CS-Pi (k), gradient guidance (\alpha) and Trust Sampling (w); only CS-Pi meets both, for k\in\{30,100,200\}.
Figure 11: Trajectories under the constraint and the (y-0.7)^{2} preference, five settings per method. Only CS-Pi’s sweep contains settings that satisfy both; guidance and Trust Sampling trade one for the other at every setting.

Appendix H Empirical convergence: time n and projection residual

A successful CS-Pi loop drives the projection residual \delta to zero, and therefore n=k/(k+\delta) to 1. We log both per iteration (Table 11; for 3D-Orient and the preference, \delta is the proximal-step residual). Means are over loops still running at that iteration; for 2D we give the first and last iteration per group of scenarios.

Table 11: Time n and projection residual per iteration.
  • 2D left/right/narrow (10)
    loops
    –
    mean n per iteration
    0.64–0.81\to 0.99+
    residual first \to last
    2.7–6.3\to\approx 0.1
  • 2D both/cluttered (10)
    loops
    –
    mean n per iteration
    0.63–0.68\to 0.98
    residual first \to last
    6–8\to 0.5–0.7
  • 2D narrower (10)
    loops
    –
    mean n per iteration
    0.73\to 0.80 (stalls)
    residual first \to last
    4.1\to 2.9
  • 2D constraint + preference (100)
    loops
    150
    mean n per iteration
    0.743,0.881,0.919,0.936,0.946,0.953
    residual first \to last
    34.6\to 3.42
  • Sphere-Avoid L1 (50)
    loops
    120
    mean n per iteration
    0.991,0.997,0.999,0.999,0.999,0.999
    residual first \to last
    0.478\to 0.0071
  • Sphere-Avoid L2 (50)
    loops
    120
    mean n per iteration
    0.985,0.993,0.995,0.997,0.997,0.997
    residual first \to last
    0.767\to 0.0497
  • Sphere-Avoid L1 (10)
    loops
    119
    mean n per iteration
    0.955,0.977,0.986,0.991,0.993,0.994
    residual first \to last
    0.467\to 0.0225
  • Shelf (50)
    loops
    1508
    mean n per iteration
    0.994,0.998,0.999,0.999,0.999
    residual first \to last
    0.287\to 0.0376
  • Shelf (1)
    loops
    1602
    mean n per iteration
    0.808,0.818,0.817,0.817,0.817
    residual first \to last
    0.237\to 0.224
  • 3D-Orient (10)
    loops
    1440
    mean n per iteration
    0.940,0.966,0.978
    residual first \to last
    0.633\to 0.222
  • 3D-Orient (1)
    loops
    1440
    mean n per iteration
    0.633,0.667,0.673
    residual first \to last
    0.579\to 0.487
Where n approaches 1.

On Sphere-Avoid and Shelf at their chosen k the residual falls 7\times (Shelf) to 67\times (L1). Because the residuals are small relative to k, n is close to 1 from the first iteration: the loop re-runs the policy from a barely noised anchor, so each draw stays close to the projection. Lowering k to 10 on Sphere-Avoid lowers the first-iteration n to 0.955 and the loop still converges.

Where it does not.

With k{=}1 on Shelf and 3D-Orient the loop stalls (n stays at 0.82 and 0.67; the residual barely falls). On Shelf this costs safe success (66.7 vs. 81.3\%); on 3D-Orient it costs NFE (348 vs. 210) and log-likelihood (9.53 vs. 10.21) but not success (64.4 vs. 65.6\%). Under the preference the residual falls tenfold but never reaches zero: the proximal step always has a lower cost to move toward, so the loop refines rather than terminates. 3D-Orient keeps a small residual (0.22) because the orientation target is never met exactly. On the easy 2D scenarios n rises above 0.99 within about four iterations and the residual falls about 100\times; on narrower, the hardest scene, n rises only from 0.73 to 0.80 and the residual stalls (4.1\to 2.9).

Appendix I Early stopping

When the residual stops improving, further iterations cost compute without helping. We compare four stopping rules: none; stop when n>0.8; stop when n>0.9; and patience, which stops when the last five iterations close less than 5\% of the remaining gap between n and 1 (Tables 13–14; K_{\max}{=}20).

The threshold rules are tuned to 2D and do not transfer. On Sphere-Avoid and Shelf, n is close to 1 from the first iteration at moderate and large k, so these rules stop almost immediately and CS-Pi performs close to projection (88.2 / 62.1\% on Sphere-Avoid, 55–63\% on Shelf). The patience rule is a trade-off rather than a free saving. Patience matches no stopping on Shelf (80.7 vs. 80.0\% at k{=}20) at 13\% fewer NFE, and on Sphere-Avoid L1 (99.5 vs. 99.4\% at k{=}50) at slightly lower NFE, but costs 6 points on L2 (84.0 vs. 90.2\%). On 2D (Table 12; means over 11 values of k and the six scenarios, 200 rollouts each) the patience rule matches the best threshold rule (0.868 vs. 0.864 success) at 36\% fewer NFE than it and 54\% fewer than no stopping. It also removes an over-refinement failure: at high k on narrower, running without stopping collapses to \sim 0\%, while the rule holds 100\%.

Table 12: Early stopping on 2D Avoidance, means over 11 values of k and six scenarios (K_{\max}{=}20).
  • none
    Success
    0.825
    NFE
    447
    Iterations
    3.94
  • n>0.8
    Success
    0.864
    NFE
    322
    Iterations
    2.62
  • n>0.9
    Success
    0.863
    NFE
    336
    Iterations
    2.85
  • patience
    Success
    \mathbf{0.868}
    NFE
    \mathbf{206}
    Iterations
    \mathbf{1.59}
Table 13: Early stopping on Sphere-Avoid: safe success L1 / L2 (%) and, in parentheses, L1 NFE.
  • none
    k{=}1
    90.1/59.8 (72)
    k{=}10
    97.8/77.7 (24)
    k{=}20
    99.6/88.3 (21)
    k{=}50
    99.4/90.2 (19)
    k{=}100
    99.8/94.5 (19)
  • n>0.8
    k{=}1
    90.4/62.9 (54)
    k{=}10
    88.2/62.1 (10)
    k{=}20
    88.2/62.1 (10)
    k{=}50
    88.2/62.1 (10)
    k{=}100
    88.2/62.1 (10)
  • n>0.9
    k{=}1
    91.2/64.5 (68)
    k{=}10
    88.2/60.2 (10)
    k{=}20
    88.2/62.1 (10)
    k{=}50
    88.2/62.1 (10)
    k{=}100
    88.2/62.1 (10)
  • patience
    k{=}1
    89.5/64.5 (31)
    k{=}10
    96.6/75.8 (22)
    k{=}20
    98.3/81.6 (20)
    k{=}50
    99.5/84.0 (18)
    k{=}100
    99.2/88.3 (17)
Table 14: Early stopping on Shelf: safe success (%) and, in parentheses, NFE.
  • none
    k{=}5
    70.7 (398)
    k{=}10
    78.7 (376)
    k{=}20
    80.0 (353)
    k{=}50
    76.7 (306)
    k{=}100
    69.3 (290)
  • n>0.8
    k{=}5
    56.0 (255)
    k{=}10
    56.0 (240)
    k{=}20
    55.3 (240)
    k{=}50
    56.7 (240)
    k{=}100
    55.3 (240)
  • n>0.9
    k{=}5
    62.7 (272)
    k{=}10
    62.0 (253)
    k{=}20
    58.0 (240)
    k{=}50
    57.3 (240)
    k{=}100
    57.3 (240)
  • patience
    k{=}5
    72.7 (312)
    k{=}10
    76.0 (307)
    k{=}20
    80.7 (307)
    k{=}50
    79.3 (291)
    k{=}100
    70.7 (280)

Appendix J Terminal projection: guarantee, how often it fires, and its cost

Guarantee and per-benchmark use.

With the terminal projection in Algorithm 1, every executed action lies in \mathcal{C}, provided \mathcal{C} is nonempty and \mathcal{P} is exact. This is the projection’s guarantee, not one supplied by the loop; the loop’s role is to reduce the residual before that step. We use the terminal projection on 2D Avoidance, Sphere-Avoid, Shelf and hardware, and not on 3D-Orient, where the target is a preference. No baseline uses one.

On versus off.

Table 15 runs CS-Pi with and without the terminal projection. Without it, CS-Pi still has the highest safe success on Shelf (74.0\%, against 55.3\% for projection and 53.3\% for Trust Sampling) and on Sphere-Avoid L2 (69.9\%, against 62.1\% and 38.7\%); log-likelihood barely changes on these benchmarks.

Table 15: CS-Pi with and without the terminal projection. Fire rate: fraction of sampler calls still outside the tolerance after K_{\max} iterations (Shelf: per plan step; Sphere-Avoid: per task, over the tasks with a safe goal configuration).
  • Sphere-Avoid L1
    Terminal proj.
    on
    Safe-SR
    99.9
    logL mean
    2.87
    logL median
    2.81
    Fire rate
    6.7\%
    NFE
    20
  • No data
    Terminal proj.
    off
    Safe-SR
    98.1
    logL mean
    2.87
    logL median
    2.81
    Fire rate
    –
    NFE
    20
  • Sphere-Avoid L2
    Terminal proj.
    on
    Safe-SR
    91.8
    logL mean
    2.54
    logL median
    2.27
    Fire rate
    46.9\%
    NFE
    26
  • No data
    Terminal proj.
    off
    Safe-SR
    69.9
    logL mean
    2.55
    logL median
    2.27
    Fire rate
    –
    NFE
    26
  • Shelf
    Terminal proj.
    on
    Safe-SR
    81.3
    logL mean
    17.96
    logL median
    9.68
    Fire rate
    14.7\%
    NFE
    271
  • No data
    Terminal proj.
    off
    Safe-SR
    74.0
    logL mean
    17.59
    logL median
    9.94
    Fire rate
    –
    NFE
    270
Log-likelihood of the chunks where it fires.

Table 16 splits CS-Pi’s chunks by whether the terminal projection fired. On Sphere-Avoid L1 and Shelf, the chunks where it fired keep a median log-likelihood at or above one-shot projection’s (2.90 vs. 2.41; 14.70 vs. 8.45); on L2 they match it (2.11 vs. 2.13). These chunks are the hardest subset by construction, whereas the projection column is the median over all of projection’s chunks.

On hardware the terminal projection fires on 91 of 1879 chunks (4.8\%; 2.3\% in layout 1, 6.2\% in layout 2; in 15 of 20 trials), and those chunks score lower than projection (-518.0 vs. -473.2). The raw policy draws in these chunks are typical (median -463.1, against -464.2 for chunks that converged), so the drop comes from the terminal projection rather than from atypical draws. Before it fires, the loop has removed about 41\% of the initial violation; the projection then moves the chunk by a median of 13.7 mm of end-effector motion (0.56\times the chunk’s own motion, 1.6\% of the workspace; p95 170 mm), and leaves a median residual penetration of 9.7 mm (p95 40.3 mm), so on hardware the terminal projection at the iteration cap does not certify feasibility. Chunks that converged execute an unmodified policy sample with median residual penetration 0.0 mm (p95 0.76 mm).

Table 16: Chunks where the terminal projection fires. Fire rate and median logL of converged and fired chunks, with projection and the unconstrained policy as references. Medians, because a few fired chunks dominate the mean.
  • Sphere-Avoid L1
    Fires
    6.7\%
    Converged
    2.81
    Fired
    2.90
    Projection
    2.41
    Unconstrained
    2.74
  • Sphere-Avoid L2
    Fires
    46.9\%
    Converged
    2.43
    Fired
    2.11
    Projection
    2.13
    Unconstrained
    2.90
  • Shelf
    Fires
    14.7\%
    Converged
    9.36
    Fired
    14.70
    Projection
    8.45
    Unconstrained
    10.00
  • Hardware
    Fires
    4.8\%
    Converged
    -469.1
    Fired
    -518.0
    Projection
    -473.2
    Unconstrained
    -470.2
When \mathcal{C} misses the policy’s support.

If \mathcal{C} is nonempty but the policy assigns it negligible mass, no sampler can return an action that is both safe and plausible. CS-Pi then degrades toward its terminal projection. A residual that stops shrinking, equivalently an n that stops rising, is a runtime signal of this case; App. I turns it into a stopping rule. On 2D narrower the residual falls from 4.1 to 2.9 and then stalls, with n stuck near 0.80 (App. H).

Appendix K Compute

NFE counts flow-network calls but omits projection and proximal solves and the backward passes of gradient guidance and Trust Sampling. Table 17 reports wall-clock time per rollout, measured on a single machine. CS-Pi costs 2.1\times projection on Sphere-Avoid and 1.6\times on Shelf, because of its projection and proximal solves. It is 67\times faster than Trust Sampling on 2D, 1.2\times faster on Shelf, equal on 3D-Orient, and 2.1\times slower on Sphere-Avoid. The CBF samplers are the most expensive on Sphere-Avoid and Shelf. Hardware compute is in App. P.1.

Table 17: Wall-clock time per rollout (s), including flow calls, backward passes, projection and proximal solves.
  • Unconstrained
    2D
    0.19
    Sphere-Avoid
    0.19
    Shelf
    4.59
    3D-Orient
    0.47
  • Gradient guidance
    2D
    0.52
    Sphere-Avoid
    0.58
    Shelf
    22.1
    3D-Orient
    1.56
  • Trust Sampling
    2D
    8.70
    Sphere-Avoid
    2.02
    Shelf
    89.7
    3D-Orient
    12.48
  • Projection
    2D
    0.08
    Sphere-Avoid
    1.99
    Shelf
    49.0
    3D-Orient
    –
  • SafeDiffuser
    2D
    0.13
    Sphere-Avoid
    7.14
    Shelf
    164
    3D-Orient
    –
  • SafeFlowMatcher
    2D
    0.16
    Sphere-Avoid
    13.99
    Shelf
    167
    3D-Orient
    –
  • CS-Pi
    2D
    0.13
    Sphere-Avoid
    4.24
    Shelf
    76.0
    3D-Orient
    12.70

Appendix L Mechanism, sensitivity, and additional analyses

Why support membership can exceed the unconstrained policy’s.

Renoising and re-denoising pulls a sample toward high-density regions, as in SDEdit, and feasibility and support membership are positively correlated in these tasks, so stopping on feasibility further favors on-support modes. Applying one renoise and re-denoise to an unmodified draw, with no constraint or projection, raises the fully-on-support rate by up to 7.5 points and the mean fraction of on-support waypoints from 96.9\% to 98.6\%.

Sensitivity to k.

Table 18 compares the tuned k with a single fixed value for every benchmark. A single k{=}50 is within 1.2 points of the best k on 2D, Sphere-Avoid L1, Shelf and 3D-Orient, and within 4.3 points on Sphere-Avoid L2. A single k{=}20 loses up to 7.4 points (Sphere-Avoid L2). Within a benchmark, safe success varies by a few points over a broad range of k on Sphere-Avoid L1, Shelf and 3D-Orient; Sphere-Avoid L2 is more sensitive (Tables 9, 14).

Table 18: Reported versus fixed k. Safe success (%) at the k reported in Tables 1, 2, 3 and 5, and at a single k shared by every benchmark. Over all sweeps, the best k is within 1.2 points of k{=}50 except on L2, where k{=}100 is 4.3 points higher (Table 9). Shelf varies most between evaluations: four further evaluations at k{=}50 give 75.8\pm 1.8 (mean \pm standard error; 78.7 / 76.0 / 78.0 / 70.7). Each table is a separate evaluation, so values at the same k can differ slightly across tables.
  • 2D
    Reported k
    20
    Safe-SR (reported k)
    99.0
    Safe-SR (k{=}20)
    99.0
    Safe-SR (k{=}50)
    99.1
  • Sphere-Avoid L1
    Reported k
    50
    Safe-SR (reported k)
    99.9
    Safe-SR (k{=}20)
    99.2
    Safe-SR (k{=}50)
    99.9
  • Sphere-Avoid L2
    Reported k
    50
    Safe-SR (reported k)
    91.8
    Safe-SR (k{=}20)
    84.4
    Safe-SR (k{=}50)
    91.8
  • Shelf
    Reported k
    50
    Safe-SR (reported k)
    81.3
    Safe-SR (k{=}20)
    74.7
    Safe-SR (k{=}50)
    81.3
  • 3D-Orient
    Reported k
    10
    Safe-SR (reported k)
    65.6
    Safe-SR (k{=}20)
    64.4
    Safe-SR (k{=}50)
    64.4
Schedule for n.

Table 19 compares the rule n=k/(k+\delta) with a constant n and with renoising the projection with zero noise (adaptive n, \bm{\epsilon}=\mathbf{0}), on 2D Avoidance (K_{\max}{=}5, 6\times 200 rollouts). The adaptive rule fires the terminal projection least (8.7\% at k{=}20, against 15.6\% and 27.7\% for constant n{=}0.8 and 0.5). Zero-noise renoising matches the adaptive rule on fire rate and median log-likelihood.

Table 19: Schedule for n on 2D Avoidance. Fire rate is per plan step. Medians, because a few chunks where the terminal projection fires dominate the mean.
  • adaptive, k{=}5 / 10 / 20
    Fire rate
    15.0 / 9.5 / 8.7\%
    Safe-SR
    99.2 / 99.3 / 99.3
    logL median
    1.42 / 0.38 / 1.38
    NFE
    180 / 153 / 145
  • constant n{=}0.5
    Fire rate
    27.7\%
    Safe-SR
    99.1
    logL median
    0.88
    NFE
    181
  • constant n{=}0.8
    Fire rate
    15.6\%
    Safe-SR
    99.6
    logL median
    -2.23
    NFE
    161
  • zero noise, k{=}5 / 10 / 20
    Fire rate
    15.0 / 9.0 / 8.6\%
    Safe-SR
    99.0 / 99.6 / 99.8
    logL median
    1.16 / 1.38 / 1.42
    NFE
    183 / 150 / 144
Smoothness.

Table 20 reports the per-rollout maximum acceleration and jerk (second and third differences of the executed trajectory). On Shelf CS-Pi is within 5\% of the unconstrained policy (acceleration +4.5\%, jerk +4.8\%), and projection is the least smooth. On Sphere-Avoid CS-Pi is within 1\% on L1 and +14\% / +11\% on L2, matching projection. On 2D the means are similar across methods, but CS-Pi and projection have heavier 95th-percentile tails (2.2–4.2\times the unconstrained policy). On 3D-Orient CS-Pi’s end-effector step matches the unconstrained policy (0.07 m), but its joint-space acceleration is about 14\times and its jerk about 11\times higher: the end-effector proximal step uses the arm’s redundant joints. We therefore claim end-effector, not joint-space, smoothness on 3D-Orient.

Table 20: Smoothness: per-rollout maximum joint-space acceleration and jerk, mean and 95th percentile over rollouts.
  • Benchmark
    Method
    Acceleration
    mean
    p95
    Jerk
    mean
    p95
  • Shelf
    Unconstrained
    Acceleration
    0.518
    0.626
    Jerk
    0.841
    1.000
  • No data
    CS-Pi
    Acceleration
    0.541
    0.651
    Jerk
    0.882
    1.073
  • No data
    Projection
    Acceleration
    0.549
    0.666
    Jerk
    0.907
    1.097
  • No data
    Gradient guidance
    Acceleration
    0.521
    0.619
    Jerk
    0.874
    1.013
  • No data
    Trust Sampling
    Acceleration
    0.524
    0.614
    Jerk
    0.878
    0.983
  • No data
    Rejection
    Acceleration
    0.521
    0.618
    Jerk
    0.845
    0.966
  • Sphere-Avoid L1
    Unconstrained
    Acceleration
    0.165
    0.243
    Jerk
    0.138
    0.221
  • No data
    CS-Pi
    Acceleration
    0.166
    0.241
    Jerk
    0.137
    0.215
  • No data
    Projection
    Acceleration
    0.171
    0.248
    Jerk
    0.142
    0.222
  • Sphere-Avoid L2
    Unconstrained
    Acceleration
    0.166
    0.216
    Jerk
    0.139
    0.196
  • No data
    CS-Pi
    Acceleration
    0.189
    0.247
    Jerk
    0.155
    0.217
  • No data
    Projection
    Acceleration
    0.192
    0.246
    Jerk
    0.155
    0.201
  • 2D
    Unconstrained
    Acceleration
    0.0058
    0.0088
    Jerk
    0.0061
    0.0092
  • No data
    CS-Pi
    Acceleration
    0.0068
    0.0196
    Jerk
    0.0090
    0.0306
  • No data
    Projection
    Acceleration
    0.0060
    0.0198
    Jerk
    0.0087
    0.0390
  • 3D-Orient
    Unconstrained
    Acceleration
    0.165
    0.204
    Jerk
    0.277
    0.347
  • No data
    CS-Pi
    Acceleration
    2.254
    4.574
    Jerk
    2.958
    8.812
  • No data
    Gradient guidance (\alpha{=}0.03)
    Acceleration
    0.905
    1.499
    Jerk
    1.355
    2.667
CBF certificates.

A safety certificate alone does not make a sample useful: projection already supplies one. Only SafeDiffuser matches CS-Pi, and only on 2D (Table 1); both CBF samplers trail it on Sphere-Avoid (Table 5) and Shelf (Table 2). SafeFlowMatcher on Shelf uses \rho{=}0.7, \epsilon{=}5, \alpha{=}0.07, T_{p}{=}10, T_{c}{=}8 (swept \rho\in\{0.6,0.7,0.8\}).

Appendix M Blocked-mode diagnostic

This experiment isolates the claim in Sec. 2 that a correction applied during denoising can move a sample out of an unsafe region but cannot move it to another mode of the policy. A flow-matching policy is trained on a symmetric two-mode Gaussian mixture in 2D (modes at (\pm 1.2,0), standard deviation 0.18). A disk of radius 0.55 centered on the left mode blocks it entirely. Because the problem is 2D, exact log-likelihoods and exact rejection sampling are tractable, so every method is compared with the correct answer: the policy restricted to the safe set. We evaluate the blocked subset, the 241 of 500 paired initial draws that land in the blocked mode (Fig. 12).

Table 21: Blocked-mode diagnostic, blocked subset (241 draws). \Delta\log p: change in exact log-likelihood relative to the unconstrained policy. Every method returns a safe action on all draws.
  • Rejection (exact reference)
    Moved to the surviving mode
    92.5\%
    median \Delta\log p
    -0.03
    NFE
    284
  • CS-Pi
    Moved to the surviving mode
    85.9\%
    median \Delta\log p
    -0.08
    NFE
    282
  • Projection
    Moved to the surviving mode
    0.0\%
    median \Delta\log p
    -3.56
    NFE
    100
  • SafeDiffuser (\lambda{=}50)
    Moved to the surviving mode
    0.0\%
    median \Delta\log p
    -3.56
    NFE
    100
  • SafeFlowMatcher (published defaults)
    Moved to the surviving mode
    0.0\%
    median \Delta\log p
    -6.42
    NFE
    257

All methods are safe on every draw, so safety does not separate them (Table 21). CS-Pi moves 85.9\% of blocked draws to the surviving mode at a log-likelihood within 0.05 nats of exact rejection and at the same cost. Projection, SafeDiffuser and SafeFlowMatcher at its published defaults move none: each applies a deterministic correction to the blocked sample, so its output stays near the blocked mode. In a control where the constraint touches neither mode, CS-Pi is statistically indistinguishable from the unconstrained policy. SafeFlowMatcher was swept over 577 configurations, SafeDiffuser over 3, and CS-Pi over 27. One SafeFlowMatcher setting (a single prediction step) does move most blocked draws, but it moves samples to one mode even when the constraint touches neither mode, and returns unsafe actions when the policy has a single mode, so the move is not driven by the constraint.

Figure 12: Blocked-mode diagnostic, left mode blocked. Rejection and CS-Pi move blocked draws to the surviving mode; the other methods stay safe but land in low-likelihood regions of the policy.

Appendix N Reliability of posterior-mean guidance and approximate projection

The guidance proxy in Eq. (5) can fail even for a unimodal posterior. The relevant quantity is how quickly the cost curvature varies over the posterior’s spread.

Proposition 2 (Posterior-mean gradient error).

Let p(a_{1}\mid a_{t}) have mean \bar{a} and finite second moment. If L has an L_{H}-Lipschitz Hessian in operator norm on the relevant domain, then

\left\|\mathbb{E}_{p(a_{1}\mid a_{t})}[\nabla L(a_{1})]-\nabla L(\bar{a})\right\|\leq\frac{L_{H}}{2}\,\mathrm{tr}\,\mathrm{Cov}(a_{1}\mid a_{t}).
(13)
Proof.

Taylor expansion of \nabla L about \bar{a} gives \nabla L(a_{1})=\nabla L(\bar{a})+\nabla^{2}L(\bar{a})(a_{1}-\bar{a})+r(a_{1}) with \|r(a_{1})\|\leq\frac{L_{H}}{2}\|a_{1}-\bar{a}\|^{2} [28, Lemma 1.2.4]. Taking expectations cancels the linear term; then \|\mathbb{E}[r]\|\leq\mathbb{E}\|r\|\leq(L_{H}/2)\mathbb{E}\|a_{1}-\bar{a}\|^{2} and \mathbb{E}\|a_{1}-\bar{a}\|^{2}=\mathrm{tr}\,\mathrm{Cov}(a_{1}\mid a_{t}). ∎

The proxy is therefore reliable when the curvature varies slowly at the scale of the posterior’s spread. Multimodality is not required for bias: a wide unimodal posterior suffices. Multimodality creates the more severe case, in which the posterior mean lies off-support between modes.

Approximate and non-convex projections.

For non-convex \mathcal{C} the projection can be set-valued, and iterative solvers may return only a local or approximate solution. During CS-Pi iterations this point is an anchor rather than the executed action, so renoising and re-denoising can absorb anchor error and move to another mode. Projection has no such correction. Only CS-Pi’s optional terminal step executes a projection; exact safety of the executed action still requires that step to be exact.

Appendix O Benchmarks, metrics, and implementation details

Environments.

2D Avoidance is a planar reaching task in [0,1]^{2} with start (0.1,0.5) and goal (0.9,0.5); the state is (x,y,g_{x},g_{y})\in\mathbb{R}^{4} and the action a velocity (v_{x},v_{y}), in chunks of H{=}16 steps with 4 executed per replan. Six training obstacles are present in every scenario; each test scenario adds obstacles that close off some of the demonstrated paths (left, right, both, cluttered, narrow, narrower). The safe set is the collision-free set. 3D Sphere-Avoid (App. B) is a simulated 7-DoF Franka Panda planning task in joint space, parameterized as a B-spline with 28 control points per joint; the safe set is the collision-free set of the swept-sphere geometry plus joint limits. Shelf (Sec. 4.2) uses the same simulated arm for pick-and-place in five scenarios (App. C); actions are chunks of 16 absolute joint configurations. 3D-Orient is a 7-DoF reach to a goal anywhere in the reachable workspace, with an orientation preference handled by a proximal step on the end-effector orientation cost.

Metrics.

Safe-SR is the fraction of rollouts that complete the task and satisfy the constraint (2D: reach the goal collision-free; Sphere-Avoid: reach the goal with a collision-free trajectory; Shelf: pick and place the cube collision-free). On 3D-Orient, success requires a step within 10 cm of the target position and within 0.36 rad of the target orientation. fully-in-supp. is the fraction of rollouts whose every waypoint lies inside a dilated convex hull of the demonstrations. logL is the exact log-likelihood under \pi_{\theta} (nats/dim), averaged over chunks. NFE is the mean number of flow-model calls per rollout.

Configuration.

All simulated experiments use deterministic Euler integration. Table 22 lists the per-benchmark settings.

Table 22: Per-benchmark configuration. \tau: stopping tolerance. Sphere-Avoid rollouts: 120 tasks \times\,8 samples. 3D-Orient also uses \lambda_{ee}{=}3000 and \beta{=}10^{6}.
  • 2D Avoidance
    Action
    (v_{x},v_{y}), H{=}16
    CS-Pi
    k{=}20, K_{\max}{=}5
    Term. proj.
    on
    \tau
    0.01
    Rollouts
    6\times 200
  • Sphere-Avoid
    Action
    B-spline, 28\times 7
    CS-Pi
    k{=}50, K_{\max}{=}20
    Term. proj.
    on
    \tau
    0.001
    Rollouts
    120\times 8
  • Shelf
    Action
    joint chunk, 16\times 7
    CS-Pi
    k{=}50, K_{\max}{=}5
    Term. proj.
    on
    \tau
    0.001
    Rollouts
    150 (30\times 5)
  • 3D-Orient
    Action
    7-DoF joints
    CS-Pi
    k{=}10, K_{\max}{=}3
    Term. proj.
    off
    \tau
    0.001
    Rollouts
    90 (30\times 3)
  • Real world
    Action
    joint velocities
    CS-Pi
    k{=}5, K_{\max}{=}5
    Term. proj.
    on
    \tau
    0.001
    Rollouts
    20 (10\times 2)

Appendix P Hardware deployment setup

We deploy CS-Pi zero-shot on a Franka FR3 with a Robotiq 2F-85 gripper, controlled through FrankaPy at 15 Hz. The policy is \pi_{0.5} finetuned on DROID; it acts in joint-velocity space, so every Cartesian constraint is enforced through forward kinematics and Jacobians on the integrated joint trajectory Q[t]=q_{0}+\Delta t\sum_{\leq t}V, with \Delta t the control period.

Perception to constraints.

The ZED 2 side camera (RGB and metric depth) drives the constraint pipeline; the ZED mini wrist camera is used only by the policy. All geometry is expressed in the robot base frame. For benchmarking we assume a static scene and run the perception pipeline once per rollout: SAM2 segments the scene with no text prompt, each mask is unprojected through depth into a point cloud, and a vision-language model (Gemini) assigns only semantic roles (which segment to grasp, which to place on, which to ignore). It never produces coordinates; all positions and extents come from depth. Each obstacle is fit with a tight oriented bounding box; the grasp and target objects reduce to centroids. Because a single depth view sees only an object’s front, we mirror the occluded half across the camera-ray mid-plane before fitting, which enlarges the geometry in the safe direction.

Constraints and execution.

A task state machine (reach \to grasp \to transport \to place) rebuilds the active constraints every chunk: a goal attractor at the grasp or target centroid, a collision constraint between the robot and gripper sphere model and the obstacle boxes, a table half-space, and, once grasped, a sphere for the held object. CS-Pi, gradient guidance, Trust Sampling and projection receive the identical obstacle set, q_{0} and \Delta t, so the comparison differs only in the sampler. The collision cost takes the form each method is designed for: a hinge penetration penalty for CS-Pi and projection, and an OmniGuide-style log-barrier on clearance for gradient guidance and Trust Sampling. The perceived scene is saved to a scene file and replayed across methods.

Planned versus realized motion.

Collisions are scored on the realized joint configuration each tick with zero safety margin. FrankaPy controller lag leaves the arm short of each commanded waypoint (\sim\!50 mm of end-effector travel), so a chunk with zero planned constraint cost can still log a contact. This execution gap applies equally to every method.

P.1 Hardware execution analysis

The following statistics are computed offline from the logged trials (20 CS-Pi trials, 1879 chunks).

What executes.

On 73.9\% of chunks the raw \pi_{0.5} draw is already safe and executes unchanged (bit-identical); on 21.2\% the loop converges and executes an unmodified re-denoised policy sample; on 4.8\% the terminal projection fires (App. J). Iterations per chunk: 1 (1389 chunks), 2 (198), 3 (120), 4 (56), 5 (116). The median ratio of successive residuals is 0.20, 0.33, 0.61 and 0.77 over the first four iterations (96, 91, 81 and 75\% of ratios below 1): contraction is strongest at the first iteration, and the violation that survives to the later iterations is the one that ends in the terminal projection.

Smoothness.

Table 23 reports the per-trial maximum end-effector jerk, differentiated against measured timestamps. CS-Pi’s median is the highest (the correction adds motion), but it has the lightest tail: the ratio of the 95th percentile to the median is 1.64, against 1.80 for the unconstrained policy and 5.69 for projection.

Table 23: Hardware smoothness: per-trial maximum end-effector jerk (m/s3), median and 95th percentile across trials.
  • Unconstrained
    Trials
    20
    Median
    116.9
    p95
    210.3
    p95 / median
    1.80
  • Gradient guidance
    Trials
    20
    Median
    90.9
    p95
    322.7
    p95 / median
    3.55
  • Trust Sampling
    Trials
    10
    Median
    178.8
    p95
    333.5
    p95 / median
    1.87
  • Projection
    Trials
    17
    Median
    167.0
    p95
    949.7
    p95 / median
    5.69
  • CS-Pi
    Trials
    20
    Median
    181.6
    p95
    298.7
    p95 / median
    \mathbf{1.64}
Dynamic validity.

The projection certifies joint-position limits, collision and the table, but not velocity or acceleration limits. The realized joint velocity never exceeded the Franka limits (0 of 130{,}361 joint-ticks; worst 0.77\times the limit), because the impedance controller tracks only part of each commanded step. The commanded stream does exceed them occasionally: 0.08\% of joint-ticks over the velocity limit within converged chunks, which execute unmodified policy samples, and 2.0\% within chunks where the terminal projection fired. Adding velocity and acceleration bounds to the projection would extend the certificate to them.

Compute.

CS-Pi makes 1.62 policy calls per chunk on average (0.62 re-denoises) and 2.57 projection solves; its mean NFE is 10.9 against 10 for a single draw, because with k{=}5 the time n is close to 1 and a re-denoise needs about one integration step. Per-step latency is reported in Table 4.