arXiv:2610.19091cs.GROct 2026

Manuscript Offprint

arXiv:2610.19091

DiffGIPC: Differentiable Mixed-Coordinate Contact Dynamics on GPU

Kemeng Huang, Bowen Ren, Xinyu Lu, Minchen Li, Taku komura

KEMENG HUANG, The University of Hong Kong, Hong Kong SAR, China

BOWEN REN, The University of Hong Kong, Hong Kong SAR, China

XINYU LU, TransGP, Hong Kong SAR, China

MINCHEN LI, Carnegie Mellon University, USA

TAKU KOMURA, The University of Hong Kong, Hong Kong SAR, China

Figure

(a) Initial placement

Figure

(b) Iteration 10

Figure

(c) Iteration 50

Figure

(d) Iteration 78

Fig. 1. Optimizing the placement of seven affine bodies. Keeping their shapes fixed, DiffGIPC adjusts only the horizontal initial positions to form a stable stack. The panels show the unoptimized configuration and the simulated results after 10, 50, and 78 iterations.

Contact-rich inverse problems require efficient gradients and reliable enforcement of non-penetration. Existing differentiable methods provide fast simulation and rigid-deformable coupling, but contact treatments based on penalties or velocity-level constraints can permit penetration or positional drift. Incremental Potential Contact (IPC) maintains non-penetration through geometric barriers and continuous collision detection (CCD). However, repeated forward and backward evaluations remain costly in full-space finite-element (FEM) implementations, particularly when nearly rigid components retain many vertex degrees of freedom (DoFs). We present DiffGIPC, a GPU-accelerated differentiable IPC framework for optimizing interacting deformable and nearly rigid bodies. Our affine-body derivatives enable rest-shape design, initial-state optimization, and articulated control while retaining only twelve motion DoFs per affine body. These gradients account for how changes in geometry, placement, and actuation affect other objects through collision and friction. We preserve these interactions in one coupled FEM-affine adjoint system per frame, reducing the backward-system size without discarding the dependencies that drive the inverse problem. GPU-optimized backward computation further reduces the cost of repeated gradient evaluations. A reusable PyTorch interface connects supported physical parameters to user-defined parameter maps and losses across design, identification, motion, placement, and articulated control. Experiments demonstrate peak speedups over DiffIPC of approximately 150.0×150.0\times with full-space FEM and 4133.3×4133.3\times with affine bodies for combined forward simulation and backward differentiation.

CCS Concepts: • Computing methodologies → Physical simulation; Parallel algorithms.

Additional Key Words and Phrases: differentiable simulation, contact, affine body dynamics, finite elements, GPU simulation, articulated control, inverse design

1 Introduction

Gradient-based design, system identification, and control often optimize one object's parameters for their effect on another object. A hanger's shape determines whether a garment remains supported. An initial velocity determines where another body moves after collision, and a robot command changes the motion of a grasped deformable object. In each case, the gradient must follow forces transmitted through contact and the subsequent motion. Computing these derivatives efficiently is particularly challenging when a scene combines deformable objects with detailed, nearly rigid components: the representation must resolve the interactions without making every stiff component expensive to differentiate.

Existing methods address different parts of this problem. Differentiable projective-dynamics methods, including DiffPD and DiffCloth [Du et al. 2021; Li et al. 2022], accelerate repeated solves through local-global iterations and matrix prefactorization. Representing nearly rigid components as stiff deformable meshes nevertheless retains vertex-level motion DoFs, increasing simulation

Authors' Contact Information: Kemeng Huang, kmhuang@connect.hku.hk, kmhuang819@gmail.com, The University of Hong Kong, Hong Kong, Hong Kong SAR, China; Bowen Ren, boweyna@gmail.com, The University of Hong Kong, Hong Kong, Hong Kong SAR, China; Xinyu Lu, lxy819469559@gmail.com, TransGP, Hong Kong, Hong Kong SAR, China; Minchen Li, minchernl@gmail.com, Carnegie Mellon University, Pittsburgh, USA; Taku Komura, taku@cs.hku.hk, The University of Hong Kong, Hong Kong, Hong Kong SAR, China.

Huang et al.

Figure

Fig. 2. DiffGIPC's backward pipeline. Each reverse frame assembles one coupled FEM-ABD adjoint system, retaining collision, friction, and joint interactions with twelve DoFs per affine body. The GPU solve and local accumulation propagate gradients to earlier states and physical parameters for optimization through PyTorch.

and differentiation costs even when only near-rigid motion is required [Lai et al. 2026]. ADD [Geilinger et al. 2020] provides fully implicit, two-way coupled rigid and deformable dynamics with analytic adjoints, but uses penalty-based normal contact, which does not strictly prevent interpenetration. DiffIPC [Huang et al. 2024c] differentiates fully implicit FEM dynamics with friction, using IPC barriers and continuous collision detection to maintain non-penetration. Its full-space representation, however, carries the motion DoFs of every stiff component into the backward solve, making repeated evaluations costly in its CPU implementation. The resulting opportunity is to combine contact-coupled differentiation with compact motion coordinates and efficient GPU execution.

We present DiffGIPC, a GPU-accelerated framework for differentiating coupled FEM-affine IPC simulations (Figure 2). Building on the forward formulation of StiffGIPC [Huang et al. 2025a], we derive frame-wise adjoints directly in the mixed motion coordinates. Full-space FEM retains the freedom needed for local deformation, while each affine body contributes only twelve motion DoFs regardless of its surface resolution. Contact and joint derivatives couple interacting bodies within each frame. Inertia and friction make the time integration equations depend on earlier states. The backward systems therefore remain compact while preserving cross-object coupling and the temporal dependencies required for coupled inverse problems.

Compact motion coordinates alone do not provide shape or control gradients. Changing an affine rest surface changes its mass, the positions at which contact is evaluated, and the maps that convert point-space forces to affine coordinates. Under friction, the same rest change also moves the previous-frame points used to define sliding and the lagged contact quantities. We differentiate these dependencies explicitly, together with initial states and revolute or prismatic joint controls, and accumulate them in parallel without enlarging the adjoint system. To retain the advantage of compact systems, conditional CUDA Graphs are employed to keep preconditioned conjugate gradient (PCG) iterations and convergence checks on the GPU, thereby reducing the overhead of repeated kernel launches and CPU-GPU synchronization. A PyTorch interface connects these physical gradients to user-defined parameter maps and losses.

In summary, our contributions are:

• Coupled FEM-affine adjoints for differentiable IPC. We derive trajectory adjoints in mixed FEM and affine coordinates, preserving contact, friction, and joint coupling while using only twelve motion DoFs per affine body.

• Affine-body derivatives for shape design and articulated control. We derive gradients for affine rest shapes, initial states, and joint controls, including shape-dependent inertia and frictional contact.

• A reusable GPU optimization pipeline. We develop a GPU-parallel adjoint and gradient-accumulation pipeline with conditional CUDA Graphs and a PyTorch interface for design, system identification, and control.

• Fully GPU-parallel differentiable IPC. We present the first fully GPU-parallel differentiable IPC framework for coupled nearly rigid and deformable bodies, with substantial speedups demonstrated across contact-rich inverse problems.

Our evaluation examines the benefits of GPU execution and compact motion representations across contact-rich inverse problems. For comparison with DiffIPC, we retain full-space FEM in both systems and use relatively low-resolution benchmarks to keep evaluation times manageable for the CPU-based baseline. Even at these resolutions, DiffGIPC achieves 12.3–34.1× speedups in complete backward evaluation and 10.6–60.9× speedups in combined forward and backward evaluation, covering initial motion, rest shape, material, and friction optimization. A separate resolution study examines how performance scales with geometric detail and the additional benefit of affine coordinates. Further experiments demonstrate cloth design, affine shape optimization, stable placement, and articulated control. The source code of our framework will be released.

References (81)