Skip to content

[MISC] Enable taichi debug mode in tests if possible.#1541

Merged
duburcqa merged 5 commits intoGenesis-Embodied-AI:mainfrom
duburcqa:ti_debug
Aug 15, 2025
Merged

[MISC] Enable taichi debug mode in tests if possible.#1541
duburcqa merged 5 commits intoGenesis-Embodied-AI:mainfrom
duburcqa:ti_debug

Conversation

@duburcqa
Copy link
Collaborator

@duburcqa duburcqa commented Aug 11, 2025

Description

  • Enable taichi debug mode for taichi >= 1.7.3

Motivation and Context

This would make debugging of out-of-memory access much easier

How Has This Been / Can This Be Tested?

Screenshots (if appropriate):

Checklist:

  • I read the CONTRIBUTING document.
  • I followed the Submitting Code Changes section of CONTRIBUTING document.
  • I tagged the title correctly (including BUG FIX/FEATURE/MISC/BREAKING)
  • I updated the documentation accordingly or no change is needed.
  • I tested my changes and added instructions on how to test it for reviewers.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

YilingQiao
YilingQiao previously approved these changes Aug 12, 2025
@YilingQiao YilingQiao changed the title [MISC] Enable taichi debug mode if possible. [MISC] Enable taichi debug mode if possible in tests. Aug 12, 2025
@YilingQiao YilingQiao changed the title [MISC] Enable taichi debug mode if possible in tests. [MISC] Enable taichi debug mode in tests if possible. Aug 12, 2025
@duburcqa
Copy link
Collaborator Author

duburcqa commented Aug 12, 2025

Taichi is crashing:

pytest -svn 0 --pdb "tests/test_rigid_physics.py::test_robot_scaling" 

============================================================================================================================ test session starts =============================================================================================================================
platform darwin -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 -- /Users/XXXXXX/.pyenv/versions/3.12.8/bin/python3.12
cachedir: .pytest_cache
Using --random-order-bucket=global
Using --random-order-seed=0

rootdir: /Users/XXXXXX/workspace/src/genesis
configfile: pyproject.toml
plugins: repeat-0.9.4, syrupy-4.9.1, random-order-1.1.1, retry-1.7.0, print-1.1.0, anyio-4.7.0, cov-6.1.1, forked-1.6.0, dash-2.18.2, xdist-3.6.1
collected 1 item                                                                                                                                                                                                                                                             

tests/test_rigid_physics.py::test_robot_scaling [Genesis] [18:03:01] [INFO] ╭─────────────────────────────────────────────────────────────────────────────────────╮
[Genesis] [18:03:01] [INFO] │┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉ Genesis ┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉│
[Genesis] [18:03:01] [INFO] ╰─────────────────────────────────────────────────────────────────────────────────────╯
[Genesis] [18:03:01] [INFO] Beware running Genesis in debug mode dramatically reduces runtime speed.
[Genesis] [18:03:01] [INFO] Consider setting 'performance_mode=True' in production to maximise runtime speed, if significantly increasing compilation time is not a concern.
[Genesis] [18:03:01] [INFO] Running on [Apple M4 Max] with backend gs.cpu. Device memory: 48.00 GB.
[Genesis] [18:03:01] [DEBUG] [Taichi] version 1.7.3, llvm 15.0.7, commit 5ec301be, osx, python 3.12.8
[Genesis] [18:03:01] [DEBUG] [Taichi] Starting on arch=arm64
[Genesis] [18:03:01] [INFO] 🚀 Genesis initialized. 🔖 version: 0.3.0, 🌱 seed: 0, 📏 precision: '64', 🐛 debug: True, 🎨 theme: 'dark'.
[Genesis] [18:03:01] [WARNING] Scene.show_FPS is deprecated. Please use Scene.profiling_options.show_FPS
[Genesis] [18:03:01] [INFO] Scene <fc09e87> created.
[Genesis] [18:03:01] [INFO] Adding <gs.RigidEntity>. idx: 0, uid: <0d04a83>, morph: <gs.morphs.MJCF(file='/Users/alexis.duburcq/workspace/src/genesis/genesis/assets/xml/franka_emika_panda/panda.xml')>, material: <gs.materials.Rigid>.
[Genesis] [18:03:01] [WARNING] (MJCF) Approximating tendon by joint actuator for `finger_joint1`
[Genesis] [18:03:01] [WARNING] (MJCF) Actuator control gain and bias parameters cannot be reduced to a unique PD control position gain. Using max between gain and bias for joint `finger_joint1`.
[Genesis] [18:03:01] [WARNING] (MJCF) Approximating tendon by joint actuator for `finger_joint2`
[Genesis] [18:03:01] [WARNING] (MJCF) Actuator control gain and bias parameters cannot be reduced to a unique PD control position gain. Using max between gain and bias for joint `finger_joint2`.
[Genesis] [18:03:01] [INFO] Applying offset to base link's pose with user provided value in morph.
[Genesis] [18:03:01] [INFO] Preprocessing geom idx 0.
[Genesis] [18:03:02] [INFO] Preprocessing geom idx 1.
[Genesis] [18:03:02] [INFO] Preprocessing geom idx 2.
[Genesis] [18:03:02] [INFO] Preprocessing geom idx 3.
[Genesis] [18:03:02] [INFO] Preprocessing geom idx 4.
[Genesis] [18:03:03] [INFO] Preprocessing geom idx 5.
[Genesis] [18:03:03] [INFO] Preprocessing geom idx 6.
[Genesis] [18:03:03] [INFO] Preprocessing geom idx 7.
[Genesis] [18:03:03] [INFO] Preprocessing geom idx 8.
[Genesis] [18:03:03] [INFO] Preprocessing geom idx 9.
[Genesis] [18:03:03] [INFO] Preprocessing geom idx 10.
[Genesis] [18:03:04] [INFO] Preprocessing geom idx 11.
[Genesis] [18:03:04] [INFO] Preprocessing geom idx 12.
[Genesis] [18:03:04] [INFO] Preprocessing geom idx 13.
[Genesis] [18:03:04] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 14.
[Genesis] [18:03:04] [INFO] Preprocessing geom idx 15.
[Genesis] [18:03:04] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 16.
[Genesis] [18:03:04] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 17.
[Genesis] [18:03:04] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 18.
[Genesis] [18:03:04] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 19.
[Genesis] [18:03:04] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 20.
[Genesis] [18:03:04] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 21.
[Genesis] [18:03:04] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 22.
[Genesis] [18:03:04] [INFO] Building scene <fc09e87>...
[Genesis] [18:03:05] [DEBUG] Constraint solver time constant not specified. Using default value (`0.02`).
[Genesis] [18:03:05] [DEBUG] Constraint solver time constant not specified. Using default value (`0.02`).
[Genesis] [18:03:05] [WARNING] Reference robot position exceeds joint limits.
[Genesis] [18:03:05] [WARNING] Constraint solver time constant should be greater than 2*substep_dt. timeconst is changed from `0.005` to `0.02`). Decrease simulation timestep or increase timeconst to avoid altering the original value.
[Genesis] [18:03:09] [INFO] Compiling simulation kernels...
[Genesis] [18:03:34] [INFO] Building visualizer...
[Genesis] [18:03:35] [INFO] Scene <2aca826> created.
[Genesis] [18:03:35] [INFO] Adding <gs.RigidEntity>. idx: 0, uid: <9bdd48e>, morph: <gs.morphs.MJCF(file='/Users/alexis.duburcq/workspace/src/genesis/genesis/assets/xml/franka_emika_panda/panda.xml')>, material: <gs.materials.Rigid>.
[Genesis] [18:03:35] [WARNING] (MJCF) Approximating tendon by joint actuator for `finger_joint1`
[Genesis] [18:03:35] [WARNING] (MJCF) Actuator control gain and bias parameters cannot be reduced to a unique PD control position gain. Using max between gain and bias for joint `finger_joint1`.
[Genesis] [18:03:35] [WARNING] (MJCF) Approximating tendon by joint actuator for `finger_joint2`
[Genesis] [18:03:35] [WARNING] (MJCF) Actuator control gain and bias parameters cannot be reduced to a unique PD control position gain. Using max between gain and bias for joint `finger_joint2`.
[Genesis] [18:03:35] [INFO] Applying offset to base link's pose with user provided value in morph.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 0.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 1.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 2.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 3.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 4.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 5.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 6.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 7.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 8.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 9.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 10.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 11.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 12.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 13.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 14.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 15.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 16.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 17.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 18.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 19.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 20.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 21.
[Genesis] [18:03:35] [DEBUG] Preprocessed file (`.gsd`) found in cache for geom idx 22.
[Genesis] [18:03:35] [INFO] Building scene <2aca826>...
[Genesis] [18:03:36] [DEBUG] Constraint solver time constant not specified. Using default value (`0.02`).
[Genesis] [18:03:36] [DEBUG] Constraint solver time constant not specified. Using default value (`0.02`).
[Genesis] [18:03:36] [WARNING] Reference robot position exceeds joint limits.
[Genesis] [18:03:36] [WARNING] Constraint solver time constant should be greater than 2*substep_dt. timeconst is changed from `0.005` to `0.02`). Decrease simulation timestep or increase timeconst to avoid altering the original value.
[Genesis] [18:03:40] [INFO] Compiling simulation kernels...
[E 08/11/25 18:03:55.958 12576221] Received signal 11 (Segmentation fault: 11)



                            * Taichi Core - Stack Traceback *                             
==========================================================================================
|                       Module |  Offset | Function                                      |
|----------------------------------------------------------------------------------------|
* taichi_python.cpython-312-darwin.so |     136 | taichi::Logger::error(std::__1::basic_ |
                                         | string<char, std::__1::char_traits<char>, std |
                                         | ::__1::allocator<char>> const&, bool)         |
* taichi_python.cpython-312-darwin.so |     372 | taichi::(anonymous namespace)::signal_ |
                                         | handler(int)                                  |
*     libsystem_platform.dylib |      56 | (null)                                        |
*                          ??? | 1703675988 | (null)                                     |
* taichi_python.cpython-312-darwin.so |      56 | taichi::lang::Program::launch_kernel(t |
                                         | aichi::lang::CompiledKernelData const&, taich |
                                         | i::lang::LaunchContextBuilder&)               |
* taichi_python.cpython-312-darwin.so |     232 | void pybind11::cpp_function::initializ |
                                         | e<pybind11::cpp_function::cpp_function<void,  |
                                         | taichi::lang::Program, taichi::lang::Compiled |
                                         | KernelData const&, taichi::lang::LaunchContex |
                                         | tBuilder&, pybind11::name, pybind11::is_metho |
                                         | d, pybind11::sibling>(void (taichi::lang::Pro |
                                         | gram::*)(taichi::lang::CompiledKernelData con |
                                         | st&, taichi::lang::LaunchContextBuilder&), py |
                                         | bind11::name const&, pybind11::is_method cons |
                                         | t&, pybind11::sibling const&)::'lambda'(taich |
                                         | i::lang::Program*, taichi::lang::CompiledKern |
                                         | elData const&, taichi::lang::LaunchContextBui |
                                         | lder&), void, taichi::lang::Program*, taichi: |
                                         | :lang::CompiledKernelData const&, taichi::lan |
                                         | g::LaunchContextBuilder&, pybind11::name, pyb |
                                         | ind11::is_method, pybind11::sibling>(void&&,  |
                                         | taichi::lang::Program (*)(taichi::lang::Compi |
                                         | ledKernelData const&, taichi::lang::LaunchCon |
                                         | textBuilder&), pybind11::name const&, pybind1 |
                                         | 1::is_method const&, pybind11::sibling const& |
                                         | )::'lambda'(pybind11::detail::function_call&) |
                                         | ::operator()(pybind11::detail::function_call& |
                                         | ) const                                       |
* taichi_python.cpython-312-darwin.so |    3720 | pybind11::cpp_function::dispatcher(_ob |
                                         | ject*, _object*, _object*)                    |
*          libpython3.12.dylib |      92 | (null)                                        |
*          libpython3.12.dylib |     308 | (null)                                        |
*          libpython3.12.dylib |   17752 | (null)                                        |
*          libpython3.12.dylib |     444 | (null)                                        |
*          libpython3.12.dylib |   20444 | (null)                                        |
*          libpython3.12.dylib |     272 | (null)                                        |
*          libpython3.12.dylib |     152 | (null)                                        |
*          libpython3.12.dylib |     224 | (null)                                        |
*          libpython3.12.dylib |     136 | (null)                                        |
*          libpython3.12.dylib |   20444 | (null)                                        |
*          libpython3.12.dylib |     144 | (null)                                        |
*          libpython3.12.dylib |     152 | (null)                                        |
*          libpython3.12.dylib |     224 | (null)                                        |
*          libpython3.12.dylib |     308 | (null)                                        |
*          libpython3.12.dylib |   17752 | (null)                                        |
*          libpython3.12.dylib |     144 | (null)                                        |
*          libpython3.12.dylib |     152 | (null)                                        |
*          libpython3.12.dylib |     224 | (null)                                        |
*          libpython3.12.dylib |     136 | (null)                                        |
*          libpython3.12.dylib |   20444 | (null)                                        |
*          libpython3.12.dylib |     144 | (null)                                        |
*          libpython3.12.dylib |     152 | (null)                                        |
*          libpython3.12.dylib |     224 | (null)                                        |
*          libpython3.12.dylib |     308 | (null)                                        |
*          libpython3.12.dylib |   17752 | (null)                                        |
*          libpython3.12.dylib |     144 | (null)                                        |
*          libpython3.12.dylib |     152 | (null)                                        |
*          libpython3.12.dylib |     224 | (null)                                        |
*          libpython3.12.dylib |     308 | (null)                                        |
*          libpython3.12.dylib |   17752 | (null)                                        |
*          libpython3.12.dylib |     144 | (null)                                        |
*          libpython3.12.dylib |     152 | (null)                                        |
*          libpython3.12.dylib |     224 | (null)                                        |
*          libpython3.12.dylib |     308 | (null)                                        |
*          libpython3.12.dylib |   17752 | (null)                                        |
*          libpython3.12.dylib |     252 | (null)                                        |
*          libpython3.12.dylib |     168 | (null)                                        |
*          libpython3.12.dylib |     876 | (null)                                        |
*          libpython3.12.dylib |     160 | (null)                                        |
*          libpython3.12.dylib |     336 | (null)                                        |
*          libpython3.12.dylib |    1560 | (null)                                        |
*          libpython3.12.dylib |     328 | (null)                                        |
*          libpython3.12.dylib |      40 | (null)                                        |
*                         dyld |    6076 | (null)                                        |
==========================================================================================


Internal error occurred. Check out this page for possible solutions:
https://docs.taichi-lang.org/docs/install 

@duburcqa duburcqa closed this Aug 12, 2025
@duburcqa duburcqa reopened this Aug 12, 2025
@duburcqa duburcqa force-pushed the ti_debug branch 5 times, most recently from 72ceb3d to 6d3cf97 Compare August 14, 2025 01:37
@duburcqa duburcqa enabled auto-merge (squash) August 14, 2025 01:42
@duburcqa duburcqa force-pushed the ti_debug branch 4 times, most recently from 04306a2 to 6db61d8 Compare August 14, 2025 21:42
@duburcqa duburcqa disabled auto-merge August 15, 2025 01:31
@duburcqa duburcqa merged commit 7d75d28 into Genesis-Embodied-AI:main Aug 15, 2025
18 checks passed
@duburcqa duburcqa deleted the ti_debug branch August 17, 2025 06:39
winnieyangwannan pushed a commit to winnieyangwannan/Genesis that referenced this pull request Sep 14, 2025
…ed-AI#1541)

* Improve huggingface download fault tolerance.
* Enable taichi debug mode if possible.
* Add opt-in flag for debug mode in unit tests.
* Fix small nits.
* Require 'taichi>=1.7.4'.
Kashu7100 pushed a commit to Kashu7100/Genesis that referenced this pull request Jan 26, 2026
…ed-AI#1541)

* Improve huggingface download fault tolerance.
* Enable taichi debug mode if possible.
* Add opt-in flag for debug mode in unit tests.
* Fix small nits.
* Require 'taichi>=1.7.4'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants