Conversation
|
Request changes: please add regression coverage for the complete supported workflow path before this is merged. The underlying Please complete the following:
Please run these tests after rebasing onto current |
d06e964 to
3e0c024
Compare
|
Thank you for the update. The core fix now covers both
Once these items are addressed and both CPU and Isaac runtime checks pass, this should be ready for merge. |
action can legitimately be None for a step whose StateMachine action list has no agent_assets at all (e.g. a pure SemanticActionCfg step like TurnOnHeaterCfg). matterix_sm's "hold current pose" fallback in StateMachine.step() only initializes for agents referenced in that action sequence, not the scene's full action space, so it stays None when a sequence is composed entirely of semantic-only actions - crashing on action.to(self.device). Mirror how semantic_actions=None already means "apply nothing" for the sibling parameter: skip processing rather than crash. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Addresses reviewer request for complete regression coverage of the action=None guard added in the previous commit. - Fix the same unconditional action.to(device) crash the reviewer flagged in the standard runner (scripts/run_workflow.py) and in test_video_recording.py, which both crashed before ever reaching MatterixBaseEnv.step()'s guard for a semantic-only workflow. - Add StateMachine unit tests (source/matterix_sm/test/) covering: a pure-semantic sequence returning action=None with exactly one semantic action emitted and the sequence marked successful; and a mixed sequence where a later robot action still yields a valid hold tensor during the initial semantic-only step. matterix_sm has no isaacsim/omni imports, so these run as plain pytest with no Isaac Sim launch required. - Add an Isaac runtime test (source/matterix/test/test_env_step_none_action.py) verifying against a live env that action_manager.process_action() is not called when action=None, the semantic action is applied exactly once, and action_manager.action stays byte-for-byte unchanged across the None step - covering both the reset-then-semantic and robot-action-then-semantic (hold-previous-target) transitions. - Add an end-to-end runner regression test (source/matterix/test/test_run_workflow_semantic_only.py) plus a new "heater_only" pure-semantic workflow on the heat-transfer test task, driving scripts/run_workflow.py as a real subprocess through multiple full episodes. - Document the None contract on both step() signatures: MatterixBaseEnv.step() and StateMachine.step() now type-annotate action as optional and explain what None means for physical control. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Review feedback: the mixed-workflow test's "later robot action" was WaitCfg(agent_assets="robot") with no action_space_info, which produces a (num_envs, 1) hold tensor and never exercised a real action space, while the Franka environment actually expects 8 dimensions. The test passed without proving anything representative. Replace it with MoveRelativeCfg(action_space_info=FRANKA_IK_ACTION_SPACE), a genuine motion action, and give the stub SceneData a real (if arbitrary) robot EE pose so it can compute its target. Strengthen the final assertion to check the full action shape against FRANKA_IK_ACTION_SPACE.total_dim (2, 8) instead of only checking the batch dimension. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Review feedback: - action_manager.action only reflects the raw input buffer before per-term processing, so it never proved anything about the actual controller/ actuator target applied to the robot. Added checks against env.scene["robot"].data.joint_pos_target - the real PD-controller target PhysX applies every decimation substep - for both scenarios. - "Heater turned on" in obs only proved the semantic was applied at least once, not exactly once. Spy on IsHeaterOn.set_value() (the actual application point) directly and assert a call count of 1. The joint_pos_target checks are not byte-for-byte equality: measured empirically that this Franka arm's IK controller re-solves against the robot's live, still-converging joint state every step, so the target naturally drifts by a similar amount (~0.24-0.27 rad max-abs-diff) whether or not a new action was given. A strict-equality check would fail on correct behavior. Instead assert what actually indicates a real problem: the target is not dropped to zero and contains no NaN/Inf. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Review feedback: proc.stdout.readline() blocks indefinitely if the subprocess goes quiet without producing another line, so the test's stated 90s timeout wasn't actually structurally enforced. Separately, declaring success on seeing "EPISODE 2" and then force-terminating the process only proved the first episode completed - not that the run would finish successfully on its own. Add --max_episodes to scripts/run_workflow.py so its main loop (which runs forever by default) can be told to stop and exit normally after N episodes - a generally useful automation/CI option for the runner, not just test scaffolding. The test now passes --max_episodes 2 (the minimum needed to prove the reset-and-repeat cycle works, not just a single run), uses subprocess.communicate(timeout=90) instead of a manual readline() loop so the timeout is enforced regardless of output flow, and asserts the process exited normally with returncode 0 - proving the run actually completed, rather than "we saw promising output before we killed it." Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Review feedback: when combined with AccelerationConsortium#13 (CPU validation on hosted runners), the CPU job's `pytest source/matterix_sm/test source/matterix/test` fails during collection, because test_env_step_none_action.py imports isaaclab at module level and isaaclab isn't installed in that job. Add source/matterix/test/conftest.py with collect_ignore for test_env_step_none_action.py and test_run_workflow_semantic_only.py - neither is a real pytest test module (no def test_* functions; they're standalone scripts meant to be run directly via AppLauncher, or to spawn one in a subprocess), so excluding them from collection changes nothing about how they're actually run, just stops pytest from trying to import them somewhere that can't support that. Verified: reproduced the exact CPU-job failure in a from-scratch venv matching AccelerationConsortium#13's install recipe (numpy, pytest, torch cpu, matterix_sm editable only, no isaaclab) - collection errors without this conftest.py, 11 tests pass cleanly with it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Review feedback: Black and isort reported changes on this branch's files. Ran the full pre-commit hook suite (black, flake8, isort, pyupgrade, codespell, and the misc pre-commit-hooks checks) scoped to every file this branch touches - all pass clean now. Purely cosmetic: line-wrapping and import ordering, no behavior changes. Re-verified all three live Isaac Sim tests and the pure-Python StateMachine tests still pass after reformatting. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3e0c024 to
b83659b
Compare
Description
self.action_manager.process_action(action.to(self.device))was crashing whenactionisNone, which happens for any step whose StateMachine action sequence has noagent_assets(ie a pureSemanticActionCfgstep likeTurnOnHeaterCfg). I fixed this by adding a check to only runself.action_manager.process_action(action.to(self.device))ifaction is not None.Type of change
Checklist
pre-commitchecks with<FULL_PATH_TO_ISAACLAB>/isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there