Repository navigation
[Backport] PRs #7990, #7985, and #8025 to release/3.0.0 - #8023
Conversation
) The fixed-tendon integration regression failed at `sim.reset()` after `replicate(sim.get_clone_plan())` before reset, matching the other articulation tests. The original environment, event-manager, and tendon fixes from this PR were already merged through the stacked #7990. This update resolves the conflicts against current `develop`, preserves its newer tendon implementation and expanded regression, and leaves only the missing test setup call plus the required changelog marker. - 21 checks passed: 6 articulation-event tests, 13 event-manager tests, the indexed-dictionary curriculum regression, and the GPU tendon regression. - The tendon regression passed with the pinned Newton 1.6.0 and MuJoCo Warp 3.12.0 on an RTX 5090. It covers stiffness, damping, position limits, and selected environment/tendon updates. - Before the setup call, the test failed because no Newton builder had been supplied. With the setup corrected, removing only `ModelFlags.TENDON_PROPERTIES` notification makes the test fail numerically: solver stiffness remains 0 instead of 12. - All formatting and pre-commit checks passed. - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` --------- Co-authored-by: Octi Zhang <[email protected]> (cherry picked from commit 49bd35f)
Keep 50 m of visible flat ground beyond each edge of the environment grid. Previously, large batches had only one environment spacing of margin, so locomotion robots could walk off the visible mesh while still standing on the infinite collision plane. | Environments | Spacing | Visual width before → after | Margin per side before → after | |---|---|---|---| | 1 | 1 m | 100 → 100 m | 50 → 50 m | | 4,096 | 4 m | 260 → 352 m | 4 → 50 m | | 16,384 | 2.5 m | 322.5 → 417.5 m | 2.5 → 50 m | The existing UV rescaling preserves **1 m checker cells / 2 m texture repeats** at every size. The infinite collision plane and explicit `import_ground_plane(size=...)` overrides are unchanged. **No rough-terrain, heightfield, solver, or task-parameter changes.** - `uv run isaaclab -f`: passed. - Default-ground-plane asset/material tests: 3 passed. - CPU USD authoring checks at 1 / 4,096 / 16,384 origins verified the actual transformed mesh bounds and metric UV repeats. The margin assertion failed on the base and passed with this fix. - Headless GL before/after images at 20 m beyond a 16,384-environment grid corner: the old mesh ended behind the marker; the enlarged mesh covered it with unchanged checker size. This used a tiny static scene, not 16,384 simulated robots. - A 16-environment Go2-flat checkpoint replay passed 300 policy steps in the active training checkout with this same ground-size fix applied; robot and floor remained visible. - Fresh `develop` with Newton 1.6.0 produced a blank viewport with **both** the base and patched ground-size formulas (pixel-identical control frames). That playback was not counted as a successful visual check. - Extended the existing terrain-importer integration test across those batch sizes. The full Kit integration suite was not run locally. Bug fix (visualization only). - [ ] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` - [x] Formatting checks passed. - [x] Updated the API docstring and existing regression test. - [x] Added an `isaaclab` changelog fragment. Co-authored-by: ooctipus <[email protected]> (cherry picked from commit 8ae33e5)
…025-release-3.0.0
Follow-up to #7985 in the series that splits the core cleanup in #7949 into small, reviewable pieces. It makes the fixed tendon position-limit API consistent across the PhysX, OVPhysX, and Newton backends, and fixes the Newton fixed tendon mask API. > **Stacked on #7985.** Until that merges, this diff also shows its two commits. The PR-specific commits fix tendon position limits and clarify the remaining Newton property mappings. The data layout was inconsistent: `fixed_tendon_pos_limits` is documented and reported as `wp.vec2f` of shape (N, T) (torch: (N, T, 2)), but the setters disagreed. - **PhysX:** the setters validated (N, T) `wp.float32` and wrote with a 2D float kernel, while the buffer is (N, T, 2). They could not accept the layout the asset reports, which is why `test_articulation_iface.py` excluded them. They now validate `wp.vec2f` (torch tensors with a trailing dimension of 2), like `write_joint_position_limit_to_sim_*`. - **OVPhysX:** the setters accepted only the (N, T, 2) `wp.float32` form and rejected `wp.vec2f` arrays (e.g. `data.fixed_tendon_pos_limits.warp`); a float reached the kernel instead of raising. They now accept both forms and raise `ValueError` for a float, like the OVPhysX joint position limits. - **Newton:** raised `NotImplementedError`. They now write the MuJoCo `tendon_range` (already bound for reading `fixed_tendon_pos_limits`), which `write_fixed_tendon_properties_to_sim_*` applies and the solver refreshes on `ModelFlags.TENDON_PROPERTIES` (added in #7985). With this, `randomize_fixed_tendon_parameters` can randomize position limits on all three backends. - `set_fixed_tendon_stiffness_mask` / `set_fixed_tendon_damping_mask` called `_resolve_env_mask` and `_resolve_fixed_tendon_mask`, which the Newton articulation does not define (only its rigid object collection does), and passed `full_data=True` to index setters without that argument. Both always raised. The articulation now has the mask-to-index helpers, and the mask setters pass the selected data to the index setters. - `write_fixed_tendon_properties_to_sim_mask` called `_resolve_mask` without its required argument, got a boolean mask where indices were needed, and passed `env_ids` positionally to a keyword-only method. It now resolves the masks and forwards them. - The fixed tendon writers now take the `fixed_tendon_ids` / `fixed_tendon_mask` arguments the base class declares. The force-gain implementation is now proposed in [Newton [Isaac Lab setters implemented on a dependent branch](https://github.com/ooctipus/IsaacLab/tree/fix/pr7990-tendon-limit-gains). Those setters require the Newton API addition and are kept out of this PR until the dependency is updated. The existing Newton 1.6.0 pin remains unchanged here. Newton's MuJoCo solver supports tendons. Corrected errors and API docs that called tendons PhysX-only or implied that MuJoCo cannot represent limit stiffness. The shared limit-stiffness, rest-length, and offset setters remain unimplemented; position ranges only act on tendons with limits enabled in the model. Newton already [converts joint-limit force gains to solref](https://github.com/newton-physics/newton/blob/v1.6.0/newton/_src/solvers/mujoco/kernels.py#L2622-L2732), scaling stiffness and damping by inverse inertia times `(1 - dmax)`. An isolated GPU check with Newton 1.6.0 / MuJoCo Warp 3.12 and constant impedance 0.95 adapted this conversion using `tendon_invweight0`: a 3 N load remained at the expected 3 cm limit penetration for stiffness 100 N/m, with both 1 kg and 10 kg masses. This verifies static compliance in that setup, not full PhysX trajectory parity. A tendon conversion should live in Newton's solver, where it can refresh after inertia changes. Before enabling the shared setter, reconcile these behaviors: - PhysX's damping also enters its limit response; MuJoCo has separate passive and limit damping. Copying the shared damping into both needs validation against [PhysX's tendon spring implementation](https://github.com/NVIDIA-Omniverse/PhysX/blob/da950a3537927784951853c66618036f332ca0ce/physx/source/lowleveldynamics/shared/DyCpuGpuArticulation.h#L765-L855). - Newton's joint converter resets nonpositive stiffness or damping to MuJoCo's default solref. That fallback does not preserve a shared API's zero-gain meaning. - Finite impedance and timestep clamping affect transient response even when static compliance matches. The Newton property writer also now reads each staged value at the selected environment/tendon indices. Previously, writing environment 1, tendon 1 could silently copy environment 0, tendon 0. - `test/assets/test_articulation_iface.py`: `set_fixed_tendon_position_limit` is added to the fixed tendon writer matrix (torch/warp × index/mask × all/subset × invalid input) for the mock, PhysX, and OVPhysX backends; the note excluding it is removed. 12 of these cases fail on `develop`. - `isaaclab_newton/test/assets/test_articulation.py`: `test_fixed_tendon_properties_reach_solver` now uses a mask setter, the position-limit setter, and the mask writer, and checks the MuJoCo model's `tendon_range`. It fails on #7985 alone. - The full `test_articulation_iface.py` (1965 passed) and the Newton tendon tests pass. - The Newton integration regression now covers two environments and a selected stiffness/damping update. It fails with the original writer (12 instead of the requested 42 at environment 1, tendon 1) and passes after the fix with Newton 1.6.0. All formatting/pre-commit checks passed. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump `extension.toml` — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` --------- Signed-off-by: Octi Zhang <[email protected]> Co-authored-by: Octi Zhang <[email protected]> (cherry picked from commit fa5837c)
|
run-ci |
|
| def _mask_to_ids(mask: wp.array | torch.Tensor) -> torch.Tensor: | ||
| """Convert a boolean mask to int32 indices.""" | ||
| mask = wp.to_torch(mask) if isinstance(mask, wp.array) else mask | ||
| return torch.nonzero(mask)[:, 0].to(torch.int32) |
There was a problem hiding this comment.
Masked writes break graph capture
When a caller supplies an environment or tendon mask inside a captured CUDA pipeline, the mask writer reaches torch.nonzero here. That operation produces a variable-length result and synchronizes with the host, so the masked update cannot be captured or replayed as the method promises. Keep mask selection graph-safe.
Knowledge Base Used: Newton backend
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| num_cols = int(np.ceil(self.cfg.num_envs / num_rows)) | ||
| spacing = self.cfg.env_spacing or 0.0 | ||
| return (max(100.0, (num_rows + 1) * spacing), max(100.0, (num_cols + 1) * spacing)) | ||
| return ((num_rows - 1) * spacing + 100.0, (num_cols - 1) * spacing + 100.0) |
There was a problem hiding this comment.
Negative spacing shrinks visible ground
The terrain configuration accepts negative env_spacing, but this formula subtracts from the visual-plane size instead of accounting for the grid's absolute span. With 4,096 environments spaced at −4 m, it produces a −152 m size; the resulting visual mesh no longer covers the outer environment origins even though collision remains infinite. Use the grid's absolute span or reject negative spacing.
Knowledge Base Used: Scene and asset composition
There was a problem hiding this comment.
Isaac Lab Review Bot
The backport’s tendon writer and position-limit changes are generally coherent, but the Newton mask implementation breaks the documented graph-friendly path, and the public position-limit contracts remain inconsistent with accepted input layouts and annotations.
- Design and architecture: Newton’s new fixed-tendon mask entry points convert masks through
torch.nonzero, introducing a data-dependent CUDA synchronization path despite documenting mask APIs as suitable for graphed pipelines. These paths should retain the existing Warp mask/kernel pattern. - API: The OVPhysX position-limit docstrings omit the newly accepted
wp.vec2flayout. PhysX and Newton position-limit setters also continue to annotate scalar floats as valid even though they now deterministically reject them; their annotations should match the tensor/array-only contract. - Implementation: The functional fixes for selected tendon writes, position-limit staging, solver notifications, backend-dispatched randomization, curriculum traversal, event reset handling, and ground-plane sizing align with the supplied callers and regressions. Before merge, the Newton mask implementation and the affected public API documentation/types should be corrected.
Minor fixes needed. Posted 3 actionable findings inline.
Automated review; human maintainers own approval decisions.
| def _mask_to_ids(mask: wp.array | torch.Tensor) -> torch.Tensor: | ||
| """Convert a boolean mask to int32 indices.""" | ||
| mask = wp.to_torch(mask) if isinstance(mask, wp.array) else mask | ||
| return torch.nonzero(mask)[:, 0].to(torch.int32) |
There was a problem hiding this comment.
🟡 Warning · Design Architecture — Tendon mask paths resolve through torch.nonzero
_mask_to_ids uses torch.nonzero, whose output shape is data-dependent and which synchronizes on CUDA. Every new fixed-tendon mask entry point (set_fixed_tendon_*_mask, write_fixed_tendon_properties_to_sim_mask) now routes through it, yet the writer's own tip states the mask method must be used for graphed pipelines. Prefer the existing _resolve_mask plus mask-kernel pattern used by the other mask APIs in this file.
| if isinstance(limit, float): | ||
| raise ValueError("Fixed tendon position limits must be a tensor or array, not a float.") | ||
| # accept both wp.vec2f (N, T) and the (N, T, 2) wp.float32 form, like the joint position limits | ||
| if isinstance(limit, wp.array) and limit.dtype == wp.vec2f: |
There was a problem hiding this comment.
🔵 Suggestion · Implementation — vec2f input layout left undocumented
Both OVPhysX position-limit setters now accept wp.vec2f arrays of shape (num_envs, num_fixed_tendons), but the Args sections directly above still document only (..., 2) wp.float32 inputs. The public docstrings therefore contradict the newly supported contract recorded in the changelog fragment. Update both index and mask docstrings to list the accepted wp.vec2f shape, matching the PhysX and Newton wording.
| ], | ||
| device=self.device, | ||
| ) | ||
| raise ValueError("Fixed tendon position limits must be a tensor or array, not a float.") |
There was a problem hiding this comment.
🔵 Suggestion · Api — Float limit rejected but still annotated
set_fixed_tendon_position_limit_index/_mask still declare limit: float | torch.Tensor | wp.array, but a float now deterministically raises ValueError (the Newton override does the same). Typed callers and generated API docs advertise an input the implementation refuses. Narrow the annotations to torch.Tensor | wp.array on both backends and note the dropped scalar form in the changelog fragment.
Backports #7990, #7985, and #8025 to
release/3.0.0, plus the OVPhysX interface-fixture initialization fix from #8022.The Newton CI failure came from an incomplete backport: #7985's tendon regression was present, but #7990's implementation was missing. The test failed in
set_fixed_tendon_stiffness_maskwithAttributeError: _resolve_env_mask. The automatic #7990 backport failed during source-range validation.fa5837c019db44e7f7bdd2c78a8a258188d65a13; backport:6fdf02b13.replicate(sim.get_clone_plan())setup in the tendon integration regression when resolving the overlapping test.Merged the current release base,
44e290c2d, before applying the missing changes. All production and documentation files touched by #7990 now matchdevelopexactly. The Newton dependency pin is unchanged.Validation:
This PR remains a draft pending release-maintainer review.