Skip to content

feat: add optional cricket batting and bowling PPO task configs - #1560

Closed
kishanpb wants to merge 1 commit into
Motphys:mainfrom
kishanpb:codex/cricket-unilab-submission
Closed

kishanpb wants to merge 1 commit into
Motphys:mainfrom
kishanpb:codex/cricket-unilab-submission

Conversation

@kishanpb

@kishanpb kishanpb commented Sep 12, 2026

Copy link
Copy Markdown

Summary

  • Add optional MuJoCo PPO owner configurations for cricket_motor (CricketMotorSwing) and cricket_bowling (CricketDeliveryStride), plus two regenerated support-matrix rows: 3 files, 52 insertions, no upstream Python changes.
  • The separately installed Gym-Cricket package supplies environments through UniLab's existing unilab.tasks entry point. No default dependency, registry lifecycle, RL implementation, backend capability, or CI workflow changes.
  • Both configs select CPU, two environments, existing policy observation groups, disabled playback, and the adapter's internal reward source. The backend NaN guard is disabled because simulator state belongs to the external Gymnasium adapter; task tests still check finite observations, rewards, and PPO weights.
Task Observation / action sizes Scope
CricketMotorSwing 123 / 7 Arm/wrist residuals around a scripted reference swing; native bat-ball contact
CricketDeliveryStride 2 / 3 Release parameters around a scripted run-up/delivery; native flight and stump contact

Both tasks support physical right/left variants via env.handedness. The generated matrix intentionally shows - without the optional package installed; this PR does not claim built-in backend support. External setup and reproduction are documented in the package; UniLab's existing CLI workflow is unchanged.

Linked Work

  • Closes Work: add optional cricket batting and bowling PPO task configs #1559.
  • Parent roadmap / declared roadmap base: not applicable; one implementation issue.
  • Milestone: unassigned, for maintainer triage.
  • Base branch: main, selected before implementation; tested base db1a6e5b3dbe4dd096b16a517837f2d46dba8164 (1.2.0).
  • Final local head: 4975ea852ffa20e691a97986bd43048c8fc5a02c.
  • Governing contracts: ADR-0003 and ADR-0004. No new structural decision or support commitment is proposed.

Validation

  • make test-all passed on the final local head before this PR was created.
  • Additional task-specific validation listed below.

On macOS CPU, make test-all passed lint/type checks, 1,589 tests (27 skipped, 1 expected failure; 848 slow tests deselected), and benchmark entrypoint smoke checks (34/35 module-mode, 35/36 script-mode; one optional MLX skip in each). Focused support-matrix tests passed 13/13 on the same tree. External adapter tests passed 8/8. The clean Python 3.11 package suite passed 75 tests, with two optional UniLab modules skipped; both retained-policy videos regenerated successfully in that environment.

Commands run during setup and validation from the UniLab checkout (the local public-package checkout is named gym_cricket_public):

uv sync --extra mujoco
uv pip install motrixsim-core==0.8.2
uv run --no-sync unilab-pull-assets --robot go2
uv run --no-sync unilab-pull-assets --robot allegro_hand
uv run --no-sync unilab-pull-assets --robot a2
# Upstream-only environment: no cricket plugin installed for this gate.
UV_NO_SYNC=1 OMP_NUM_THREADS=1 make test-all
uv run --no-sync pytest tests/scripts/test_support_matrix.py -m slow -q

uv pip install ../gym_cricket_public/dist/cricket_gym-0.1.0-py3-none-any.whl
OMP_NUM_THREADS=1 uv run --no-sync pytest ../gym_cricket_public/tests/test_motor_unilab.py ../gym_cricket_public/tests/test_bowling_unilab.py --junitxml=../unilab_submission_adapter_tests.xml -q

# Also verified installation directly from the now-public immutable source.
uv pip install 'cricket-gym @ git+https://github.com/kishanpb/gym-cricket@c6e932f306470bdab95b43b86e06d4686a9b384a'

After the public-source install, the following CLI invocation was run for each task (cricket_motor, cricket_bowling) and hand (right, left), with a separate temporary log directory per run:

uv run --no-sync train --algo ppo --task "$task" --sim mujoco \
  env.handedness="$hand" algo.max_iterations=1 algo.num_steps_per_env=8 \
  training.log_root="$temporary_log_directory"

All four actual CLI runs exited successfully. These are bounded runtime checks, not convergence or benchmark results. Temporary smoke checkpoints/logs were removed. The adapter tests additionally verify changed finite bowling PPO weights over two iterations per hand.

Installation states are intentionally separate: UniLab's built-in registry-closure tests expect only built-in tasks and fail if an external plugin auto-registers extra tasks. Initial missing-asset/optional-dependency failures were resolved with the official asset helper and Motrix package, without modifying upstream tests or source. Demo replay pins MuJoCo 3.8.0; the UniLab 1.2.0 adapter/CLI checks used its MuJoCo 3.11.0 environment. No cross-version identical-trajectory claim is made.

Remote CI route: base main; current-head CI and Docs workflows are awaiting maintainer approval (action_required) for head 4975ea852ffa20e691a97986bd43048c8fc5a02c, as checked on 2026-09-12. They have not passed or failed the code checks yet. Maintainer review and applicable current-head CI remain required before merge.

Impact

  • Backend impact: optional MuJoCo task configs only; no Motrix cricket support.
  • Platform impact: macOS CPU verified; Linux and GPU execution not verified.
  • Training effect expected: yes for the new opt-in tasks only; existing tasks, algorithms and defaults are unchanged.

Artifacts

The videos/results use SKRL JAX PPO/A2C, not UniLab-trained checkpoints. They include highlights, misses, and full-pool scorecards. Batting is reference-assisted; bowling is a target drill without a batter, and the left-arm evaluation reflects the same trained checkpoint rather than training independently. These are one-seed exploratory evaluations, not an algorithm ranking, learned whole-body locomotion, biomechanical certification, or full-match cricket. Delivery-foot checks do not cover every no-ball rule. No native UniLab A2C result is claimed.

Checklist

  • Task-specific tests included in the external package and run against this head.
  • Generated support matrix updated; external installation/reproduction documented.
  • Driving issue linked.
  • Follow-up scope explicit: maintainers decide whether to accept these optional examples; Linux/GPU validation, broader biomechanics, and full-match tasks remain outside this PR.

@kishanpb
kishanpb requested a review from TATP-233 as a code owner September 12, 2026 22:05
@kishanpb

Copy link
Copy Markdown
Author

Hi maintainers, could you please review this cricket task integration for acceptance and merge it if it meets the contribution requirements?

The public fork now includes the proposed task configs and README video highlights, linked from Gym-Cricket. Batting video | Bowling video.

The videos illustrate Gym-Cricket's SKRL PPO/A2C checkpoints; this PR adds the separate UniLab PPO task configs. Fork-only README highlights are not added to this PR's diff. CI and Docs still require maintainer action. Happy to address any remaining changes needed for acceptance. Thank you!

@TATP-233

TATP-233 commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Hi @kishanpb, thank you very much for the PR and for the excellent preparation around it—the external package, configs, tests, reproduction notes, and demo videos are all really appreciated.

After reviewing it against our current roadmap, we don’t plan to land additional task-specific configs in the core UniLab repository for now. We are moving toward keeping UniLab as the shared environment/training/backend surface, while concrete task families are owned in downstream task repositories. Recent examples include:

We are also planning a dedicated task-collection repository for new tasks; the name is not finalized yet, but the direction is something like unilab_zoo or unilab_galaxy. Since that destination and review process are still being defined, adding more task configs to core now would create churn we would need to migrate again.

Gym-Cricket already fits the external task-package model very well. Once the task-collection repository is ready, this
would be a good candidate to revisit there, and your existing configs/tests should provide a strong starting point.

Thanks again for the contribution and for following the UniLab extension contracts so carefully. Given the roadmap change,

@kishanpb

Copy link
Copy Markdown
Author

Thank you, @TATP-233, for the thoughtful review and for explaining the roadmap. Keeping concrete task families downstream makes sense.

I have renamed my public integration fork to Cricket-Gym-Unilab. It contains the cricket task configurations and README video highlights, with the environment package maintained in Gym-Cricket.

Would you consider adding Cricket-Gym-Unilab under the Ecosystem section of the UniLab README as a community-maintained cricket integration? That would help users discover it without adding task-specific configs to core or implying upstream endorsement.

I look forward to the future unilab_zoo or unilab_galaxy task collection and would be happy to revisit the contribution there once the destination and review process are ready. Thanks again!

@TATP-233

Copy link
Copy Markdown
Collaborator

Sure,thank you!
56932e4

@TATP-233 TATP-233 closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Work: add optional cricket batting and bowling PPO task configs

2 participants