Files
SkillFactory/tests/test_contact_cycle_sim_residual_physics.py
chenlin 9fe9d27865 feat: checkpoint contact-cycle evaluation and RootXY PPO progress
Consolidate next-stage docs, archive superseded narratives, and preserve frozen document inputs. Retain invalid P2 pairs, partial RootXY training, failed attempts and nonselectable checkpoints as explicit limitations.

Include supervised evaluation/training, desktop GPU admission, bounded evidence and atomic-publication monitor repairs with CPU regressions. Ignore local dotenv configuration.

Validation: 1403 passed, 6 skipped for contact-cycle and related contracts/CLI tests. Full-suite legacy ABI and registration tests require Python 3.12/Torch 2.10/pxr; no runtime checks relaxed. No new physical run or accepted skill.
2026-10-15 14:18:17 +08:00

33 lines
1.5 KiB
Python

"""Explicit non-learning PhysX gate; a skip is not physical evidence."""
import json
import os
import subprocess
import sys
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[1]
@pytest.mark.skipif(os.environ.get('SIM_RESIDUAL_RUNTIME_TESTS') != '1', reason='requires supervised Isaac PhysX')
def test_real_nominal_reference_residual(tmp_path):
env = os.environ.copy()
env.pop('CONDA_PREFIX', None)
env.pop('VIRTUAL_ENV', None)
env['PYTHONPATH'] = str(ROOT / 'source/SkillFactory')
lab = env.get('ISAACLAB_LAUNCHER', '/home/cen/IsaacLab/isaaclab.sh')
process = subprocess.run([
sys.executable, str(ROOT / 'scripts/supervise_sim.py'), '--timeout', '240',
'--log', str(tmp_path / 'kit.log'), '--report', str(tmp_path / 'process.json'), '--',
lab, '-p', str(ROOT / 'scripts/verify_cycle_sim_residual.py'),
'--output', str(tmp_path / 'trial'), '--headless',
], cwd=ROOT, env=env, capture_output=True, text=True, timeout=270)
assert process.returncode == 0, process.stdout[-3000:] + process.stderr[-3000:]
result = json.loads((tmp_path / 'trial/result.json').read_text())
supervisor = json.loads((tmp_path / 'process.json').read_text())
assert result['passed'] and result['sim_functional_passed'] and not result['accepted_skill']
assert result['optimizer_steps'] == 0 and not result['trained_residual_policy']
assert result['max_actual_residual_rad'] <= .050001
assert supervisor['passed'] and supervisor['cleanup']['clean'] and not supervisor['critical_log_lines']