Fix backend factory fallback before simulator initialization - #7121
Conversation
Greptile SummaryThe PR fixes backend detection before simulator initialization by returning the documented PhysX compatibility fallback when no
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The null guard makes the implementation match its documented pre-initialization contract, and backend selection remains dynamically resolved after a simulation context exists. Important Files Changed
Reviews (1): Last reviewed commit: "docs: note backend fallback fix" | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
The change adds the missing None guard so backend resolution returns the documented physx fallback before SimulationContext initialization. The focused regression test and changelog fragment align with that behavior.
- Design and architecture: Backend selection remains contained within
FactoryBase._get_backend(). Existing initialized-context routing fornewton,ovphysx, andphysxis unchanged, and the fallback continues through the established registry and module-resolution paths. - API: The method retains its
strreturn contract and changes no public symbols or exports. Pre-initialization behavior now matches the existing docstring rather than raising while dereferencing a nonexistent context. - Implementation: The early return directly prevents access to
physics_managerwhenSimulationContext.instance()isNone. The regression test covers that boundary, though its setup uses the privateSimulationContext._instanceattribute as a small non-blocking maintenance tradeoff.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
1de1346 to
63ece49
Compare
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
63ece49 to
e39376f
Compare
|
Updated per the team confirmation: the pre-context backend fallback is now |
|
Hi @sylvesterkaczmarek thanks for the pr, we have a test file called source/isaaclab/test/utils/test_backend_utils.py, can you put your test there |
Sure. Thanks for your guidance. |
|
Done. The fallback test is now in test_backend_utils.py, and the standalone test file has been removed. |
Head branch was pushed to by a user without write access
…7299) ## Summary Backports the following merged changes to `release/3.0.0` as separate provenance-preserving cherry-picks: - #7292 — scope Newton global imports with clone plans - #7285 — stabilize the sensor/PhysX video recording test - #7269 — streamline Newton contact and raycast sensor startup - #7119 — normalize non-finite depth display values safely - #7295 — avoid repeated Newton model and articulation startup work Each source squash commit was cherry-picked with `-x` and applied without conflicts. ## Validation - Stable patch IDs match all five source squash commits exactly. - File-by-file manifests match each source squash commit. - `git diff --check upstream/release/3.0.0..HEAD` - `uv run --frozen python tools/changelog/cli.py check backport-7285-7292-base` - `SKIP=check-changelog-fragments uv run --frozen isaaclab -f` - Cloner/Newton focused tests: 98 passed - Scene global-ownership tests: 2 passed - Simulator clone-plan tests: 4 passed - Video recording regression test: 1 passed - Newton BVH lifecycle tests: 2 passed - Newton contact-selector tests: 7 passed - Newton raycast BVH test: 4 passed - Non-finite depth display tests: 4 passed - #7295 physics lifecycle, cloner, manager, and coupling tests: 248 passed - #7295 Newton joint-wrench sensor tests: 11 passed - #7295 PhysX joint-wrench sensor tests: 16 passed PR #7121 remains open and is intentionally excluded; it will be backported from its final merge commit after merging. --------- Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Co-authored-by: matthewtrepte <mtrepte@nvidia.com> Co-authored-by: camevor <camevor@nvidia.com> Co-authored-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Co-authored-by: Antoine RICHARD <antoiner@nvidia.com>
…im#7121) # Description `FactoryBase._get_backend()` can be called before a `SimulationContext` has been created, but it previously dereferenced `SimulationContext.instance().physics_manager` unconditionally. `SimulationContext.instance()` returns `None` before initialization, so backend resolution could fail before any fallback was applied. Following maintainer confirmation, the pre-context fallback is now `newton`. Initialized backend resolution remains unchanged for Newton, PhysX, and OV PhysX contexts. A separate follow-up should update `SimulationCfg(physics=None)` to default to Newton as well; that broader configuration-default change is intentionally outside this PR. ## Validation Adds unit coverage for backend resolution with `SimulationContext._instance` unset and verifies the `newton` fallback. ## Type of change - Bug fix --------- Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Co-authored-by: ooctipus <zhengyuz@nvidia.com> (cherry picked from commit 9f65e3d)
…#7303 (#7313) # Description Backports six merged PRs to `release/3.0.0` as separate provenance-preserving cherry-picks: | Source PR | Source commit | Backport commit | Scope | | --- | --- | --- | --- | | #7272 | `0081477fea2` | `c9fc1997476` | Fix scene-wide gravity distributions for PhysX and OvPhysX. | | #7121 | `9f65e3d4fd2` | `cce8acd84e1` | Fix backend-factory fallback before simulator initialization. | | #7183 | `3fcc9c6b824` | `99d58d3d3c4` | Streamline the getting-started documentation. | | #7306 | `6aad90be0ae` | `9a786cc028a` | Optimize Newton test runtime. | | #7305 | `1c9ba908cf1` | `a2dc8ce948e` | Disable Warp autodiff in the test suite. | | #7303 | `393fc37d2b0` | `249a5cb97d8` | Remove post-Hydra preset resolution. | #7272 forwards the validated `uniform`, `log_uniform`, or `gaussian` distribution through both scene-wide backend paths. Newton behavior is unchanged. #7121 makes factory resolution fall back to Newton when no `SimulationContext` exists while retaining the visualizer contract of reporting no active backend before context creation. #7183 is documentation-only. #7306 and #7305 change test infrastructure only; they do not change runtime behavior. #7303 makes `resolve_task_config` and `parse_env_cfg` the task-composition boundary. Runtime consumers now require concrete physics, renderer, and camera configurations and no longer attempt late preset fallback after Hydra composition. The branch was synchronized with the current `release/3.0.0` tip containing #7301 before #7303 was applied. All six source cherry-picks applied without conflicts. A file-by-file existence, mode, and blob audit confirmed that every #7303 path matches its merged source commit exactly. ## Validation ### #7272 - Regression verification against the unpatched `release/3.0.0` tip — both PhysX and OvPhysX cases failed as expected. - `uv run --extra test --frozen python -m pytest -q source/isaaclab/test/envs/test_gravity_randomization.py source/isaaclab/test/envs/test_mdp_event_selectors.py` — 7 passed. - `uv run --extra test --extra ovphysx --frozen python -m pytest -q source/isaaclab_ov/test/physics/test_ovphysx_gravity.py` — 1 passed. ### #7121 - Regression verification before the #7121 cherry-pick reproduced the original `NoneType.physics_manager` failure. - `uv run --extra test --frozen python -m pytest -q source/isaaclab/test/utils/test_backend_utils.py source/isaaclab/test/visualizers/test_visualizer.py` — 18 passed. ### #7183 - `uv run --frozen --extra test python -m pytest --noconftest -q tools/test/test_environ_docs.py` — 26 passed. ### #7306 - All 9 affected paths match the merged source PR exactly. - The full simulator-backed Newton suite is left to backport CI because this local worktree does not include the full Isaac Sim runtime. ### #7305 - Loaded the root `conftest.py` successfully with Warp unavailable. - Loaded it with Warp installed and confirmed `wp.config.enable_backward is False`. ### #7303 - Hydra and Shadow Hand camera suites — 129 passed. - Benchmark capture and RL entrypoint suites — 31 passed. - Experimental frontend and custom-coupling suites — 74 passed, 1 skipped. - Ruff and Ruff-format passed for every changed Python path. - Source/backport audit — 54 paths checked, 0 mismatches. - The Isaac Sim-backed integration case is left to CI because this local worktree is kitless. ### Repository gates - `git diff --check upstream/release/3.0.0...HEAD` — passed. --------- Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Co-authored-by: Antoine RICHARD <antoiner@nvidia.com> Co-authored-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Co-authored-by: Mustafa H <34825877+StafaH@users.noreply.github.com>
Description
FactoryBase._get_backend()can be called before aSimulationContexthas been created, but it previously dereferencedSimulationContext.instance().physics_managerunconditionally.SimulationContext.instance()returnsNonebefore initialization, so backend resolution could fail before any fallback was applied.Following maintainer confirmation, the pre-context fallback is now
newton. Initialized backend resolution remains unchanged for Newton, PhysX, and OV PhysX contexts.A separate follow-up should update
SimulationCfg(physics=None)to default to Newton as well; that broader configuration-default change is intentionally outside this PR.Validation
Adds unit coverage for backend resolution with
SimulationContext._instanceunset and verifies thenewtonfallback.Type of change