← All tasks
cppgoogle-deepmind/mujoco #3011Not a task: not reproduced

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

envgap__google-deepmind__mujoco-3011

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
6b197e198a065562b968daed82b1d9b19ca7d1c2
Manifest
python/mujoco/CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

google-deepmind/mujoco #3011 · read the original issue
### 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](https://github.com/google-deepmind/mujoco/commit/b6f25ca623b2ed9f8fbc8418acf0ddc2f26fad6e) that fixed [#2898](https://github.com/google-deepmind/mujoco/issues/2898) broke the mujoco Python bindings on Windows OS.


In the [#2898](https://github.com/google-deepmind/mujoco/issues/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](https://github.com/user-attachments/files/24509591/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

- [x] I searched the [latest documentation](https://mujoco.readthedocs.io/en/latest/overview.html) thoroughly before posting.
- [x] I searched previous [Issues](https://github.com/google-deepmind/mujoco/issues) and [Discussions](https://github.com/google-deepmind/mujoco/discussions), I am certain this has not been raised before.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]