Certified-Between-Samples Hard Constraints for Fourier Neural Paths

Neural networks can now write a robot's trajectory as a smooth function of a single "progress" number $s$ running from start to goal. These are implicit neural paths: you ask the network where the robot should be at $s=0.37$ and it answers, at any resolution. To draw sharp turns and tight passages, such networks need Fourier features, which feed the network sines and cosines of $s$ at many frequencies so it is not limited to smooth, blurry curves. Safety is still handled mostly by soft penalties, extra loss terms that discourage collisions without forbidding them, and physics-informed planners built this way still fail about one query in twelve. The obvious fix is to bolt a hard-constraint layer onto the network's output at sampled points. We argue this fix is quietly wrong. A hard layer applied at samples $s_i$ says nothing about the path between samples, and the worse the gap, the higher the Fourier bandwidth. Bandwidth is exactly the knob that makes these paths expressive.

We propose a path decoder whose output is a bandwidth-limited sine series with amplitude caps. For this family, a classical derivative bound turns "feasible at $N$ samples with a margin" into "feasible for every $s$." Every condition is affine in the series coefficients, so a closed-form hard-constraint layer can enforce it exactly and differentiably during training and inference, with no numerical solver. The same bound makes explicit a trade-off that current practice finds only by hand-tuning: how much frequency content a path may have, versus how much clearance or sampling density it costs to certify.

Core Claim

The claim has two parts, and each can be tested on its own. The first is negative and predictive. Enforcing hard constraints only at sample points of a Fourier-featured path gives zero violations at those points. It gives a nonzero violation rate between them, and that rate grows with the Fourier bandwidth and falls with sample density at a rate set by the path's derivative bound. The second is constructive. Suppose the path is written as

$$y(s) = y_0 + s\,(y_g - y_0) + \sum_{k=1}^{K} c_k \sin(\pi k s), \qquad |c_k| \le R_k,$$

where $y_0, y_g$ are start and goal, $c_k$ are coefficient vectors produced by a scene-conditioned network, $K$ is the maximum frequency, and $R_k$ are per-frequency amplitude caps. Then the endpoints hold exactly, and the path's speed is bounded by $L = \|y_g - y_0\| + \pi \sum_k k R_k$. It follows that for any half-space constraint $a^\top y \le b$ active on an interval of $s$, it suffices to impose

$$a^\top y(s_i) \le b - \tfrac{1}{2}\|a\|\, L\, \Delta s \quad \text{at samples spaced } \Delta s \text{ apart}.$$

This holds because between neighbouring samples $a^\top y$ can rise by at most $\|a\| L \Delta s / 2$. Both the tightened sample constraints and the amplitude caps are affine in the coefficients $c_k$. A closed-form affine hard-constraint layer can therefore guarantee that the whole continuous path lies inside a sequence of convex free-space cells.

The novelty is not "hard constraints plus neural paths" in the abstract. It is a guarantee that holds for every $s$ rather than only at sampled points, obtained in closed form, with the Fourier bandwidth $K$ and caps $R_k$ as the explicit price of the certificate.

Where This Sits

Three lines of work motivate the gap.

  • Implicit path decoders without safety. FoldPath decodes object-centric 6D tool paths from $s$ using weight-modulated MLPs with periodic activations. It reaches 91.1% $AP_{DTW}$ on PaintNet Cuboids against 50.3% for a discrete waypoint baseline. It has no collision or keep-out handling, and the authors list this as future work. We reuse its idea of a scene-conditioned network that sets the path's parameters. We restrict the final map from $s$ to be linear in a fixed sine basis so the bound above applies.
  • Physics-informed planners that still fail. NTFields and P-NTFields solve an Eikonal equation with a neural arrival-time field. The latter adds Fourier configuration-space encodings, a viscosity smoothing term and a curriculum. It reaches 92% success in 0.05 s on a real UR5e, yet obstacle avoidance remains a soft PDE residual, and its remaining failures are attributed to approximation error in narrow passages.
  • Neural distance fields with slow guarantees. Stochastic implicit SDFs do achieve roughly 1% collision risk. They pay 150.63 s per plan to solve a mixed-integer program waypoint by waypoint, and they do not represent the path itself as a continuous function.

Three works supply or constrain the method.

  • CAffNet gives a closed-form differentiable layer satisfying input-dependent affine constraints $A(x)y \le b(x)$ with 0.0% violations. A trainable null-space network lets it land on task-useful feasible points rather than the nearest boundary. It matches IPOPT's feasibility at roughly 15× the speed. We reuse it wholesale, but apply it to path coefficients rather than to a one-step output. It has only been evaluated on static one-step mappings.
  • Tabas & Zhang reach the same end with a gauge map over invariant polytopes. Their 100% satisfaction on a power grid, where penalty-trained RL repeatedly violated limits, is part of our evidence against soft constraints.
  • Tancik et al. show that the Fourier scale must be hand-tuned between blur and jitter. Our amplitude caps $R_k$ play the role of their frequency distribution, but with a quantitative meaning: they set $L$, and $L$ sets the clearance margin.

Two further points constrain the design.

  • Where the constraints can live. Both affine layers only handle convex polytopic constraints. We therefore confine certification to settings where free space can be covered by convex cells: task-space point or rigid-body motion, and tool or end-effector keep-out regions. Certified whole-arm collision avoidance in joint space is out of scope, and we say so.
  • Why expectation-level safety is not enough. The constrained-RL analyses of Ghosh et al. and Stradi et al. explain why average-cost safety tolerates occasional catastrophes. That is why we insist on a per-path, for-all-$s$ guarantee.

Research Program

The system. A scene encoder (PointNet++-style, as in FoldPath) and a small transformer produce $K$ unconstrained coefficient vectors. Before decoding, a graph search over a precomputed convex decomposition of free space picks a sequence of cells and assigns each an interval of $s$. At handovers, consecutive cells must overlap and the sample at the handover must lie in both. The certified layer then assembles the constraints: the per-frequency boxes $|c_k| \le R_k$, plus, for every face of every assigned cell, the margin-tightened inequality at each sample in that cell's interval. Because $y(s_i)$ is linear in the stacked coefficients, this is a single affine system. A CAffNet layer, with its learnable null-space module, maps the raw coefficients into it.

Training. The model is trained end to end on the task loss (demonstration matching for PaintNet; path length plus smoothness for navigation). The output is feasible by construction, so no penalty weight is needed.

Analysis. The analysis has three parts.

  • Test the negative prediction directly. Take the obvious pointwise combination: a Fourier-featured MLP path with CAffNet applied independently at each sample. Measure violations on a dense grid of $10^5$ values of $s$. Plot violation rate against the Fourier scale and against $N$. The bound predicts that the worst-case excursion between samples scales like $L\,\Delta s$. We check whether empirical excursions track this.
  • Map the bandwidth-clearance frontier. For each $(K, R_k, N)$, record which narrow passages remain certifiable, since the margin must not exceed the passage half-width, and the task quality attained. This turns Tancik et al.'s hand-tuned "Goldilocks zone" into a curve an engineer can read off.
  • Measure scaling. The constraint count grows as $N$ times the number of faces. We measure layer latency against it, which is the pseudoinverse bottleneck CAffNet itself flags.

Baselines

Do nothing. The naive reference is the same Fourier path network with no constraint handling, trained only on the task loss. It is FoldPath's regime. It shows how often unconstrained high-bandwidth paths actually leave free space, and it anchors task quality. On PaintNet Cuboids the reported FoldPath figure is 91.1% $AP_{DTW}$ (FoldPath). We will rerun FoldPath on our keep-out-augmented split so the comparison uses identical data. Beating it means zero certified violations while staying within a few points of its $AP_{DTW}$ on the original split.

Soft penalty. The soft-constraint baseline adds a hinge penalty on sampled clearance, plus a Lagrangian variant with a PID-damped multiplier. These are the standard remedies that Safety Gymnasium finds either reckless or over-conservative; its PPO-Lagrangian cut violations 98% at a 45% reward cost. Both get the same architecture, epochs, and a hyperparameter sweep matched in GPU-hours to our own tuning of $K$ and $R_k$. Beating them means strictly zero dense-grid violations, versus their residual rate, at equal or better task quality.

Pointwise hard layer (key ablation). This is CAffNet applied at the samples, without the margin and amplitude caps. It isolates the proposal's key ingredient. If it shows no violations between samples at the bandwidths tasks actually need, our certificate adds conservatism without benefit, and the first half of the claim fails.

Post-hoc solver projection. This ablation isolates the closed-form layer. The unconstrained coefficients are projected onto the identical feasible set with an off-the-shelf QP solver at inference only. It shares our guarantee, so it tests only latency and whether training through the constraint improves task quality. Beating it means matching its feasibility at lower latency and better task quality.

Strongest existing method: P-NTFields. On navigation, the strongest competitor is P-NTFields, with a reported 92% success at 0.05 s on the 6-DOF UR5e task. Also reported there are LazyPRM at 2.79 s and RRT at 67%. We run P-NTFields and NTFields on our task-space environments with their published training recipes. Beating them means certified-collision-free success above 92% in comparable environments at planning times within the same order of magnitude.

Corridor spline. A piecewise Bézier curve whose control points are forced into the same convex cells. It is certified by the convex-hull property of Bézier curves, with the same cell sequence and task loss. This is the most dangerous competitor, discussed next.

Why not just…?

Why not just use a large penalty weight or a PID Lagrangian? Penalties trade safety for task reward, as Bou-Ammar et al. formalize. Empirically, penalty-trained policies violated limits where closed-form filters did not, in both Tabas & Zhang and CAffNet's unicycle navigation. More fundamentally, even a perfectly tuned penalty is evaluated only at sampled $s$, so it inherits the between-sample problem. The soft baseline, measured on the dense grid, settles this.

Why not just apply CAffNet at each sample point, or sample very densely? This is the obvious combination, and it is our key ablation. Dense sampling does shrink the gap. Without a bound on the path's speed, though, no finite density is a guarantee, and high-bandwidth Fourier MLPs have no such bound. With the amplitude caps, density becomes a certified knob: doubling $N$ halves the margin. If the ablation shows negligible excursions at practical bandwidths, we will report that the certificate buys guarantees rather than empirical safety.

Why not just use B-splines or Bézier curves in convex corridors, which are certified by the convex-hull property? This is a real threat, and we treat it as one. That construction also guarantees feasibility for every $s$ with affine constraints, without any Fourier machinery. Our bet is that a global sine series with learned, scene-conditioned coefficients fits sharp, object-following paths like PaintNet's with fewer parameters, and is looser near corners, because the Bézier control polygon over-constrains the curve in tight cells. If the corridor spline matches our method on both $AP_{DTW}$ and narrow-passage success, the right conclusion is that the Fourier part is unnecessary. The paper would then become a study of certified neural spline decoders, and we would report it that way.

Why not just inflate obstacles? Uniform inflation is our margin with a hand-picked value and no link to the path's frequency content. Quintero-Peña et al. found inflation produced longer, detour-heavy paths. Inflation also closes narrow passages. Our frontier analysis shows directly which passages remain open for a given $(K, N)$, and an inflation sweep will be run alongside it.

Proposed Experiments

Benchmarks. There are three settings.

  • PaintNet with keep-out zones. We use Cuboids, Windows, Shelves and Containers, and add convex keep-out boxes around fixtures and a minimum standoff from the surface. We report $AP_{DTW}$, paint coverage, and dense-grid violation rate.
  • Point and rigid-body navigation. This uses cluttered 3D scenes and Gibson rooms from the NTFields evaluations, plus CAffNet-style convex-obstacle 2D navigation. We report success, dense-grid violation rate, path length and planning time.
  • End-effector certification on MotionBenchMaker. We use the MotionBenchMaker shelf and table datasets with 100 problems each, following its warning that 5 to 10 problems yield wrong conclusions. Here we certify end-effector and tool keep-out only, and separately report whole-arm collisions as uncertified.

No Lacuna-reported result was found for any method on our keep-out-augmented PaintNet or on dense-grid violation rates. Those numbers will be new, and all baselines are rerun.

Decisive checks. We run four.

  • The certificate itself. Across all trained models and test scenes, the dense-grid violation count must be exactly zero, since the guarantee is mathematical. Any violation indicates an implementation bug.
  • The negative prediction. For the pointwise ablation, the between-sample violation rate should rise monotonically with Fourier scale at fixed $N$, and fall with $N$. If neither trend appears, the paper's motivation is wrong.
  • The spline comparison. Our method must beat the corridor-spline baseline on $AP_{DTW}$ or narrow-passage success. If it does not, we report the negative result.
  • Latency. Planning time must remain sub-second at the constraint counts required, compared against post-hoc solver projection. This tests whether the closed-form layer delivers the speed that separates it from the 150.63 s mixed-integer approach.