Repository navigation
Conversation
04e9f7e to
ef1e5d7
Compare
5dc3745 to
1e1a329
Compare
1e1a329 to
19d22f7
Compare
19d22f7 to
47847fc
Compare
|
Current-head guideline review
Validation: source/diff, existing discussion and check-run metadata reviewed; no runtime tests run in this review. CI: Core (ubuntu-latest, py3.11, mjlab): success; docs: success; Core (ubuntu-latest, py3.11, cpu): success; pre-commit: success. Merge: not auto-approved. Apply the current human design/implementation-approval gate; agent review is not eligible human approval. |
|
Addressed #895 boundary review in b8569b9: moved pickle-free EMGTrial .npz persistence (EMG_TRIAL_META_KEY, save_emg_trial, load_emg_trial, NpzDirectoryEMGSource) into myosuite.integrations.emg.trial_io and mm-evalkit rollout/policies.yaml export (export_mm_evalkit_rollout, write_mm_evalkit_policy_config) into myosuite.integrations.mm_evalkit.rollout_export. Kept myosuite.biomechanics.emg_validation purely scientific (NumPy/SciPy/MuJoCo/OSQP only, zero integrations imports) with a PEP 562 compatibility facade, and tightened test_biomechanics_layout.py to enforce internal subpackage boundaries. |
|
Automated cross-repo audit (compatibility, composition, reuse) of
Nothing here blocks merging on its own; the items are for the next revision. Generated by Claude Code |
…-evalkit rollout export (#895)
The hash moves to myo_sim.fingerprint (MyoHub/myo_sim#210) with unchanged values. emg_validation imports it lazily and raises an actionable ImportError on myo-sim 0.2.5. The tests that reach the fingerprint skip when the API is absent.
15acc06 to
eff214e
Compare
Resolve the test_biomechanics_layout.py conflict by keeping dev's _MODULE_DEPENDENCIES entry for kinematic_metrics.py (tslearn) and this branch's _MODULE_IMPORTS entry for emg_validation.py (myo_sim.fingerprint) and its internal-subpackage tables.
Note
Draft (
Post-3.0): Deferred from Milestone3.2so the3.2review queue stays focused; requires maintainer scope/design agreement before entering review (AGENTS.md).Stack (2/4) — 3-Layer Musculoskeletal & EMG Validation Split
MyoHub/myo_sim): Add muscle operating-range and moment-arm CI tests myo_sim#197 — fast (<3 s), dataset-free structural muscle operating-range & moment-arm coupling CI gates.MyoHub/myosuitebiomechanics):feat/emg-signal, merged intodev)feat/emg-validation->dev) <- this PRMyoHub/myosuiteCLI +mm_evalkit.datasetsplugins):3. Add EMG validation A/B CLI, gait dataset adapters, and custom manifests #813 (
feat/emg-validation-cli->feat/emg-validation)4. Add upper-limb and hand EMG adapters for Quesada 2024, emg2pose, NinaPro DB5, and GRABMyo #814 (
feat/emg-upper-limb-sources->feat/emg-validation-cli)Summary
Adds the four-mode musculoskeletal model-data EMG validation engine, SHA-256 musculoskeletal fingerprinting, and lazy
amathislab/mm-evalkitstatistical & rollout-archive integration inmyosuite/biomechanics/emg_validation.py(PR 2 of 4, stacked onfeat/emg-signal):EMGTrial.npzschema & cross-versionEMGChannelMap: maps single-muscle or synergistic muscle-group sEMG channels to MuJoCo actuators with graceful partial resolution across model revisions (e.g.myo_simPRs that add, rename, or split muscle actuators).musculoskeletal_fingerprint): hashes actuator gain/bias/dyn/lengthrange parameters, tendon spring/stiffness/damping, joint ranges/stiffness, equality constraints, and wrap counts to detect model changes across worktrees.validate_trial):qpos+ external wrenches and scores per-channel zero-lagrsa_spearman,rsa_pearson).[max(0, e - s), min(1, g*e + s)]) and measures minimum reserve torque ratios needed to close joint dynamics (unconstrained_reserve_ratio_p95vsemg_bounded_reserve_ratio_p95).actuator_pose_sensitivity, flagging0.0 deg/ctrldead actuators and condition spread) and short-horizon open-loop forward simulation drift.temporal_subspace_similarity) and ridge-regressionamathislab/mm-evalkitintegration (lazy, zero core import overhead):compute_rsm,rsa) invalidate_inverse_emgand paired cohort Wilcoxon signed-rank + Holm step-down + rank-biserial effect sizes (MetricSamples,MetricFamily,wilcoxon_table) incompare_emg_validation_reportslazily tomm_evalkit.statswhen installed, with clean SciPy/NumPy fallbacks on Python 3.10.policies.yamlexport (export_mm_evalkit_rollout,write_mm_evalkit_policy_config): solves bare untrainedMjModels via eithersolver="static_optimization"orsolver="cmc"(myosuite.biomechanics.computed_muscle_control) atdt=0.01s (100 Hz,activation_sample_phase="pre_step") into.npzarchives passing bothmm_evalkit.workflows.bimanual.rollout.open_rolloutandmm_evalkit.workflows.gait.rollout_validation.validate_policy_rollouts.Verification
pytest myosuite/tests/test_emg.py myosuite/tests/test_emg_validation.py myosuite/tests/test_import_footprint.py -vruff check/ruff format --check/mypyOwnership & Reuse (
REVIEW.md)MyoHub/myo_sim#197; external evaluation orchestration lives inamathislab/mm-evalkit; pure NumPy/SciPy/OSQP trial validation (EMGValidationResult,validate_emg_trial,compute_model_fingerprint) lives inmyosuite.biomechanics.emg_validation, while.npztrial I/O (BaseEMGSource,resolve_stem_channel_map,NpzDirectoryEMGSource) andmm-evalkitrollout exporters live inmyosuite.integrations.emg/myosuite.integrations.mm_evalkit(zero external third-party runtime dependencies).myosuite.biomechanics.emg,myosuite.biomechanics.inverse_dynamics,myosuite.biomechanics.static_optimization.StaticOptimizer,myosuite.biomechanics.computed_muscle_control.myosuite.biomechanics.emgprocessed signals in isolation with no standardized multi-mode (static_opt/cmc/recorded) concordance evaluator, model SHA-256 provenance fingerprint, ormm-evalkitrollout export; nowvalidate_emg_trialevaluates phase-aligned EMG waveforms with explicit solver/channel diagnostics.Fingerprint moved to myo_sim (release gate)
Per maintainer review,
musculoskeletal_fingerprintis model-only, so it now lives in myo_sim (MyoHub/myo_sim#210, withproject_tendon_nodesinmyo_sim.physics.joint_coupling). The port yields identical hashes on six models (two test models,myoarm_r,myohand_r,myolegs,myofullbody).emg_validation.musculoskeletal_fingerprintis a thin lazy delegation with an actionableImportError; the EMG validation engine stays here, andtest_biomechanics_layout.pyallows exactlymyo_sim.fingerprint. Because everyvalidate_trialreport records the fingerprint, validation needs a myo-sim release containing MyoHub/myo_sim#210, so this PR is back to draft until then. The three tests that reach the fingerprint skip without it (needs_myo_sim_fingerprintintests/support/optional_deps.py). Follow-up after that release:myosuite.biomechanics.emg.project_tendon_nodescan delegate to myo_sim as well.Local checks (CI is out of credits; Windows, Python 3.11, MuJoCo 3.8.1):
test_emg_validation.py+test_biomechanics_layout.py7 passed with myo_sim#210 onPYTHONPATH, 4 passed and 3 skipped on myo-sim 0.2.5; the five verification modules 349 passed, 3 skipped on both. #813 and #814 are updated by merge.myosuite/biomechanics/emg_validation.pyanalysis workflow; model fingerprinting delegates toMyoHub/myo_sim#210).Compatibility & Checks
Post-3.0,stack:root): no registered env or checkpoint contract changes; gated onMyoHub/myo_sim#210release.