Skip to content

fix(wbc): drop wrong-family default checkpoint; actionable error + SONIC-stack detection#847

Merged
cagataycali merged 1 commit into
strands-labs:mainfrom
cagataycali:fix/wbc-default-checkpoint
Jun 29, 2026
Merged

fix(wbc): drop wrong-family default checkpoint; actionable error + SONIC-stack detection#847
cagataycali merged 1 commit into
strands-labs:mainfrom
cagataycali:fix/wbc-default-checkpoint

Conversation

@cagataycali

Copy link
Copy Markdown
Member

Problem

create_policy("wbc") with no checkpoint defaulted to the HuggingFace repo nvidia/GEAR-SONIC. That repo ships the SONIC VLA inference stack (model_encoder.onnx, model_decoder.onnx, planner_sonic.onnx, low_latency/*) — not the decoupled-WBC Balance/Walk ONNX policies WBCPolicy actually loads (policy.onnx / walk_policy.onnx).

The decoupled-WBC G1 weights live only in the NVlabs/GR00T-WholeBodyControl git-LFS tree at decoupled_wbc/sim2mujoco/resources/robots/g1/policy/ (GR00T-WholeBodyControl-Balance.onnx + GR00T-WholeBodyControl-Walk.onnx), not as a standalone HF repo.

So a bare create_policy("wbc") silently downloaded ~MB of the wrong model family, then failed with a confusing WBCPolicy main ONNX checkpoint not found — whose own hint pointed back at nvidia/GEAR-SONIC, sending the user in a circle.

Change

  • Remove the _DEFAULT_HF_REPO = "nvidia/GEAR-SONIC" default. No weights are bundled and there is no working default repo to guess, so a missing checkpoint now raises an actionable error before any network call, pointing at the correct NVlabs git-LFS source.
  • Add _reject_sonic_inference_stack(): if a checkpoint directory holds the SONIC encoder/decoder/planner ONNX but no policy.onnx, raise a clear error up front explaining it is the wrong family and where to obtain the Balance/Walk weights (covers the case where a user explicitly passes the SONIC checkpoint). A dir that colocates both a SONIC marker and policy.onnx is left alone.
  • Centralize the not-found message in _checkpoint_not_found_message() with distinct text for the no-checkpoint vs. resolved-but-missing cases.
  • Docs: docs/policies/wbc.md now explains there is no default download and gives the exact git clone + copy steps from the NVlabs LFS tree; clarifies that nvidia/GEAR-SONIC is the SONIC inference stack, not this family. Updated docs/training/vla_workflow.md + example placeholder paths to a neutral grootwbc-g1 dir name.

Behavior after fix

>>> create_policy("wbc")
RuntimeError: WBCPolicy requires a checkpoint but none was provided. No weights are
bundled. Obtain GR00T-WholeBodyControl-Balance.onnx and GR00T-WholeBodyControl-Walk.onnx
from the NVlabs/GR00T-WholeBodyControl git-LFS tree
(decoupled_wbc/sim2mujoco/resources/robots/g1/policy/), place them in a directory as
policy.onnx + walk_policy.onnx, and pass checkpoint='/path/to/that/dir'. Note: the
HuggingFace repo nvidia/GEAR-SONIC is the SONIC VLA inference stack
(encoder/decoder/planner), not this decoupled-WBC Balance/Walk family.

No network call is made for the no-checkpoint path (verified by the regression test, which wires snapshot_download to assert-raise if reached).

Tests

New TestDefaultCheckpoint class in tests/policies/wbc/test_policy.py:

  • test_no_default_hf_repo_constant — the wrong-family default constant is gone.
  • test_create_policy_wbc_without_checkpoint_raises_actionable_error — bare create_policy("wbc") raises the actionable error and attempts no download.
  • test_no_checkpoint_message_points_at_nvlabs_lfs — message names the LFS path + warns GEAR-SONIC is the wrong family.
  • test_sonic_inference_stack_dir_rejected / test_sonic_marker_with_policy_onnx_is_allowed / test_reject_sonic_noops_on_none_and_files — SONIC-stack detection.
  • test_explicit_checkpoint_dir_still_works — explicit local checkpoint dir happy path unchanged.

These fail on pre-fix code (reproducing the nvidia/GEAR-SONIC download) and pass after.

Gate

  • ruff check strands_robots tests tests_integ: clean
  • ruff format --check: clean
  • mypy strands_robots tests tests_integ: Success, no issues in 564 source files
  • MUJOCO_GL=egl pytest tests/policies/wbc/: 109 passed (7 new)

No behavior change to a loaded gait — this is a loading-path correctness + UX fix, so a rollout video is not applicable; the before/after error reproduction above is the relevant proof.

…NIC-stack detection

create_policy("wbc") with no checkpoint defaulted to the HuggingFace repo
nvidia/GEAR-SONIC, which ships the SONIC VLA inference stack
(model_encoder.onnx / model_decoder.onnx / planner_sonic.onnx) - not the
decoupled-WBC Balance/Walk ONNX policies WBCPolicy actually loads. The result
was a silent download of the wrong model family followed by a confusing
'main ONNX checkpoint not found' error (which even suggested GEAR-SONIC).

Changes:
- Remove the _DEFAULT_HF_REPO = 'nvidia/GEAR-SONIC' default. A missing
  checkpoint now raises an actionable error before any network call, pointing
  at the NVlabs/GR00T-WholeBodyControl git-LFS tree where the Balance/Walk
  ONNX live.
- Add _reject_sonic_inference_stack(): when a checkpoint dir holds the SONIC
  encoder/decoder/planner ONNX but no policy.onnx, raise a clear error
  explaining it is the wrong family and where to get the right weights.
- Centralize the not-found message in _checkpoint_not_found_message().
- Update docs (policies/wbc.md, training/vla_workflow.md) + example
  placeholder paths to point at the correct LFS source.

Regression tests fail on pre-fix code (reproduce the GEAR-SONIC download) and
pass after: TestDefaultCheckpoint covers the no-checkpoint actionable error
(no download attempted), SONIC-stack rejection, and the explicit-dir happy
path.

@yinsong1986 yinsong1986 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR removes the wrong-family default checkpoint (_DEFAULT_HF_REPO = "nvidia/GEAR-SONIC") from WBCPolicy. Previously a bare create_policy("wbc") silently downloaded the SONIC VLA inference stack (encoder/decoder/planner ONNX) instead of the decoupled-WBC Balance/Walk policies the provider actually loads, then failed with a confusing policy.onnx not found whose hint pointed back at the same wrong repo. Now a missing checkpoint raises an actionable RuntimeError before any network call, naming the correct NVlabs/GR00T-WholeBodyControl git-LFS source. A new _reject_sonic_inference_stack() guard rejects an explicitly-passed SONIC-stack directory up front (while leaving a dir that colocates a SONIC marker with policy.onnx alone), and the not-found message is centralized in _checkpoint_not_found_message(). Docs and example placeholder paths are updated to a neutral grootwbc-g1 dir name.

Traced the no-checkpoint path: checkpoint=None -> _maybe_download_checkpoint(None) returns None (no network), _reject_sonic_inference_stack(None) short-circuits, and the resolver raises the centralized no-checkpoint message. The default-behavior change is loud (explicit RuntimeError, not a silent coercion), the removed constant is private (_-prefixed, not in __all__), and the SONIC-detection helper handles the None/file/dir cases without a crash. No security surface, no wire-format/schema/public-signature changes, no host paths or emojis in the new strings. Verdict: no blocking concerns.

What's good

  • Fails fast with an actionable error before the network call, matching AGENTS.md #5/#6 (raise on fatal, no silent wrong-family fetch) and the loud-default-change pattern (AGENTS.md PR #86 > Safety Defaults).
  • Regression tests pin the behavior: snapshot_download is wired to assert-raise if reached, and the SONIC-detection edge cases (None, a file, marker-with-policy.onnx) each have a dedicated test.
  • Scope-disciplined: a loading-path correctness + UX fix with matching doc/example updates, no incidental behavior change to a loaded gait.

@cagataycali
cagataycali merged commit 2c3f592 into strands-labs:main Jun 29, 2026
8 checks passed
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.

2 participants