Plumb the configured substep count into GpuMultibodySet - #25
Open
haixuanTao wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
GpuMultibodySet::num_solver_iterationsis hardcoded to 4 at construction and its setter has no caller (theFIXME: should be read from the simulation settingscomment marks the spot). The pipeline, however, runssp.num_solver_iterationssubsteps. Sinceset_visible_dtdivides 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):
num_solver_iterations = 16The 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 beforeset_visible_dtat bothGpuMultibodySetbuild sites. 3 insertions, 2 files.🤖 Generated with Claude Code
https://claude.ai/code/session_01B7NC7U2wDx2tSmT9mkeF9h