Skip to content

[6Bii] Load G1 SDG configuration before runtime launch - #8475

Merged
ooctipus merged 2 commits into
isaac-sim:developfrom
ooctipus:refactor/pr6bii-sdg-config
Oct 13, 2026
Merged

ooctipus merged 2 commits into
isaac-sim:developfrom
ooctipus:refactor/pr6bii-sdg-config

Conversation

@ooctipus

@ooctipus ooctipus commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Merely loading the G1 synthetic-data-generation (SDG) configuration performed work that belongs to the running environment:

  • Premature runtime imports: the config classes shared a module with the environment implementation. Reading the config also imported USD and runtime utilities, including SciPy, before the launcher had selected and initialized the runtime.
  • Asset retrieval during configuration: the config's __post_init__ retrieved the IK URDF, potentially downloading it just to inspect or override settings. The Pink IK controller already supports retrieving that asset when it initializes.
  • Launch before configuration: the data-generation and GR00T rollout scripts worked around this ordering by launching Kit without the task config, parsing the config afterward, and calling scan again.

This PR moves the existing config classes into g1_locomanipulation_sdg_env_cfg.py and points the task registry there. Config loading now keeps the URDF URL without importing the environment or retrieving the asset. The existing IK controller owns retrieval; no extra retrieval step is added to the environment.

Both scripts now parse configuration first and pass it directly to launch_simulation, removing the post-launch scan. CLI arguments and environment settings are unchanged. Existing config imports from the runtime module and GR00T's remote-policy mode remain available.

7 files; +226 / −189 lines, mostly moving existing configuration.

Validation

  • 37 focused tests passed with the test, dev, and mimic extras:
    • uv run python -m pytest source/isaaclab_mimic/test/test_locomanipulation_sdg_cfg.py source/isaaclab/test/app/test_launch_simulation_require_kit.py -q — 16 passed.
    • uv run python -m pytest source/isaaclab/test/controllers/test_pink_ik_components.py -q — 21 passed.
  • Verified that the config-loading regression rejects both restoring the runtime-module entry point and replacing the URDF URL with a downloaded local path.
  • uv run isaaclab -f and changelog validation passed.
  • Full SDG generation and a GR00T model rollout were not run locally; CI is pending.

Type of change

  • Bug fix and configuration/runtime separation

Release backport

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

Checklist

  • Read the contribution guidelines
  • Ran formatting/lint and changelog checks
  • Updated configuration documentation through the package changelog
  • Validated focused coverage and reviewed the regression test
  • Added the package changelog fragment
  • Contributor already listed
  • Full CI

@ooctipus
ooctipus requested a review from a team October 12, 2026 06:46
@github-actions github-actions Bot added the isaac-mimic Related to Isaac Mimic team label Oct 12, 2026
@ooctipus

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 Oct 12, 2026
@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Refactors environment configuration loading to defer runtime imports.

The PR appears safe to merge, with a non-blocking improvement to the URDF regression test.

Findings

  1. P2 Early downloads can pass ▶

Summary

The PR separates G1 SDG configuration from its runtime environment.

  • G1 SDG settings load before the simulation starts.
  • SDG scripts pass task settings into the simulation launcher.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Load task configuration] --> B[Keep remote URDF URL]
    B --> C[Launch simulation with configuration]
    C --> D[Create G1 environment]
    D --> E[Retrieve local URDF]
    E --> F[Construct environment and controller]
Loading

Reviews (1) · Last reviewed commit: "Load G1 synthetic data configs before ru..." · Reviewed by Greptile

cfg = parse_env_cfg("Isaac-G1-SteeringWheel-Locomanipulation", device="cpu", num_envs=1)
assert cfg.scene.num_envs == 1
assert cfg.sim.device == "cpu"
assert cfg.actions.upper_body_ik.controller.urdf_path.endswith(".urdf")

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 Early downloads can pass

The new test checks only that urdf_path ends in .urdf. A downloaded local path can pass too, so this assertion does not protect the change that keeps URDF retrieval out of configuration loading. Assert that the path still equals the remote asset URL, or make retrieve_file_path raise if called while loading the configuration.

@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 (2), Test quality (1). Other reviewed categories look good.

  • PR description: The body matches the diff; replace volatile line counts and identify the command used for the 15 launcher tests to keep validation reproducible.
  • 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 rollout script retains the obsolete launch-order explanation, and the moved configuration comment inaccurately describes the deferred URDF assignment; update both comments.
  • Test quality: The added subprocess test covers pre-launch configuration loading, but its .urdf suffix assertion passes before the retrieval change; assert the unresolved nucleus URL.

Minor fixes needed. Posted 3 inline findings.

Automated review; human maintainers own approval decisions.

if env_name is None:
raise ValueError("Task/env name was not specified nor found in the dataset.")
env_cfg = parse_env_cfg(env_name, device=args_cli.device, num_envs=1, overrides=hydra_overrides)
with torch.no_grad(), launch_simulation(env_cfg, args_cli):

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 — Stale launch-order comment not updated

Configuration now parses before launch_simulation, but line 38's comment still states the Kit runtime launches first because the task config imports USD. Update it as generate_data.py line 132 was.

self.sim.render_interval = 6
self.sim.default_visualizer_cfg = VisualizerCfg(eye=(0.0, 3.0, 1.25), lookat=(0.0, 0.0, 0.5))

# Set the URDF and mesh paths for the IK controller

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 — URDF resolution split left undocumented

The comment still says "URDF and mesh paths" while the field now holds an unresolved nucleus URL that G1LocomanipulationSDGEnv.__init__ retrieves. State the deferred resolution here or at the constructor.

cfg = parse_env_cfg("Isaac-G1-SteeringWheel-Locomanipulation", device="cpu", num_envs=1)
assert cfg.scene.num_envs == 1
assert cfg.sim.device == "cpu"
assert cfg.actions.upper_body_ik.controller.urdf_path.endswith(".urdf")

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 · Test Quality — Assertion passes without the fix

Both the previously retrieved local path and the new nucleus URL end in ".urdf", so this cannot detect retrieval at config time. Assert the unresolved nucleus URL instead.

ooctipus added a commit that referenced this pull request Oct 13, 2026
## Description

Simplify task preset traversal and replace the custom CLI argument
scanner, help builder, and formatter with argparse. This includes
observable changes to help, error output, and configuration traversal;
the examples below show those changes.

Preset parsing, categories, and traversal now live together in
`isaaclab_tasks.utils.hydra`; `preset_cli.py` and `preset_target.py` are
removed. Preset handling stays in `isaaclab_tasks`. Runtime launch and
visualizer selection changes are in #8126; the independent SDG fix is
#8475. **22 files; +354 / −894 lines (540 fewer overall).**

## Before and after

### Unknown preset: same rejection, different error output

```bash
uv run isaaclab train --task Isaac-Cartpole-Direct --rl_library rsl_rl presets=typo
```

Before, the error grouped names by their affected paths:

```text
ValueError: Unknown preset(s): typo

Available presets (grouped by affected paths):

  isaacsim_physx, newton_kamino, newton_mjwarp, ovphysx, physx
    -> env.sim.physics
```

After, it lists each configuration path and its choices directly, in
declaration order:

```text
ValueError: Unknown preset(s): typo
Available presets by config path:
  env.sim.physics: isaacsim_physx, ovphysx, physx, newton_mjwarp, newton_kamino
```

The command still fails before simulation launch. Typed-selector errors
are also shorter. For example:

```bash
uv run isaaclab train --task Isaac-Cartpole-Camera-Direct --rl_library rsl_rl physics=rgb
```

Both revisions reject `physics=rgb` because RGB is not a physics preset.
After this change, the error retains `Typed preset selector(s)
physics=rgb did not match any preset of that type for this task.` and
removes the following explanation/suggested fixes.

### Help invoked with an explicit argument list now uses that list

```bash
uv run python -c 'from isaaclab.cli import train; train(["--task", "Isaac-Cartpole-Direct", "--rl_library", "rsl_rl", "--help"])'
```

- **Before:** help looked at process-wide `sys.argv` for the task, so it
printed `Pass --task=X along with --help to see preset variants
available for that task`, despite the task being supplied to `train()`.
- **After:** help reads the supplied arguments and lists
`isaacsim_physx`, `newton_kamino`, `newton_mjwarp`, `ovphysx`, and
`physx` under `physics=NAME`.

The ordinary `uv run isaaclab train --task Isaac-Cartpole-Direct
--rl_library rsl_rl --help` command lists those choices in both
revisions. Help formatting now uses argparse's
`RawDescriptionHelpFormatter`.

### Python configuration traversal changes

These affect callers constructing configurations in Python:

```python
from types import SimpleNamespace
from isaaclab_tasks.utils.hydra import collect_presets, preset, resolve_presets

choice = preset(default=1, fast=2)

a = resolve_presets({"items": (choice,)}, ["fast"])["items"][0]
b = resolve_presets(SimpleNamespace(mode=choice), ["fast"]).mode

class Custom:
    mode = choice

c = list(collect_presets(Custom()))
d = list(collect_presets(preset(default={"nested": choice})))
```

| Result | Before | After |
|---|---|---|
| `a`: preset inside a tuple | Unresolved `PresetCfg` | `2` |
| `b`: preset inside a namespace | Unresolved `PresetCfg` | `2` |
| `c`: discovery on an arbitrary custom object | `["mode"]` | `[]` |
| `d`: paths inside a dictionary-valued alternative | `[""]` — the
nested key was lost | `["", "nested"]` |

**Custom-configuration compatibility:** traversal now uses
config/dataclass instance fields, namespaces, mappings, lists, and
tuples. It no longer inspects arbitrary object properties or class
attributes with `dir()`/`getattr()`. Callers relying on that discovery
must use `@configclass` fields or one of the supported containers.

### Direct imports

Replace `isaaclab_tasks.utils.preset_cli` and
`isaaclab_tasks.utils.preset_target` imports with
`isaaclab_tasks.utils.hydra`. The package-level `from
isaaclab_tasks.utils import setup_preset_cli` remains unchanged. This
consolidation preserves selection and help behavior and fixes the
environment documentation tool's stale alias lookup.

## Validation

- Verified the CLI/error and Python examples above against the previous
implementation (`e21e2515`) and the pre-rebase implementation
(`d00bbe09d`).
- After rebasing onto develop `3c02cf760`, 159 focused tests passed
across preset composition/help, Franka presets, checkpoint tooling, task
discovery, and environment documentation. The existing help test also
guards against reintroducing the two removed modules.
- Formatting/lint and changelog checks passed; the Sphinx build passed
with warnings treated as errors.
- The CI case that previously exited with code 139,
`test_visualizer_golden[newton-cartpole-kit-tiled]`, passed locally on
GPU0 in 28 seconds. The complete Newton golden-image file finished with
9 passes and 3 image mismatches; all 3 mismatches also reproduced on
unmodified develop with effectively identical image scores. No skips,
thresholds, or retries were changed.
- [Fresh
CI](https://github.com/isaac-sim/IsaacLab/actions/runs/38312378346) is
running for `80aa4326b`; the earlier native CI crash has not been
reproduced locally or established as fixed.

## Type of change

- Refactoring with CLI help/error and configuration traversal changes
- Compatibility change for custom objects relying on implicit attribute
discovery

## Release backport

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

## Checklist

- [x] Read the contribution guidelines
- [x] Ran formatting/lint and changelog checks
- [x] Updated and built documentation
- [x] Validated focused coverage and reviewed consolidated tests
- [x] Added package changelog fragments
- [x] Contributor already listed
- [ ] Full CI
@ooctipus
ooctipus force-pushed the refactor/pr6bii-sdg-config branch from e77b901 to cc8e9a9 Compare October 13, 2026 05:46
@ooctipus

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 Oct 13, 2026
@ooctipus

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 Oct 13, 2026
@ooctipus
ooctipus merged commit 33078a1 into isaac-sim:develop Oct 13, 2026
95 of 125 checks passed
@ooctipus
ooctipus deleted the refactor/pr6bii-sdg-config branch October 14, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-mimic Related to Isaac Mimic team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants