Skip to content

[Proposal] MJWarp: opt-in raise on capacity overflow, and do not report iteration limits as overflow #9345

Backlog

Description

@tianyaohu

Proposal

Follow-up to #8801 / #9164. Add MJWarpSolverCfg.overflow_action ("debug" | "warn" | "raise", default "debug") so a run can report capacity overflows without debug mode, or stop at the first one; split MuJoCo Warp's ITERATIONS / LS_ITERATIONS bits out of the capacity report (they are non-convergence, not dropped contacts); add MJWarpSolver.peak_usage() for sizing njmax / nconmax.

Motivation

  • With debug_mode off, an overflow only prints a device line and training continues on worlds with dropped contacts or constraint rows.
  • Comparing nefc / nacon with the capacities after a step misses overflows inside substeps and in the broad phase; the overflow bits catch them. Measured on a 1,024-world humanoid + ball task with 33 contacts reserved per world: the BROADPHASE bit was set while contacts peaked at 24,535 of 33,792 and constraint rows at 161 of 200 (busiest world); the broad phase needed 34 per world.
  • mujoco-warp 3.17 / 4.0.1 set ITERATIONS / LS_ITERATIONS in the same mask; the current report names them as an exhausted capacity.

Minimal repro (no GPU)

Build an MJWarpSolver driver as the existing tests do (solver_driver(MJWarpSolver, MJWarpSolverCfg(), native)), give it an overflow observable [OverflowType.ITERATIONS, 0], and call check_step(False, True): it logs "MJWarp capacity overflow ... iterations. Increase the named capacity". With the bit OverflowBits.SOLVER_NCONMAX and check_step(False, False) nothing is reported and nothing can be made to raise.

Alternatives

Users request ObservableKind.OVERFLOW through NewtonManager.request_solver_observables and check it themselves (what we do now).

Checklist

Acceptance criteria

  • With overflow_action="raise", the first capacity overflow raises, naming the buffer, with debug mode off.
  • Iteration-limit bits never raise and are not called a capacity overflow.
  • Default behaviour and cost are unchanged.

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