Skip to content

Commit 4c74226

Browse files
Validate the config when resolving a combination
The env constructor calls cfg.validate() before it builds anything, and tasks put their cross-axis rules there: Reach rejects the newton_ik action preset unless physics is Newton, and Lift rejects camera data types the Warp renderer cannot produce. Resolution stopped short of that call, so discovery reported those pairings as runnable and they failed on the first reset instead -- six OSMO jobs for Reach alone. Registry-wide this drops 1180 resolved combinations to 1027. Spot-checked: the Warp renderer keeps rgb and depth and loses albedo and simple_shading, which is exactly what lift_env_cfg allows, and albedo still resolves on isaacsim_rtx. No task loses every mode.
1 parent a458368 commit 4c74226

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

tools/task_discovery.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ def _mode_resolves(
172172
args, remaining = setup_preset_cli(parser, argv)
173173
sys.argv = [sys.argv[0]] + remaining
174174
env_cfg, _ = resolve_task_config(args.task, args.agent)
175+
# The env constructor validates before it builds anything, and tasks put their
176+
# cross-axis rules there -- Reach rejects ``newton_ik`` without Newton physics.
177+
# Skipping it reports those combinations legal and fails them at launch instead.
178+
env_cfg.validate()
175179
config_scan = scan(env_cfg, args)
176180
_validate_runtime(config_scan, _get_kit_runtime_sources(config_scan, args))
177181
fingerprint = hashlib.sha256(repr(env_cfg.to_dict()).encode()).hexdigest()

tools/test/test_task_discovery_resolve.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ def test_a_kit_backed_physics_and_a_kitless_renderer_are_rejected() -> None:
5959
assert _mode_resolves("Isaac-Cartpole-Camera", "ovphysx", "ovrtx", None) is not None
6060

6161

62+
def test_a_cross_axis_rule_the_task_declares_is_enforced() -> None:
63+
"""Tasks put cross-axis rules in ``validate_config``, which the env constructor runs.
64+
65+
Reach rejects ``newton_ik`` without Newton physics. Resolving without validating
66+
reported those pairings legal, and they died on the first reset instead.
67+
"""
68+
assert _mode_resolves("Isaac-Reach-Franka", "isaacsim_physx", None, "newton_ik") is None
69+
assert _mode_resolves("Isaac-Reach-Franka", "ovphysx", None, "newton_ik") is None
70+
assert _mode_resolves("Isaac-Reach-Franka", "newton_mjwarp", None, "newton_ik") is not None
71+
72+
6273
def test_the_fingerprint_identifies_a_run() -> None:
6374
"""The collapse is only as good as this: stable per run, distinct across runs.
6475

0 commit comments

Comments
 (0)