[Bug]: IPC-only rigid getters report an extra rigid prediction.
Bug Description
For an IPC-only rigid body, get_vel() does not report its simulated velocity and get_pos() includes an extra rigid-solver integration. This affects observations used by controllers and training code even when the native IPC trajectory is correct.
In a contact-free fall with dt = 0.01 and gravity = (0, 0, -10), after ten steps the discrete Euler result is z = 0.945 and vz = -1.0. On main d00455a the public getters return z = 0.944 and vz = -0.1. The velocity remains approximately -0.1 throughout the fall. Both unbatched and two-environment scenes reproduce it.
Steps to Reproduce
import genesis as gs
gs.init(backend=gs.gpu, precision="32", seed=0)
scene = gs.Scene(
sim_options=gs.options.SimOptions(dt=0.01, gravity=(0, 0, -10)),
coupler_options=gs.options.IPCCouplerOptions(),
show_viewer=False,
)
box = scene.add_entity(
gs.morphs.Box(size=(0.08, 0.08, 0.08), pos=(0, 0, 1)),
material=gs.materials.Rigid(coup_type="ipc_only"),
)
scene.build(n_envs=2)
for _ in range(10):
scene.step()
print(box.get_pos()) # Expected z = 0.945 in each environment; actual z = 0.944
print(box.get_vel()) # Expected vz = -1.0; actual vz = -0.1Expected Behavior
Public pose and velocity should describe the body simulated by IPC. The rigid solver must still advance entities it owns in a mixed scene.
Root Cause
IPCCoupler._post_advance_ipc_only copies the IPC pose and explicitly zeroes velocity to avoid double integration. RigidSolver.substep_post_coupling then runs another rigid step, adding its acceleration and displacement. Synchronizing the IPC-owned states after that rigid step allows the actual IPC velocities to be retained and removes the extra pose update. Link poses and velocities must also be refreshed after writing qpos and DOF velocities, since the public getters read those derived states.
Environment
- Linux, RTX 4090, driver 580.126.09
- Python 3.12.3, PyTorch 2.13.0+cu130, pyuipc 0.0.28
Release version or Commit ID
d00455a16a86a0a2e63f8295132c9bf8b74d2f79
Additional Context
The same issue appears in the existing collision scene: the public velocity disagrees with the finite difference of consecutive public positions. The native IPC trajectory is not the extra rigid predictor reported by those getters. This report concerns pose/velocity synchronization; it does not resolve the affine-deformation question in #2784.
Related historical proposals #2502 and #2931 discussed broader IPC coupling rewrites; both are closed without merging. This reproduction is on current main and concerns the existing IPC-only state synchronization path.
Source: Genesis-Embodied-AI/genesis-world