Skip to content

Fix asset benchmark initialization and timing noise - #8851

Merged
StafaH merged 4 commits into
isaac-sim:mainfrom
AntoineRichard:codex/fix-asset-benchmarks
Nov 15, 2026
Merged

StafaH merged 4 commits into
isaac-sim:mainfrom
AntoineRichard:codex/fix-asset-benchmarks

Conversation

@AntoineRichard

@AntoineRichard AntoineRichard commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Asset micro-benchmarks could abort on missing mock initialization or CPU gravity buffers during CUDA reads. Newton's timed mock callbacks recorded call histories and retained array arguments, while automatic cyclic garbage collection remained enabled during sampling. These issues were found while benchmarking #8843.

This fixes the PhysX, Newton, and OVPhysX mock setup, uses non-recording Newton callbacks during benchmarking, and suspends automatic cyclic GC only while collecting samples, restoring the caller's state on failure too. It also includes the seven missing packed root/body state readers, prepares their dependencies outside timing, and keeps Newton rigid-object root/body sources consistent. This PR is based on main and does not depend on #8843.

Type of change

  • Bug fix
  • Documentation update

Validation

  • 82 existing/focused benchmark tests passed, with each file run separately. Added one small GC lifecycle regression and extended the existing Newton refresh test; confirmed both detect the original failures before applying the fixes.
  • All nine GPU reader/writer CLI combinations passed: PhysX, Newton MJWarp, and OVPhysX × articulation, rigid object, and collection. Used 32 instances, all input modes, one warmup and two timed calls; checked all 2,003 emitted statistical measurements were finite with n=2. These are correctness smoke runs, not performance reference numbers.
  • All 42 added packed-reader cases matched an independent pose/velocity concatenation exactly on CUDA.
  • Full uv run isaaclab -f, changelog validation, git diff --check, and clean uv run --extra dev isaaclab --docs passed. Existing dependency/task deprecation notices remain.
  • GPU validation used an RTX 5090, Python 3.12, Torch 2.11.0+cu128, Warp 1.17.0, Newton 1.8.0.dev0, and OVPhysX 0.6.4.72118723, with imports verified against this worktree.

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 warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to test changes
  • I have added a changelog fragment for every touched source package
  • My name already exists in CONTRIBUTORS.md

@AntoineRichard
AntoineRichard requested a review from a team October 27, 2026 10:23
@github-actions github-actions Bot added bug Something isn't working documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Oct 27, 2026
@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Fixes asset benchmark setup and reduces noise in timed samples.

  • Timed asset samples avoid cyclic collection and Newton call-history noise.
  • Asset benchmarks now include seven packed root and body state readers.
  • Backend mock assets now have the setup their benchmark calls need.

Review was based on code inspection; no tests were run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Initialize mock targets] --> B[Preflight and warmup]
    B --> C[Save GC state and disable automatic GC]
    C --> D[Refresh inputs and prepare dependencies]
    D --> E[Time one synchronized operation]
    E --> F{More samples?}
    F -->|Yes| D
    F -->|No| G[Restore prior GC state]
    D -->|Failure| G
    E -->|Failure| G
    G --> H[Return statistics or raise error]
Loading

Reviews (1) · Last reviewed commit: "Fix asset benchmark initialization and t..." · Reviewed by Greptile

@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

Needs attention: Style consistency (1). Other reviewed categories look good.

  • PR description: The description matches the diff, but “large latency outliers” is unmeasured; add reproducible base/head results with revisions, command, hardware, backend, environment count, warmup, iterations, and a dispersion metric.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: Implementation looks good.
  • Style consistency: The user benchmark page exposes Newton mock call-history internals already covered by the backend changelog; this adds maintenance-only prose, so delete that sentence.
  • Test quality: Test quality looks good.

Minor fixes needed. Posted 1 inline finding.

Automated review; human maintainers own approval decisions.

objects. Their pose and velocity dependencies are prepared outside the timed
call. Automatic cyclic garbage collection is suspended during each batch of
timed asset calls, then its previous state is restored. Newton mock callbacks
do not retain call histories.

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 · Style Consistency — Harness internals in user benchmark docs

"Newton mock callbacks do not retain call histories" documents benchmark-fixture internals with no user-facing contract and repeats the isaaclab_newton changelog fragment. Delete that sentence; keep the GC and untimed-dependency notes that affect result interpretation.

@hujc7

hujc7 commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

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 Nov 2, 2026
}
OVPHYSX_RIGID_OBJECT_DEPENDENCIES = RIGID_OBJECT_DEPENDENCIES

OBJECT_COLLECTION_DEPENDENCIES = {

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.

PhysX rigid_object_collection still benchmarks body_state_w, body_link_state_w, body_com_state_w and object_state_w with no dependencies declared, so the timed read includes recomputing their pose/velocity inputs (3.6–5.6× higher on a 4096×4 mock run). Same fix as the articulation table; fine here or as a follow-up.

Suggested edit:

Suggested change
OBJECT_COLLECTION_DEPENDENCIES = {
OBJECT_COLLECTION_DEPENDENCIES = {
"body_state_w": ("body_link_pose_w", "body_com_vel_w"),
"body_link_state_w": ("body_link_pose_w", "body_link_vel_w"),
"body_com_state_w": ("body_com_pose_w", "body_com_vel_w"),
"object_state_w": ("body_link_pose_w", "body_com_vel_w"),

@maxkra15 maxkra15 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.

The isolated articulation signature test now fails: TT imports while ovphysx is blocked. Add a TT stub at that test boundary, or defer the new import until after binding construction. Normal repository pytest reproduces it.

@AntoineRichard

Copy link
Copy Markdown
Collaborator 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 Nov 10, 2026
@AntoineRichard

Copy link
Copy Markdown
Collaborator 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 Nov 10, 2026

@maxkra15 maxkra15 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.

The binding import order is fixed. Benchmark/runtime checks pass:32 tests,1 optional skip. Current-head CI is green.

@AntoineRichard
AntoineRichard enabled auto-merge (squash) November 11, 2026 17:53
@StafaH
StafaH disabled auto-merge November 15, 2026 19:58
@StafaH
StafaH merged commit b1c22cd into isaac-sim:main Nov 15, 2026
77 of 91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 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.

5 participants