Minkowski-offset sphere (vertex–triangle) & capsule (edge–edge) queries in Warp, wired into Newton's
TriMeshCollisionDetector. Phase-1 prototype & validation · NVIDIA L40 · Warp 1.14.0rc2 · 2026-06-28
Two tighter broad-phase queries replace the radius-padded AABB query; the narrow phase is untouched, so the emitted contacts are unchanged — only the candidate set shrinks.
bvh_query_sphere(v, r), exact point→AABB distance test (the sphere is inscribed in the old padded AABB).bvh_query_ray(e0, e1−e0, inflation_radius=r) bounded by max_dist=1.0 — a ray inflated by r and length-clamped to the edge.Parity holds by construction: true_contacts ⊆ minkowski_candidates ⊆ aabb_candidates.
Old AABB detector vs. new detector, both under the same Warp build, every frame of all 8 datasets;
canonical VT (v,tri) and EE (e,nbr) sets compared by count + hash.
| dataset | frames | VT contacts | EE contacts | result |
|---|---|---|---|---|
| cloth_bending | 100 | 0 | 200 | |
| cloth_hanging | 100 | 0 | 0 | |
| cloth_poker_cards | 100 | 356,859 | 2,082,650 | |
| cloth_twist | 300 | 995,708 | 6,372,880 | |
| cloth_rollers | 300 | 15,870,272 | 105,233,098 | |
| softbody_dropping_to_cloth | 100 | 35,124 | 195,902 | |
| softbody_gift | 100 | 263,675 | 960,216 | |
| cloth_franka | 3850 | 7,442,964 | 46,963,646 |
0 differences across ~24M VT + ~162M EE contacts. Independently, an exact false-positive/false-negative
audit on real meshes (fp_fn_test.py) confirms the sphere returns exactly the sphere-overlapping triangle AABBs
(0 FP, 0 FN), and a GPU discriminator shows the sphere/capsule dropping crafted boxes the AABB query keeps — i.e. the
node tests are genuinely live, not falling back to AABB.
| dataset | EE speedup | VT speedup | EE cand↓ | VT cand↓ |
|---|---|---|---|---|
| poker_cards | 1.12× | 1.07× | 25.9% | 2.8% |
| twist | 1.15× | 0.99× | 13.8% | 1.5% |
| rollers | 1.06× | 1.00× | 21.3% | 4.8% |
| dropping | 1.24× | 0.99× | 12.6% | 0.1% |
| gift | 1.66× | 1.15× | 6.6% | 7.1% |
| franka | 1.25× | 1.04× | 14.0% | 6.2% |
The ~16% EE candidate reduction → ~16% fewer closest_point_edge_edge narrow-phase tests → the
1.23× geomean EE speedup. VT is near-neutral on cloth (next section explains why).
The candidate drop is governed by h/r = (triangle AABB half-size) / (query radius). The naïve "sphere is π/6 ≈ 48% of its cube" only holds for points filling 3-D. Cloth triangles lie on a 2-D surface (ceiling π/4 ≈ 21%), and they are finite AABBs 1–5× the query radius — so a corner triangle still touches the sphere and isn't dropped. Real cloth sits at h/r ≈ 2–5 (bottom of the curve), giving the measured ~4%. Not a defect — there is simply little slack to remove.
On 3-D-uniform candidates the queries reach their theory: point-like boxes give a 46.8% sphere candidate drop (≈ π/6) and 1.55× speedup; random long diagonal segments give a 51.7% capsule drop and 1.95× speedup. The gain decays smoothly as boxes grow vs. the radius — the same h/r curve, now confirmed with the real GPU queries and showing the candidate drop converting to wall-clock.
VT sphere gain rises with the query radius (h/r shrinks → up to ~17–25% at 8× margin). EE capsule gain falls with the radius (once r ≫ edge length, the node-AABB inflation swamps the segment's tightness). Cloth self-contact margins land in the EE sweet spot (~15%) and the VT poor spot (~4%) — the two queries are complementary across the margin range.
| query | accuracy | perf (cloth) | complexity | verdict |
|---|---|---|---|---|
| EE capsule | exact (0 diff) | 1.23× geomean, up to 1.66× | +1 param on existing bvh_query_ray | worthwhile |
| VT sphere | exact (0 diff) | ~1.0× (≈4% cand) | +1 new builtin | marginal on cloth; strong at large margin / 3-D / point candidates |
Both queries are correct and exact-contact-preserving. The EE capsule is the cloth win (free, ~1.23×); the VT sphere is marginal at cloth's tight margins but realizes up to ~1.5× when the margin/resolution ratio grows or candidates are 3-D-spread. Magnitude on any mesh is set by how surface-bound vs. 3-D-spread the candidates are, and by h/r.
Out of scope (future): exact segment–AABB capsule node test, wide-BVH, fused VT+EE, per-edge length-normalized max_dist.