Skip to content

refactor(fastsac): migrate SONIC to PolicyVariant API #66

Description

@Jiaxi-Huang

Summary

Migrate the SONIC-specific FastSAC integration to the neutral PolicyVariant contract, while preserving the generic FastSAC core.

Baseline:

Goals

  • Add the neutral PolicyVariant contract and registry in motrix_rl/fastsac/api.py.
  • Register default and sonic; SONIC registration happens only through the documented side-effect import in motrix_rl/fastsac/__init__.py.
  • Replace algo.sonic with algo.policy_variant plus the opaque algo.variant mapping.
  • Remove FastSAC-core sonic_cfg branches and SONIC imports.
  • Checkpoints save policy_variant and self-describing policy_variant_metadata; export rebuilds actors from that metadata.
  • Remove profile-specific SONIC environments and retain only g1-sonic, using one task recipe and one canonical PolicyVariant config with 10 future frames.
  • Keep compact observation reconstruction, GPU-env async D2H staging, deployment format changes, and external official SONIC release-loader behavior out of scope.

Compatibility

  • Existing default FastSAC checkpoints without variant metadata remain exportable.
  • Checkpoints from the pre-merge SONIC branch using "sonic": {"enabled": ...} are not supported and should fail with a clear message.
  • g1-sonic-lafan and g1-sonic-smoke registrations and task recipes are removed in favor of the single g1-sonic environment.

Acceptance

  • Targeted tests covering policy variants, SONIC actor/aux semantics, collector, learner, ONNX export, async workers, release loading, and SONIC environment/motion/manager contracts.
  • Full pytest suite, pre-commit hooks, and whitespace checks.
  • Documentation updated bilingually and generated environment overview checked.
  • Static scans confirm no SONIC imports or branches in generic FastSAC modules and no obsolete environment/profile config references.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions