Skip to content

Commit e4d1b93

Browse files
authored
Stabilize Kamino Delassus solve test (newton-physics#4334)
1 parent 341ea46 commit e4d1b93

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎newton/tests/kamino/test_kamino_dynamics_delassus.py‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,7 @@ def test_07_regularize_delassus_operator(self):
495495
self.assertTrue(is_D_close)
496496

497497
def test_08_delassus_operator_factorize_and_solve_with_sequential_cholesky(self):
498-
"""
499-
Tests the factorization of a Delassus matrix and solving linear
500-
systems with randomly generated right-hand-side vectors.
501-
"""
498+
"""Factorize a Delassus matrix and solve systems with reproducible right-hand sides."""
502499
# Model constants
503500
max_world_contacts = 12
504501

@@ -551,12 +548,12 @@ def test_08_delassus_operator_factorize_and_solve_with_sequential_cholesky(self)
551548
# Extract Delassus data as numpy arrays
552549
D_np = extract_delassus(delassus, only_active_dims=True)
553550

554-
# For each world, generate a random right-hand side vector
551+
# For each world, generate a reproducible right-hand side vector
555552
num_worlds = delassus.num_worlds
556553
vio_np = delassus.info.vio.numpy()
557554
v_f_np = np.zeros(shape=(delassus._model_maxdims,), dtype=np.float32)
558555
for w in range(num_worlds):
559-
v_f_w = random_rhs_for_matrix(D_np[w])
556+
v_f_w = random_rhs_for_matrix(D_np[w], seed=42 + w)
560557
v_f_np[vio_np[w] : vio_np[w] + v_f_w.size] = v_f_w
561558

562559
# Construct a warp array for the free-velocity and solution vectors

0 commit comments

Comments
 (0)