Improvements to testspeed

Support named CLI flags, physics overrides, and refactor global state.

  - **Named CLI Flags**: Replaced standard positional arguments with named flags (`--nstep`, `--nthread`, `--noisestd`, `--noiserate`, `--npoolthread`) and preserved Google-wide flags compatibility (via custom argv compacting and InitGoogle).
  - **Physics Option Overrides**: Added support for configuring loaded model settings directly from the command line (`--solver`, `--cone`, `--jacobian`, `--integrator`, `--iterations`, `--tolerance`, `--sleep_tolerance`, `--noslip_iterations`).
  - **Encapsulated Thread State**: Consolidated loose global variables and per-thread rollout statistics arrays into a single data structure, `RolloutRunner runner`, simplifying mutli-threaded data boundaries.
  - **Readable Physics Options Printing**: Logged configured non-default options dynamically prior to rollout. Enums and active bitmask flags (e.g. disableflags/enableflags) are decoded into friendly strings (e.g., `Sleep : Enabled`).
  - **Tests & Docs**: Added testspeed_test.sh running testspeed over dominos.xml to check all overrides, registered shell test target in BUILD and CMakeLists.txt, and updated samples.rst documentation.

PiperOrigin-RevId: 942285912
Change-Id: Idb966fadfa0ccba0f1862f9d62bf83458b61939a
This commit is contained in:
Yuval Tassa
2026-07-03 16:52:02 -07:00
committed by Copybara-Service
parent 7c0d527005
commit 38f0ff3caa
4 changed files with 513 additions and 146 deletions
+1
View File
@@ -16,4 +16,5 @@ if(MUJOCO_BUILD_EXAMPLES)
include(ShellTests)
add_mujoco_shell_test(compile_test compile)
add_mujoco_shell_test(testspeed_test testspeed)
endif()