[Misc] Add public option for globally enabling info batching.

Author: stergiosbaCreated Jun 25, 2026Updated Sep 6, 2026
Labelsbugdocumentation

Bug Description

Hi team, this is not a bug but in my opinion some parameters/options need better documentation. Best example of this is the batch_dofs_info option. I had to look into the solver's code to see what this is doing and how its converting the shapes. The parameter is missing from RigidOptions docs in general.

For someone who is like me and doesn't "just get it", if you don't know about this parameter all the getter and setters for a RigidEntity will have wrong shape and from this someone can infer that the feature has not been implemented yet or get errors that scream about the shape (in setter functions).

Parameters of RigidEntity objects in the scene such as:

  • get_dofs_act_gain
  • get_dofs_bias
  • get_dofs_force_range .... All are affected and have shape (n_dofs) instead of the expected (n_envs, n_dofs).

Note: I understand why this parameter is set to false by default for performance reasons.

KinematicOptions on the other hand are defined as: https://github.com/Genesis-Embodied-AI/genesis-world/blob/4cfb9f04679ffd5d1007c695e72de15f86a929e6/genesis/options/solvers.py#L352-L373

Here we can immediately see what this is.

Steps to Reproduce

This is just the simple franka example demo +dofs getters and setters.

python
import torch

import genesis as gs

########################## init ##########################
gs.init(backend=gs.gpu)

########################## create a scene ##########################
scene = gs.Scene(
    show_viewer=False,
    viewer_options=gs.options.ViewerOptions(
        camera_pos=(3.5, -1.0, 2.5),
        camera_lookat=(0.0, 0.0, 0.5),
        camera_fov=40,
    ),
    rigid_options=gs.options.RigidOptions(
        dt=0.01,
    ),
)

########################## entities ##########################
plane = scene.add_entity(
    gs.morphs.Plane(),
)

franka = scene.add_entity(
    gs.morphs.MJCF(file="xml/franka_emika_panda/panda.xml"),
)

########################## build ##########################

# create 20 parallel environments
B = 20
scene.build(n_envs=B, env_spacing=(1.0, 1.0))

# control all the robots
franka.control_dofs_position(
    torch.tile(torch.tensor([0, 0, 0, -1.0, 0, 1.0, 0, 0.02, 0.02], device=gs.device), (B, 1)),
)

print(franka.get_dofs_act_gain().shape) # Prints Torch.size([9]) when it should be Torch.size([20, 9])
franka.set_dofs_stiffness(torch.ones([9]), envs_idx=(5,))
print(franka.get_dofs_stiffness()) # This prints tensor of 9 ones.
for i in range(1000):
    scene.step()

Expected Behavior

If we set:

scene = gs.Scene(
    show_viewer=False,
    viewer_options=gs.options.ViewerOptions(
        camera_pos=(3.5, -1.0, 2.5),
        camera_lookat=(0.0, 0.0, 0.5),
        camera_fov=40,
    ),
    rigid_options=gs.options.RigidOptions(
        dt=0.01,
        batch_dofs_info=True
    ),
)

This makes everything work as intended but it was not clear.

Source: Genesis-Embodied-AI/genesis-world