|
44 | 44 |
|
45 | 45 | _TASK_IDS = tuple(str(task["id"]) for task in MYOSUITE_TASKS) |
46 | 46 | _TASK_ID_SET = frozenset(_TASK_IDS) |
| 47 | +# Render traces are the expensive part of this suite. The full 398-ID surface is |
| 48 | +# covered by registry, space, reset/step, determinism, and generated docs. Keep |
| 49 | +# CI render checks to a diagonal set that catches wrong-camera/model/scene |
| 50 | +# regressions without retesting the full modifier cartesian product. |
| 51 | +_ORACLE_RENDER_REPRESENTATIVE_TASK_IDS = frozenset({ |
| 52 | + "MyoHandAirplaneFixed-v0", |
| 53 | + "MyoHandAirplaneFly-v0", |
| 54 | + "MyoHandCupPour-v0", |
| 55 | + "MyoHandHammerUse-v0", |
| 56 | + "MyoHandWatchRandom-v0", |
| 57 | + "motorFingerPoseFixed-v0", |
| 58 | + "myoArmReachFixed-v0", |
| 59 | + "myoElbowPose1D6MExoFixed-v0", |
| 60 | + "myoFingerReachFixed-v0", |
| 61 | + "myoFingerPoseFixed-v0", |
| 62 | + "myoHandReachFixed-v0", |
| 63 | + "myoHandPoseFixed-v0", |
| 64 | + "myoHandKeyTurnFixed-v0", |
| 65 | + "myoHandObjHoldFixed-v0", |
| 66 | + "myoHandPenTwirlFixed-v0", |
| 67 | + "myoHandReorient8-v0", |
| 68 | + "myoLegStandRandom-v0", |
| 69 | + "myoLegWalk-v0", |
| 70 | + "myoLegRoughTerrainWalk-v0", |
| 71 | + "myoFatiArmReachFixed-v0", |
| 72 | + "myoFatiHandReorient8-v0", |
| 73 | + "myoFatiLegWalk-v0", |
| 74 | + "myoSarcArmReachFixed-v0", |
| 75 | + "myoSarcHandReorient8-v0", |
| 76 | + "myoSarcLegWalk-v0", |
| 77 | + "myoChallengeBaodingP1-v1", |
| 78 | + "myoChallengeBimanual-v0", |
| 79 | + "myoChallengeChaseTagP1-v0", |
| 80 | + "myoChallengeDieReorientP1-v0", |
| 81 | + "myoChallengeOslRunFixed-v0", |
| 82 | + "myoChallengeRelocateP1-v0", |
| 83 | + "myoChallengeSoccerP1-v0", |
| 84 | + "myoChallengeTableTennisP0-v0", |
| 85 | + "myoFatiChallengeBimanual-v0", |
| 86 | + "myoSarcChallengeSoccerP2-v0", |
| 87 | +}) |
| 88 | +_UNKNOWN_ORACLE_RENDER_REPRESENTATIVE_TASK_IDS = ( |
| 89 | + _ORACLE_RENDER_REPRESENTATIVE_TASK_IDS - _TASK_ID_SET |
| 90 | +) |
| 91 | +if _UNKNOWN_ORACLE_RENDER_REPRESENTATIVE_TASK_IDS: |
| 92 | + raise ValueError( |
| 93 | + "unknown MyoSuite oracle render representatives: " |
| 94 | + f"{sorted(_UNKNOWN_ORACLE_RENDER_REPRESENTATIVE_TASK_IDS)}" |
| 95 | + ) |
47 | 96 |
|
48 | 97 |
|
49 | 98 | def _render_task_allowlist_from_env() -> tuple[str, ...] | None: |
@@ -74,16 +123,32 @@ def _filter_render_task_ids(task_ids: tuple[str, ...]) -> tuple[str, ...]: |
74 | 123 | ) |
75 | 124 |
|
76 | 125 |
|
77 | | -_ORACLE_TRACE_TASK_IDS = tuple( |
78 | | - task_id |
79 | | - for task_id in _TASK_IDS |
80 | | - if task_id not in MYOSUITE_ORACLE_NUMPY2_BROKEN_IDS |
81 | | -) |
82 | | -_NATIVE_ONLY_RENDER_TASK_IDS = tuple( |
83 | | - task_id |
84 | | - for task_id in _TASK_IDS |
85 | | - if task_id in MYOSUITE_ORACLE_NUMPY2_BROKEN_IDS |
86 | | -) |
| 126 | +def _native_render_task_ids() -> tuple[str, ...]: |
| 127 | + if _RENDER_TASK_ALLOWLIST is not None: |
| 128 | + return _filter_render_task_ids(_TASK_IDS) |
| 129 | + return tuple( |
| 130 | + task_id |
| 131 | + for task_id in _TASK_IDS |
| 132 | + if task_id in _ORACLE_RENDER_REPRESENTATIVE_TASK_IDS |
| 133 | + ) |
| 134 | + |
| 135 | + |
| 136 | +def _oracle_trace_task_ids() -> tuple[str, ...]: |
| 137 | + if _RENDER_TASK_ALLOWLIST is None: |
| 138 | + return tuple( |
| 139 | + task_id |
| 140 | + for task_id in _TASK_IDS |
| 141 | + if task_id in _ORACLE_RENDER_REPRESENTATIVE_TASK_IDS |
| 142 | + and task_id not in MYOSUITE_ORACLE_NUMPY2_BROKEN_IDS |
| 143 | + ) |
| 144 | + return tuple( |
| 145 | + task_id |
| 146 | + for task_id in _filter_render_task_ids(_TASK_IDS) |
| 147 | + if task_id not in MYOSUITE_ORACLE_NUMPY2_BROKEN_IDS |
| 148 | + ) |
| 149 | + |
| 150 | + |
| 151 | +_NATIVE_RENDER_TASK_IDS = _native_render_task_ids() |
87 | 152 | _WIDTH = 64 |
88 | 153 | _HEIGHT = 48 |
89 | 154 | _ORACLE_RENDER_BATCH_SIZE = 8 |
@@ -199,10 +264,10 @@ def _task_batches( |
199 | 264 |
|
200 | 265 |
|
201 | 266 | _SHARDED_ORACLE_TRACE_TASK_IDS = _render_shard_task_ids( |
202 | | - _filter_render_task_ids(_ORACLE_TRACE_TASK_IDS) |
| 267 | + _oracle_trace_task_ids() |
203 | 268 | ) |
204 | | -_SHARDED_NATIVE_ONLY_RENDER_TASK_IDS = _render_shard_task_ids( |
205 | | - _filter_render_task_ids(_NATIVE_ONLY_RENDER_TASK_IDS) |
| 269 | +_SHARDED_NATIVE_RENDER_TASK_IDS = _render_shard_task_ids( |
| 270 | + _NATIVE_RENDER_TASK_IDS |
206 | 271 | ) |
207 | 272 |
|
208 | 273 |
|
@@ -447,8 +512,8 @@ class MyoSuiteRenderTest(absltest.TestCase): |
447 | 512 | """Validate native MyoSuite RGB rendering after reset and steps.""" |
448 | 513 |
|
449 | 514 | def test_reset_and_first_three_step_render(self) -> None: |
450 | | - """Render oracle-skip tasks through reset and the first three steps.""" |
451 | | - for task_id in _SHARDED_NATIVE_ONLY_RENDER_TASK_IDS: |
| 515 | + """Representative tasks render through reset and first three steps.""" |
| 516 | + for task_id in _SHARDED_NATIVE_RENDER_TASK_IDS: |
452 | 517 | with self.subTest(task_id=task_id): |
453 | 518 | env = make_gymnasium( |
454 | 519 | task_id, |
|
0 commit comments