Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
5676dd1
Add resolve_ids next to resolve_1d_mask as the shared id and mask hel…
hujc7 Oct 26, 2026
97e5662
Resolve sensor, camera and wrench composer selections through the sha…
hujc7 Oct 26, 2026
92590d0
Fix the deformable mask writers that raised on any env mask
hujc7 Oct 26, 2026
f044c92
Resolve Newton selections through the shared helpers and write its ma…
hujc7 Oct 26, 2026
7b48c38
Resolve OVPhysX selections through the shared helpers
hujc7 Oct 26, 2026
3d3661f
Resolve PhysX selections through the shared helpers
hujc7 Oct 26, 2026
b2c2d5d
Write the PhysX tendon mask setters through the masks
hujc7 Oct 26, 2026
43bb968
Merge remote-tracking branch 'upstream/main' into jichuanh/id-mask
hujc7 Oct 26, 2026
e390289
Trim duplicate id-resolution and mask-writer tests
hujc7 Oct 27, 2026
e3ba511
Merge the tendon target scheduling tests
hujc7 Oct 27, 2026
60581b8
Merge branch 'jichuanh/id-mask' into jichuanh/physx-tendon-mask-setters
hujc7 Oct 27, 2026
e031e5e
Reject PhysX tendon masks whose length differs from the axis
hujc7 Oct 27, 2026
223f124
Accept strided torch limits in the PhysX tendon position limit mask s…
hujc7 Oct 27, 2026
10def58
Move the masked 2-D buffer writer to the core Warp kernels
hujc7 Oct 27, 2026
86be015
Compute the PhysX masked tendon target offset into a preallocated buffer
hujc7 Oct 27, 2026
13ec11c
Accept every id form main accepted in resolve_1d_mask
hujc7 Oct 27, 2026
784b0a2
Refresh the solver on every replay of the Newton tendon mask writer
hujc7 Oct 27, 2026
6a4f173
Tidy the mask writers, their docs and the selection tests
hujc7 Oct 27, 2026
bc9a8bb
Reject Newton masks whose length differs from the asset dimension
hujc7 Oct 27, 2026
981e3a4
Accept strided torch limits in the Newton tendon position limit mask …
hujc7 Oct 27, 2026
cff8f86
Run the tendon replay test before the module's shared scene opens
hujc7 Oct 27, 2026
bbb5104
Revert "Reject Newton masks whose length differs from the asset dimen…
hujc7 Oct 27, 2026
029ee47
Resolve the Newton collection writer masks inline again
hujc7 Oct 27, 2026
bba987b
Revert "Reject PhysX tendon masks whose length differs from the axis"
hujc7 Oct 27, 2026
551e508
Launch the rewritten Newton mask writers over the mask lengths
hujc7 Oct 27, 2026
cf2689b
Launch the PhysX tendon mask writers over the mask lengths
hujc7 Oct 27, 2026
86ce1c9
Write the rewritten Newton mask writers through a core masked write
hujc7 Oct 27, 2026
6dbeab5
Merge branch 'jichuanh/id-mask' into jichuanh/physx-tendon-mask-setters
hujc7 Oct 27, 2026
a9336ff
Write the PhysX tendon mask setters through the core masked write
hujc7 Oct 27, 2026
b37d231
Merge upstream main 6ef40d19a6f into jichuanh/id-mask
hujc7 Oct 28, 2026
4df36b0
Merge jichuanh/id-mask (upstream main 6ef40d19a6f) into jichuanh/phys…
hujc7 Oct 28, 2026
dc2aba6
Align resolve_ids and write_2d_with_mask with the shared memory helpers
hujc7 Oct 29, 2026
1261924
Merge branch 'jichuanh/id-mask' into jichuanh/physx-tendon-mask-setters
hujc7 Oct 29, 2026
cd86460
Resolve ids and masked writes without a device argument
hujc7 Oct 29, 2026
92a413e
Write strided vector components through scalar views instead of copyi…
hujc7 Oct 29, 2026
b75faf3
Merge branch 'jichuanh/id-mask' into jichuanh/physx-tendon-mask-setters
hujc7 Oct 29, 2026
efee1b9
Update camera poses on reset through the resolved mask
hujc7 Oct 29, 2026
8af17a5
Merge branch 'jichuanh/id-mask' into jichuanh/physx-tendon-mask-setters
hujc7 Oct 29, 2026
b7d5295
Merge remote-tracking branch 'upstream/main' into jichuanh/id-mask
hujc7 Oct 29, 2026
48ebd39
Merge branch 'jichuanh/id-mask' into jichuanh/physx-tendon-mask-setters
hujc7 Oct 29, 2026
90afb2f
Pass the tendon test masks as explicit keyword arguments
hujc7 Nov 2, 2026
c5299e5
Pass the short test mask as an explicit env_mask keyword
hujc7 Nov 2, 2026
5caa746
Merge branch 'jichuanh/id-mask' into jichuanh/physx-tendon-mask-setters
hujc7 Nov 2, 2026
3635089
Merge remote-tracking branch 'upstream/main' into jichuanh/id-mask
hujc7 Nov 2, 2026
12a29dc
Merge branch 'jichuanh/id-mask' into jichuanh/physx-tendon-mask-setters
hujc7 Nov 2, 2026
ddcd317
Merge remote-tracking branch 'upstream/main' into jichuanh/id-mask
hujc7 Nov 2, 2026
c3d1227
Merge branch 'jichuanh/id-mask' into jichuanh/physx-tendon-mask-setters
hujc7 Nov 2, 2026
12270ab
Describe the Newton collection and FK changes after the main merge
hujc7 Nov 2, 2026
c471391
Merge branch 'jichuanh/id-mask' into jichuanh/physx-tendon-mask-setters
hujc7 Nov 2, 2026
22b9aed
Merge main 299af193136 into jichuanh/id-mask
hujc7 Nov 9, 2026
c94a9f3
Restore main's FK launch size
hujc7 Nov 9, 2026
6afa0a2
Pass every selection form on and let each consumer pick its own
hujc7 Nov 9, 2026
47b5499
Describe resolve_ids' slice(None) all_ids in the changelog
hujc7 Nov 9, 2026
b75b5a8
Register tendon property writes as a model change as main does
hujc7 Nov 9, 2026
e4e5686
Merge jichuanh/id-mask into jichuanh/physx-tendon-mask-setters
hujc7 Nov 9, 2026
2a65a30
Merge main 2742c2d5e6b into jichuanh/id-mask
hujc7 Nov 10, 2026
16af6de
Merge jichuanh/id-mask into jichuanh/physx-tendon-mask-setters
hujc7 Nov 10, 2026
84470f4
Drop the invalidate_fk changelog line: its launch size is main's again
hujc7 Nov 10, 2026
2fbbcc5
Merge jichuanh/id-mask into jichuanh/physx-tendon-mask-setters
hujc7 Nov 10, 2026
11d840a
Reject masks longer than the destination and leave the slice(None) al…
hujc7 Nov 10, 2026
18a69ef
Merge branch 'jichuanh/id-mask' into jichuanh/physx-tendon-mask-setters
hujc7 Nov 10, 2026
f522b47
Merge main 616f517707d into jichuanh/id-mask
hujc7 Nov 12, 2026
e6e178c
Refresh the solver on every replay of a captured model-property write
hujc7 Nov 12, 2026
f5b7b18
Merge remote-tracking branch 'origin/jichuanh/id-mask' into jichuanh/…
hujc7 Nov 13, 2026
e943308
Merge remote-tracking branch 'upstream/main' into jichuanh/physx-tend…
hujc7 Nov 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ def _physx_articulation(N, J, B, FT, ST, device, is_fixed_base, joint_ordering,
articulation._ALL_JOINT_INDICES = indices(J, device)
articulation._ALL_FIXED_TENDON_INDICES = indices(FT, device)
articulation._ALL_SPATIAL_TENDON_INDICES = indices(ST, device)
articulation._ALL_ENV_MASK = wp.ones(N, dtype=wp.bool, device=device)
articulation._ALL_FIXED_TENDON_MASK = wp.ones(FT, dtype=wp.bool, device=device)
articulation._ALL_SPATIAL_TENDON_MASK = wp.ones(ST, dtype=wp.bool, device=device)
for name in ("joint_pos_target", "joint_vel_target", "joint_effort_target", "body_wrench_force"):
setattr(articulation, f"_{name}_backend", None)
articulation._body_wrench_torque_backend = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
pytestmark = pytest.mark.integration

# Distinct instance, joint, body, and tendon counts so any swapped axis shows up.
N, J, B, FT, ST = 2, 6, 7, 3, 2
N, J, B, FT, ST = 2, 6, 7, 3, 4
_AXIS_COUNTS = {"joint": J, "body": B, "fixed_tendon": FT, "spatial_tendon": ST}


Expand Down Expand Up @@ -154,9 +154,25 @@ def test_resolvers_select_from_their_own_cached_indices(monkeypatch, backend):

@pytest.mark.parametrize("backend", backends("physx", "ovphysx"))
def test_commanding_a_tendon_target_schedules_the_write(monkeypatch, backend):
"""Index and masked length targets schedule the tendon write that ``write_data_to_sim`` performs.

A masked target buffers ``rest_length - target`` for the selected environments and tendons only.
"""
art, _ = _articulation(backend, "cpu", monkeypatch, num_fixed_tendons=2)
art.set_fixed_tendon_position_target_index(target=torch.zeros((N, 2)))
assert art._fixed_tendon_target_dirty is True
art.write_data_to_sim()
assert art._fixed_tendon_target_dirty is False

rest_length = art.data.fixed_tendon_rest_length.torch.clone()
expected = art.data.fixed_tendon_offset.torch.clone()
target = torch.arange(2 * N, dtype=torch.float32).reshape(N, 2) + 0.5
art.set_fixed_tendon_position_target_mask(
target=target, env_mask=_mask(N, [1], "cpu"), fixed_tendon_mask=_mask(2, [1], "cpu")
)
expected[1, 1] = rest_length[1, 1] - target[1, 1]
torch.testing.assert_close(art.data.fixed_tendon_offset.torch, expected)
assert art._fixed_tendon_target_dirty is True


@requires("newton")
Expand Down Expand Up @@ -540,6 +556,57 @@ def read() -> ProxyArray:
method(**{kwarg: wp.from_torch(extra_env.contiguous(), dtype=dtype)})


_TENDON_MASK_SETTERS = [
*[writer for writer in _WRITERS if writer[2] in ("fixed_tendon", "spatial_tendon")],
("set_fixed_tendon_position_target", "target", "fixed_tendon", 0, wp.float32, "data.fixed_tendon_offset"),
]


@pytest.mark.parametrize("backend", backends("physx"))
@pytest.mark.parametrize(
"writer, kwarg, axis, trailing, dtype, getter", _TENDON_MASK_SETTERS, ids=[w[0] for w in _TENDON_MASK_SETTERS]
)
def test_tendon_mask_setters_write_only_what_short_masks_cover(
monkeypatch, backend, writer, kwarg, axis, trailing, dtype, getter
):
"""Masks shorter than their axes write only the entries they cover, like the Newton kernel writers.

Masks and data are views into full-size arrays, so a launch past the mask lengths would write defined values.
"""
art, _ = _articulation(backend, "cpu", monkeypatch)
count = _AXIS_COUNTS[axis]
push = getattr(art, f"write_{axis}_properties_to_sim_index")
push()
expected = attrgetter(getter)(art).torch.clone()
values = _payload((N, count), trailing, dtype, "cpu", offset=100.0)
data = wp.from_torch(values.contiguous(), dtype=dtype)
covered = (slice(N - 1), slice(count - 1))
if writer == "set_fixed_tendon_position_target":
expected[covered] = art.data.fixed_tendon_rest_length.torch[covered] - values[covered]
else:
data = data[covered]
expected[covered] = values[covered]
setter = getattr(art, f"{writer}_mask")
env_mask = _mask(N, range(N), "cpu")[: N - 1]
tendon_mask = _mask(count, range(count), "cpu")[: count - 1]
if axis == "fixed_tendon":
setter(**{kwarg: data}, env_mask=env_mask, fixed_tendon_mask=tendon_mask)
else:
setter(**{kwarg: data}, env_mask=env_mask, spatial_tendon_mask=tendon_mask)
push()
_assert_reads_back(attrgetter(getter)(art), expected, writer)


@pytest.mark.parametrize("backend", backends("physx"))
def test_tendon_position_limit_mask_accepts_strided_torch_limits(monkeypatch, backend):
"""A torch view whose limit pairs are not adjacent in memory writes like contiguous data, as the index setter."""
art, _ = _articulation(backend, "cpu", monkeypatch)
limit = _payload((N, FT), 2, wp.vec2f, "cpu")
art.set_fixed_tendon_position_limit_mask(limit=torch.stack((limit, limit), dim=-1)[..., 0])
art.write_fixed_tendon_properties_to_sim_index()
_assert_reads_back(art.data.fixed_tendon_pos_limits, limit, "strided limit")


@pytest.mark.parametrize("backend", backends("physx", "ovphysx"))
@pytest.mark.parametrize("selection", ["index", "mask"])
def test_friction_mixed_inputs_preserve_other_cells_and_components(monkeypatch, backend, selection):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Changed the :class:`~isaaclab_physx.assets.Articulation` fixed and spatial tendon mask setters to write the
tendon buffers through the masks instead of converting them to indices, removing a host wait per call.
Loading
Loading