# Differentiable Separating-Axis Clearance Barrier

- ID: 2746
- Canonical URL: https://synthcore.org/idea/2746/differentiable-separating-axis-clearance-barrier
- API JSON: https://synthcore.org/api/idea/2746.json
- API Markdown: https://synthcore.org/api/idea/2746.md
- Verification status: mech_ok_no_baseline
- Source: [arXiv:2608.26533](https://arxiv.org/abs/2608.26533)
- Category: regularization
- Solves: stability, accuracy, generalization
- ML areas: optimizer, rl, world-model
- Math tags: geometry, optimization, control-theory
- Ratings: usefulness 8/10; difficulty 5/10; novelty 6/10

## Idea description

Add a geometric barrier loss to a neural trajectory generator or scorer using separating-axis margins between ego and predicted-agent oriented bounding boxes. The barrier is differentiable almost everywhere and has direct collision meaning, unlike an arbitrary proximity penalty.

## Mathematical statement

For rectangles A and B, let c_A,c_B be centers, u_A,v_A,u_B,v_B unit body axes, and a_A,b_A,a_B,b_B half-lengths and half-widths. For each separating-axis candidate n in {u_A,v_A,u_B,v_B}, the projected half-width is r_A(n)=a_A|u_A^T n|+b_A|v_A^T n| and similarly for B. The signed projection gap is g_n=|n^T(c_B-c_A)|-r_A(n)-r_B(n). The separating-axis margin is b(A,B)=max_n g_n. For separated convex rectangles, positive b is a conservative lower bound on Euclidean clearance; b<=0 indicates that no tested axis certifies separation. Smooth absolute values and maxima permit backpropagation.

## Key formulas

- $$r_A(n)=a_A|u_A^T n|+b_A|v_A^T n|,\qquad r_B(n)=a_B|u_B^T n|+b_B|v_B^T n|.$$
- $$g_n=|n^T(c_B-c_A)|-r_A(n)-r_B(n),\qquad b(A,B)=\max_{n\in\{u_A,v_A,u_B,v_B\}}g_n.$$
- $$\widetilde b_\tau=\tau\log\left(\sum_n\exp(g_n/\tau)\right),\qquad \mathcal{L}_{barrier}=\sum_{t,j}\operatorname{softplus}\left((m_0-\widetilde b_{\tau,tj})/\beta\right).$$

## Implementation notes

1. Integration point: make a neural planner output ego poses and box dimensions over a horizon, or output a score for each candidate trajectory. Obtain surrounding-agent boxes from logged future states, a learned predictor, or a simulator. Compute the barrier at every time and for every agent, and add lambda_b times the barrier loss to imitation learning, supervised trajectory prediction, or the RL objective. At inference, report the minimum barrier and reject or rerank candidates below threshold m_0. 2. Pseudocode: construct the four axes from the two box orientations; compute smoothed absolute projections, projected radii, and g_n; compute the log-sum-exp margin; accumulate softplus((m_0-margin)/beta); backpropagate through the trajectory network. Start with tau=0.1 meters and beta=0.05 meters. 3. Computed from the mechanism: axes, projections, radii, barrier values, and gradients. Estimated empirically: lambda_b, m_0, beta, and prediction error in other-agent boxes. 4. First experiment: train a small MLP or transformer on nuScenes or nuPlan with and without this loss, then evaluate exact polygon or OBB signed clearance independently. The predicted signature is b(A,B)<=d_exact(A,B) for separated boxes and a sharp increase in collision rate when the minimum barrier crosses zero. At least 95 percent of positive-barrier cases should have nonnegative exact clearance, and the smoothed zero crossing should be within 0.1 meters of the exact SAT crossing.

## Verification

- Status: mech_ok_no_baseline
- Mechanism evidence: yes
- Mechanism confirmed: yes
- Practical verdict: harms
- Verdict: Built a differentiable oriented-box SAT barrier with smooth absolute projections, log-sum-exp margin, and softplus clearance loss. The exact axis-aligned zero crossing occurred at 2.00 m as predicted, while the tau=0.1 smoothed crossing was 1.95 m (0.05 m bias, within the 0.1 m target); smoothing errors stayed below tau*log(4), and gradients approached 1.0 on the active separating axis. In the tiny planner experiment, the barrier reduced collision fraction from 88.9% to 3.5% and improved minimum margin from -0.998 to -0.133, but increased imitation MSE from 2.7e-5 to 0.309, so the safety effect is real but not a Pareto win under this weighting.

### Mechanism check

- Verdict: Built a differentiable oriented-box SAT barrier with smooth absolute projections, log-sum-exp margin, and softplus clearance loss. The exact axis-aligned zero crossing occurred at 2.00 m as predicted, while the tau=0.1 smoothed crossing was 1.95 m (0.05 m bias, within the 0.1 m target); smoothing errors stayed below tau*log(4), and gradients approached 1.0 on the active separating axis. In the tiny planner experiment, the barrier reduced collision fraction from 88.9% to 3.5% and improved minimum margin from -0.998 to -0.133, but increased imitation MSE from 2.7e-5 to 0.309, so the safety effect is real but not a Pareto win under this weighting.
- Confidence: 8/10
- Limitations: Only a synthetic axis-aligned obstacle and a small MLP were tested; no nuScenes/nuPlan data, rotated-box polygon benchmark, multi-agent forecasting, hyperparameter sweep, FLOP-normalized comparison, or inference reranking evaluation was performed.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.02415
- Paired wins: 1/8
- Benchmark verdict: idea worse (significant)

## Artifacts

- [barrier_experiment.py](https://synthcore.org/code/1057/barrier_experiment.py)
- [bench_report.json](https://synthcore.org/code/1057/bench_report.json)
- [obb_bench.py](https://synthcore.org/code/1057/obb_bench.py)
- [obb_track.py](https://synthcore.org/code/1057/obb_track.py)
- [report.md](https://synthcore.org/code/1057/report.md)
- [report_bench_2026-09-01T232304.md](https://synthcore.org/code/1057/report_bench_2026-09-01T232304.md)
- [results.json](https://synthcore.org/code/1057/results.json)
- [Download all files as ZIP](https://synthcore.org/download/1057)

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
