Skip to content

"Increase Windows stack" Patch in 3.4.0 breaks the mujoco python binding in Windows #3011

@Chuanfang-Neptune

Description

@Chuanfang-Neptune

Intro

Hi!

I am a phd student using MuJoCo for my research on soft animals/robots with long spines.

My setup

mujoco == 3.4.0
python = 3.10
This bugs is specific to Windows OS (Win11 in my case). On Linux everything is good.

What's happening? What did you expect?

In short, I suspect that commit b6f25ca that fixed #2898 broke the mujoco Python bindings on Windows OS.

In the #2898, OP mentioned a bug that Windows executables of mujoco (simulate.exe, etc.) had problems loading long nested models. Thanks for fixing this in 3.4.0.

Indeed, I had similar issues as OP that simulate.exe could not load a long nested model for mujoco<3.4.0 (crashed without a log). However, this bug was trivial to me as I was mainly working with my model through mujoco or dm_control python bindings for coding controllers/sensors/data analysis, etc. Although in mujoco<3.4.0, executables on Windows OS could not load a long nested model, the Python bindings worked normally.

After the fix in 3.4.0, executables on Windows OS could load a long nested model, but the Python bindings did not work anymore (crashed without a log).

It would be optimal if both executable and Python bindings work on Windows OS. But if only one of the two works, I would vote to keep the original version where the Python bindings work.
Because from the Python binding, a user could invoke the viewer. But if only the executable works, the user cannot use the Python bindings to do detailed programming and control of the model.

Steps for reproduction

  1. Download the model Body_REV02_76_body.xml.

  2. Install mujoco==3.3.7

  3. Run the test script below. (You will get the print message "Model loaded successfully" => python binding works)

  4. Use simulate.exe to load the model (Crashes without a log => the executable doesn't work)

  5. Install mujoco==3.4.0 (After the patch)

  6. Run the test script below again. (You will not get the print message and crash without a long => python binding doesn't work)

  7. Use simulate.exe to load the model (It loads. => the executable works )

(The same thing goes for dm_control.mjcf.Physics.from_mjcf_model('Body_REV02_76_body.xml') I guess it calls the same buggy thing in mujoco)

Minimal model for reproduction

For reproducing the bug, I use OP's model with 4 more bodies.
Body_REV02_76_body.xml

Code required for reproduction

import mujoco

model = mujoco.MjModel.from_xml_path('Body_REV02_76_body.xml')
data  = mujoco.MjData(model)
print('Model loaded successfully.')

Confirmations

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions