Skip to content

Warn about PhysX GPU articulation partition aliasing - #8208

Merged
kellyguo11 merged 3 commits into
isaac-sim:developfrom
kellyguo11:codex/physx-articulation-warning
Oct 2, 2026
Merged

kellyguo11 merged 3 commits into
isaac-sim:developfrom
kellyguo11:codex/physx-articulation-warning

Conversation

@kellyguo11

@kellyguo11 kellyguo11 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a one-time PhysX-side warning during articulation initialization when managed Isaac Lab articulation assets in the scene match the known risk shape from #8121:

  • running on CUDA
  • PhysxCfg.gpu_max_num_partitions > 1
  • more than 32 total managed articulation instances in the scene
  • at least one managed articulation has more than 64 links

The warning points users to the currently recommended workaround, PhysxCfg(gpu_max_num_partitions=1), and references #8121. This also documents the issue and workaround in docs/source/refs/issues.rst.

Refs #8121

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Screenshots

N/A

Validation

  • ./.venv/bin/python -m py_compile source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py
  • /Users/kellyg/.local/bin/uvx ruff format --check source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py
  • /Users/kellyg/.local/bin/uvx ruff check source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py
  • git diff --check

Not run locally:

  • uv run isaaclab --format: blocked because the current lockfile supports Linux/Windows environments but not this macOS host.
  • uv run python -m pytest ...: blocked by the same lockfile platform constraint; this PR does not add tests.
  • Docs build: blocked by the same local environment limitation.
  • tools/changelog/cli.py check develop: direct Python execution runs but reports existing pending-fragment issues across the repo; this PR's fragment uses the current <slug>.fixed.rst bullet format.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • I have made corresponding changes to the documentation
  • My changes generate no new unintended warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump package versions — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@kellyguo11
kellyguo11 requested a review from a team September 30, 2026 18:47
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Sep 30, 2026
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Adds a warning check for a known PhysX GPU issue.

The PR should not merge until the warning also covers scenes whose final qualifying view is registered by a sensor.

Findings

  1. P1 Later sensor views miss warning ▶
  2. P2 Scene warning repeats per asset ▶

Summary

Adds a PhysX GPU articulation partition-aliasing warning, focused gate tests, and a changelog fragment.

  • The warning checks the configured partition count, device, registered articulation instances, and maximum link count.
  • The warning can miss a scene that crosses the instance threshold when a sensor registers the last view, and can repeat for many subsequent assets.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Articulation initializes] --> B[Registers its view]
  B --> C[Checks current registry and may warn]
  C --> D[Joint-wrench sensor initializes]
  D --> E[Registers another articulation view]
  E --> F[Risk threshold crossed without another warning check]
Loading

Reviews (1) · Last reviewed commit: "Warn about PhysX GPU articulation partit..."

)
if self.root_view._backend is None:
raise RuntimeError(f"Failed to create articulation at: {root_prim_path_expr}. Please check PhysX logs.")
self._maybe_warn_gpu_articulation_partition_aliasing()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Later sensor views miss warning

If a joint-wrench sensor initializes after the articulation assets and its view takes the scene above 32 instances, this check does not run again. For example, a 20-instance articulation with 65 links followed by a sensor view of 13 other instances meets the stated risk conditions but produces no warning. The tests call the helper directly, so they do not cover this initialization order.

):
return

logger.warning(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Scene warning repeats per asset

Once the thresholds are crossed, each subsequent articulation initialization logs the same scene-level warning. A scene with 100 separately initialized qualifying views can produce 68 warnings in one initialization pass, burying other diagnostics. Deduplicating the warning per scene would avoid that noise.

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!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an issue since most scene would only have a single view, maybe 2 - 3 at most.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s fair—if qualifying scenes typically contain only a few articulation views, the repetition concern is negligible. The current module-level _gpu_articulation_aliasing_warning_logged flag also limits the warning to once per process, so this is not an actionable issue. You can disregard my comment.

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

The warning gate’s thresholds and message are correct, but a scene-wide diagnostic is currently evaluated during each articulation’s initialization, causing order-dependent counts and potentially repeated warnings. The config access also violates the repository’s direct-attribute rule.

  • Design and architecture: Finding 0: _maybe_warn_gpu_articulation_partition_aliasing() scans the scene-wide SimulationManager.views registry from every asset’s _initialize_impl. Because views are registered incrementally, the count depends on initialization order; after the threshold is crossed, later articulations can emit the same warning repeatedly. Move the check to a manager-level point after view registration is complete, or add a backend-lifecycle latch so it warns at most once with a complete aggregate.
  • API: No public symbol, signature, configuration field, registry key, or serialized form changes. The new helper and constants are private; the observable API behavior is limited to an added initialization warning.
  • Compatibility and deprecation: Breaking changes: none identified. The changes are additive and preserve existing PhysX articulation signatures, defaults, return values, and configuration contracts.
  • Implementation: The CUDA, partition-count, total-instance, and maximum-link gates use the intended strict threshold semantics. Finding 1: getattr(physics_cfg, "gpu_max_num_partitions", 1) silently suppresses the diagnostic if the known PhysX configuration field is missing or renamed. After handling None, access physics_cfg.gpu_max_num_partitions directly.
  • Style consistency: Private naming, constant placement, helper ordering, docstring form, and changelog formatting match adjacent patterns. The reflective config read conflicts with the repository rule requiring direct access for known attributes and prohibiting defaults that hide missing required fields.
  • Test quality: The two added tests provide distinct positive and negative coverage for the warning gate. The negative parameter rows independently exercise CPU, single partition, the 32-instance boundary, and the 64-link boundary, without duplicating existing coverage. However, the tests do not expose the order-dependent scene count or repeated-warning behavior identified in finding 0.

Minor fixes needed. Posted 2 actionable findings inline.

Automated review; human maintainers own approval decisions.

)
if self.root_view._backend is None:
raise RuntimeError(f"Failed to create articulation at: {root_prim_path_expr}. Please check PhysX logs.")
self._maybe_warn_gpu_articulation_partition_aliasing()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Design Architecture — Scene-wide warning runs per articulation init

This scene-level aggregate is invoked from every articulation's _initialize_impl, but SimulationManager.views only contains the views registered so far. Early articulations therefore report an under-counted total_articulation_count, and once the thresholds are crossed every subsequently initialized articulation logs the same message again. Evaluate this once after all views exist (manager-level hook) or latch it so it warns at most once per backend lifecycle.

def _maybe_warn_gpu_articulation_partition_aliasing(self) -> None:
"""Warn about a known PhysX GPU articulation solver partition issue."""
physics_cfg = self._sim_cfg.physics if self._sim_cfg is not None else None
gpu_max_num_partitions = getattr(physics_cfg, "gpu_max_num_partitions", 1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Suggestion · Style Consistency — getattr default hides known PhysxCfg field

The coding style requires direct attribute access and forbids getattr defaults for known attributes or to hide a missing required field. gpu_max_num_partitions is a declared PhysxCfg field on this PhysX-only path, so the default of 1 would silently disable the diagnostic forever if the field is renamed. After the existing None guard, read physics_cfg.gpu_max_num_partitions directly.

@AntoineRichard AntoineRichard self-assigned this Oct 1, 2026

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI review (Claude Code) — see inline comment.

if (
"cuda" not in self.device
or physics_cfg.gpu_max_num_partitions <= 1
or self.num_instances <= _GPU_ARTICULATION_ALIASING_INSTANCE_THRESHOLD

@AntoineRichard AntoineRichard Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI review — generated with Claude Code, posted on behalf of @AntoineRichard. Please verify before acting on it.

Instance threshold is checked per articulation view, not per scene

self.num_instances is the count of this articulation view only. Per #8121, the aliasing triggers when the scene has more than 32 GPU articulations and any of them has more than 64 links. Scenes with several articulation assets will therefore not get the warning.

Example: 20 envs, each with a 65-link robot (Articulation A) plus a small articulated object (Articulation B) → 40 GPU articulations in the scene, which is above the 32-pair aliasing limit, so with the default gpu_max_num_partitions=8 envs can corrupt each other. But A sees num_instances=20 <= 32 and B sees num_bodies <= 64, so neither warns. Same with e.g. 16 large robots + 32 small articulations.

Potential solution: running scene-wide tally

All articulations initialize sequentially inside the single PhysicsEvent.PHYSICS_READY dispatch in PhysxManager.reset(), and both conditions only grow as more articulations initialize (total count up, max link count never down). So the check can stay where it is, but evaluate scene-wide aggregates; whichever articulation initializes last will trip it.

# module level
_GPU_ARTICULATION_ALIASING_LINK_THRESHOLD = 64
_GPU_ARTICULATION_ALIASING_INSTANCE_THRESHOLD = 32
# keyed by the physics sim view so a new stage/sim context starts fresh
_articulation_tally: dict[int, dict[str, tuple[int, int]]] = {}
_gpu_articulation_aliasing_warning_logged = False


def _maybe_warn_gpu_articulation_partition_aliasing(self) -> None:
    global _gpu_articulation_aliasing_warning_logged
    if _gpu_articulation_aliasing_warning_logged or self._sim_cfg is None:
        return
    if "cuda" not in self.device or self._sim_cfg.physics.gpu_max_num_partitions <= 1:
        return

    # key by the view's prim path so re-initialization (stop -> play) overwrites instead of double counting
    tally = _articulation_tally.setdefault(id(self._physics_sim_view), {})
    tally[self.cfg.prim_path] = (self.num_instances, self.num_bodies)

    total = sum(n for n, _ in tally.values())
    max_links = max(links for _, links in tally.values())
    if total <= _GPU_ARTICULATION_ALIASING_INSTANCE_THRESHOLD or max_links <= _GPU_ARTICULATION_ALIASING_LINK_THRESHOLD:
        return

    _gpu_articulation_aliasing_warning_logged = True
    logger.warning(...)

Notes:

  • id() of the sim view can be reused after it is garbage-collected; clearing the tally in PhysxManager.close() would be more robust.
  • This only counts articulations wrapped by an Isaac Lab Articulation. Raw USD articulation roots not managed by an asset still count toward PhysX's limit but are invisible here. A more complete (but heavier) alternative is a one-shot check in PhysxManager.reset() right after the PHYSICS_READY dispatch that counts UsdPhysics.ArticulationRootAPI prims on the stage — at the cost of a full stage traversal at large env counts.

Minor, non-code: the PR body says Fixes #8121, which will auto-close the issue on merge even though the underlying PhysX bug (NVIDIA-Omniverse/PhysX#530) remains. Refs #8121 would keep it open.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in ef08bd8: the warning now uses a scene-wide running tally across managed PhysX Articulation assets keyed by the active simulation view, and the tally/warned state is cleared from PhysxManager._invalidate_views(). I also added the known issue and workaround to docs/source/refs/issues.rst and changed the PR body to Refs #8121 so the upstream PhysX issue remains tracked.

@kellyguo11
kellyguo11 requested a review from StafaH as a code owner October 1, 2026 16:26
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 1, 2026
@kellyguo11

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 2, 2026
@kellyguo11
kellyguo11 merged commit a162893 into isaac-sim:develop Oct 2, 2026
59 checks passed
isaaclab-bot Bot pushed a commit that referenced this pull request Oct 2, 2026
# Description

Adds a one-time PhysX-side warning during articulation initialization
when managed Isaac Lab articulation assets in the scene match the known
risk shape from #8121:

- running on CUDA
- `PhysxCfg.gpu_max_num_partitions > 1`
- more than 32 total managed articulation instances in the scene
- at least one managed articulation has more than 64 links

The warning points users to the currently recommended workaround,
`PhysxCfg(gpu_max_num_partitions=1)`, and references #8121. This also
documents the issue and workaround in `docs/source/refs/issues.rst`.

Refs #8121

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- Documentation update

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

## Screenshots

N/A

## Validation

- `./.venv/bin/python -m py_compile
source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py
source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py`
- `/Users/kellyg/.local/bin/uvx ruff format --check
source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py
source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py`
- `/Users/kellyg/.local/bin/uvx ruff check
source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py
source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py`
- `git diff --check`

Not run locally:

- `uv run isaaclab --format`: blocked because the current lockfile
supports Linux/Windows environments but not this macOS host.
- `uv run python -m pytest ...`: blocked by the same lockfile platform
constraint; this PR does not add tests.
- Docs build: blocked by the same local environment limitation.
- `tools/changelog/cli.py check develop`: direct Python execution runs
but reports existing pending-fragment issues across the repo; this PR's
fragment uses the current `<slug>.fixed.rst` bullet format.

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`uv run isaaclab --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new unintended warnings
- [ ] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump package versions — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

(cherry picked from commit a162893)
@isaaclab-bot

isaaclab-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as 48ec7c1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants