Skip to content

Plumb the configured substep count into GpuMultibodySet - #25

Open
haixuanTao wants to merge 1 commit into
dimforge:mainfrom
haixuanTao:fix/upstream-substep-count
Open

Plumb the configured substep count into GpuMultibodySet#25
haixuanTao wants to merge 1 commit into
dimforge:mainfrom
haixuanTao:fix/upstream-substep-count

Conversation

@haixuanTao

Copy link
Copy Markdown
Contributor

Bug

GpuMultibodySet::num_solver_iterations is hardcoded to 4 at construction and its setter has no caller (the FIXME: should be read from the simulation settings comment marks the spot). The pipeline, however, runs sp.num_solver_iterations substeps. Since set_visible_dt divides the visible dt by the stale field, every multibody kernel integrates substeps with the wrong dt whenever the configured count differs from 4 — e.g. 2× too large at 8 substeps, 4× at 16 — inconsistent with the constraint-softness coefficients, which are computed from the correctly divided params.

Symptoms

Measured on a G1 humanoid passive-stand scene (RTX 5090, WebGPU):

metric before after
loaded-foot tangential creep 66 mm / 0.5 s 8 mm / 0.5 s
num_solver_iterations = 16 NaN in ~4 steps (more substeps diverge) stable (more substeps stabilize)

The divergence-with-substep-count signature was the tell: each added substep integrated with an unchanged, too-large dt.

Fix

Call set_num_solver_iterations(...) with the configured value before set_visible_dt at both GpuMultibodySet build sites. 3 insertions, 2 files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01B7NC7U2wDx2tSmT9mkeF9h

GpuMultibodySet::num_solver_iterations was hardcoded to 4 (its setter
existed but had no caller — the FIXME noted it) while the pipeline runs
sp.num_solver_iterations substeps (8 in the biped configs). Since
set_visible_dt divides the visible dt by the stale field, every
multibody kernel integrated substeps with 2x the true substep dt (4x at
num_solver_iterations=16), inconsistent with the constraint softness
coefficients computed from the correctly divided params.

Measured on a G1 passive-stand scene: foot slide 66mm -> 8mm per 0.5s,
and the SOLVER_ITERS=16 NaN-in-4-steps divergence is eliminated (more
substeps now stabilize instead of exploding).

Fix: pass the configured count at both GpuMultibodySet build sites
before set_visible_dt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B7NC7U2wDx2tSmT9mkeF9h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant