Skip to content

Commit 844ea9f

Browse files
committed
Merge branch 'main' into yunlong/batchrender_example_mani
2 parents ad6778d + f1d47c3 commit 844ea9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2386
-957
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [BUG FIX] for non-breaking changes which fix an issue
1010
- [FEATURE] for non-breaking changes which add functionality
1111
- [MISC] for minor changes such as improved inline documentation or fixing typos
12+
- [CHANGING] for changes that will change simulation's behaviour
1213
- [BREAKING] **in addition to the above** for breaking changes, i.e., a fix or feature that would cause existing APIs or functionality to change
1314
-->
1415

.github/workflows/generic.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727

2828
env:
2929
HF_HUB_DOWNLOAD_TIMEOUT: 60
30+
FORCE_COLOR: 1
31+
PY_COLORS: 1
3032
GS_CACHE_FILE_PATH: ".cache/genesis"
3133
TI_OFFLINE_CACHE: "1"
3234
TI_OFFLINE_CACHE_CLEANING_POLICY: "never"
@@ -81,28 +83,19 @@ jobs:
8183
7z x mesa.7z -omesa
8284
mv -v mesa/x64/* /C/Windows/System32/
8385
84-
- name: Install system dependencies (Linux)
86+
- name: Install Mesa 25 OpenGL driver (Linux)
8587
if: startsWith(matrix.OS, 'ubuntu-')
8688
run: |
89+
sudo add-apt-repository -y ppa:kisak/kisak-mesa
8790
sudo apt-get update
8891
sudo apt install -y \
89-
libgl1 \
90-
libegl1 \
91-
libglvnd-dev \
92-
libglew-dev \
93-
libegl-dev \
94-
libx11-6 \
95-
libxrender1 \
96-
libglib2.0-0 \
97-
libosmesa6-dev \
98-
libglx-mesa0 \
9992
libglu1-mesa \
100-
libegl1-mesa-dev \
101-
libgles2-mesa-dev
93+
libegl-mesa0 \
94+
libgl1-mesa-dev
10295
- name: Install python dependencies
10396
run: |
10497
pip install --upgrade pip setuptools pkg-info wheel
105-
pip install torch
98+
pip3 install torch --index-url https://download.pytorch.org/whl/cpu
10699
107100
- name: Black Format Check
108101
if: matrix.OS == 'ubuntu-22.04' && matrix.PYTHON_VERSION == '3.12'

.github/workflows/production.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
HF_HUB_DOWNLOAD_TIMEOUT: 60
2525
GENESIS_IMAGE_VER: "1_1"
2626
TIMEOUT_MINUTES: 180
27+
FORCE_COLOR: 1
28+
PY_COLORS: 1
2729
MADRONA_DISABLE_CUDA_HEAP_SIZE: "1"
2830
OMNI_KIT_ACCEPT_EULA: "yes"
2931
OMNI_KIT_ALLOW_ROOT: "1"

.readthedocs.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.12"
7+
8+
submodules:
9+
include:
10+
- doc
11+
recursive: true
12+
13+
sphinx:
14+
configuration: doc/source/conf.py
15+
16+
python:
17+
install:
18+
- requirements: doc/requirements.txt

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
# Genesis
1919

2020
## 🔥 News
21-
- [2025-08-16] Released v0.3.1
2221
- [2025-08-05] Released v0.3.0 🎊 🎉
2322
- [2025-07-02] The development of Genesis is now officially supported by [Genesis AI](https://genesis-ai.company/).
2423
- [2025-01-09] We released a [detailed performance benchmarking and comparison report](https://github.com/zhouxian/genesis-speed-benchmark) on Genesis, together with all the test scripts.

RELEASE.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
11
# Genesis Release Note
22

3+
## 0.3.3
4+
5+
This minor release fixes a few non-blocking rendering issues for the Rasterizer backend.
6+
7+
### Bug Fixes
8+
9+
* [BUG FIX] Fix shadow map not properly rendered for objects far away from floor plane. (@duburcqa) (#1664)
10+
* [BUG FIX] Fix genesis import failure if tkinter is failing at init on MacOS. (@duburcqa) (#1666)
11+
* [BUG FIX] Fix default visualization mode for emitter surface. (@duburcqa) (#1665)
12+
13+
### Miscellaneous
14+
15+
* [MISC] Expose parameters for ground plane tiling. (@yuhongyi) (#1657)
16+
* [MISC] Add support of 'ti.ndarray' to 'ti_field_to_torch' and rename in 'ti_to_torch'. (@duburcqa) (#1661)
17+
18+
## 0.3.2
19+
20+
This minor release fixes a few additional regressions and initiates migration to our own open-source fork of Taichi, [GsTaichi](https://github.com/Genesis-Embodied-AI/gstaichi) (contributions are welcome!).
21+
22+
### Behavior Changing
23+
24+
* Disable decimation if deemed unnecessary and unreliable. Reduce default aggressiveness. (@duburcqa) (#1644)
25+
* Fix primitive and mesh's COM. (@YilingQiao) (#1638)
26+
27+
### New Features
28+
29+
* Add 'set_dofs_frictionloss' method for dynamic joint friction control. (@LeonLiu4) (#1614)
30+
* Add initial experimental support of gstaichi fast cache feature. (@hughperkins) (#1631)
31+
* Add 'ref' optional argument to 'get_links_pos'. (@YilingQiao) (#1638)
32+
33+
### Bug Fixes
34+
35+
* Fix Inverse Kinematics algorithm. (@Kashu7100, @duburcqa) (#1582, #1586)
36+
* Fix save frame as png image in interactive viewer. (@Kashu7100) (#1606)
37+
* Filter out collision pairs involved in weld equality constraints. (@duburcqa) (#1621)
38+
* Fix viewer backend fallback when running in main thread. (@duburcqa) (#1630)
39+
* Fix 'quat_to_xyz' singularity edge-case. (@duburcqa) (#1628)
40+
* Fix CUDA runtime being initialized by 'get_device'. (@duburcqa) (#1634)
41+
42+
### Miscellaneous
43+
44+
* Re-enable world-frame in the 'gs view' standalone viewer. (@Kashu7100) (#1584)
45+
* Migrate from 'taichi' to 'gstaichi'. (@duburcqa, @hughperkins) (#1550, #1618, #1645)
46+
* Update documentation so the doc will be compiled based on the latest main. (@YilingQiao) (#1616)
47+
348
## 0.3.1
449

550
This small release addresses the most pressing regressions that has been pointed out by the community since 0.3.0. Support of coupling between Rigid Body and FEM has been improved and should be more reliable, though it is still considered experimental for now. Apart from that, no behavior changes are to be expected.
@@ -128,7 +173,7 @@ This release focuses primarily on stability, covering everything from MJCF/URDF
128173

129174
* Update Drone Entity and Training Performance Enhancements. (@KafuuChikai) (#598)
130175
* Added PID controller util, quadcopter PID controller, flight examples. (@jebbrysacz) (#501)
131-
* Add support of Numpy 2.0. (@johnnynunez, @duburcqa) (#711, #791)
176+
* Add support of Numpy 2.0. (@johnnynunez, @duburcqa) (#711, #791)
132177
* Setup unit test infrastructure. (@duburcqa) (#876)
133178
* Various minor improvements. (@duburcqa) (#889)
134179
* Get rid of internally maintained trimesh dependency. (@duburcqa) (#918)

doc

Submodule doc updated 80 files

examples/coupling/water_wheel.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
def main():
99
parser = argparse.ArgumentParser()
10+
parser.add_argument("--solver", type=str, default="sph", choices=("sph", "mpm"))
11+
parser.add_argument("--recon", action="store_true", default=False)
1012
parser.add_argument("-v", "--vis", action="store_true", default=False)
1113
args = parser.parse_args()
1214

@@ -20,8 +22,14 @@ def main():
2022
substeps=10,
2123
),
2224
mpm_options=gs.options.MPMOptions(
23-
lower_bound=(0.0, 0.0, 0.0),
24-
upper_bound=(1.0, 1.0, 1.5),
25+
lower_bound=(0.0, -1.5, 0.0),
26+
upper_bound=(1.0, 1.5, 4.0),
27+
),
28+
sph_options=gs.options.SPHOptions(
29+
particle_size=0.02,
30+
),
31+
pbd_options=gs.options.PBDOptions(
32+
particle_size=0.02,
2533
),
2634
viewer_options=gs.options.ViewerOptions(
2735
camera_pos=(5.5, 6.5, 3.2),
@@ -33,13 +41,10 @@ def main():
3341
rendered_envs_idx=[0],
3442
),
3543
show_viewer=args.vis,
36-
sph_options=gs.options.SPHOptions(
37-
particle_size=0.02,
38-
),
3944
)
4045

4146
plane = scene.add_entity(gs.morphs.Plane())
42-
wheel_0 = scene.add_entity(
47+
wheel = scene.add_entity(
4348
morph=gs.morphs.URDF(
4449
file="urdf/wheel/fancy_wheel.urdf",
4550
pos=(0.5, 0.25, 1.6),
@@ -50,17 +55,19 @@ def main():
5055
)
5156

5257
emitter = scene.add_emitter(
53-
material=gs.materials.SPH.Liquid(sampler="regular"),
58+
material=getattr(gs.materials, args.solver.upper()).Liquid(
59+
sampler="regular",
60+
),
5461
max_particles=100000,
5562
surface=gs.surfaces.Glass(
5663
color=(0.7, 0.85, 1.0, 0.7),
64+
vis_mode="recon" if args.recon else "particle",
5765
),
5866
)
59-
scene.build(n_envs=5)
67+
scene.build(n_envs=2)
6068

6169
horizon = 500
6270
for i in range(horizon):
63-
print(i)
6471
emitter.emit(
6572
pos=np.array([0.5, 1.0, 3.5]),
6673
direction=np.array([0.0, 0, -1.0]),

examples/pbd_liquid.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,29 @@ def main():
1717
sim_options=gs.options.SimOptions(
1818
dt=2e-3,
1919
),
20-
viewer_options=gs.options.ViewerOptions(
21-
camera_pos=(3.5, 1.0, 2.5),
22-
camera_lookat=(0.0, 0.0, 0.5),
23-
camera_fov=40,
24-
),
25-
show_viewer=False,
2620
pbd_options=gs.options.PBDOptions(
2721
lower_bound=(0.0, 0.0, 0.0),
2822
upper_bound=(1.0, 1.0, 1.0),
2923
max_density_solver_iterations=10,
3024
max_viscosity_solver_iterations=1,
3125
),
26+
viewer_options=gs.options.ViewerOptions(
27+
camera_pos=(3.5, 1.0, 2.5),
28+
camera_lookat=(0.0, 0.0, 0.5),
29+
camera_fov=40,
30+
),
31+
show_viewer=args.vis,
3232
)
3333

3434
########################## entities ##########################
3535

3636
liquid = scene.add_entity(
37-
material=gs.materials.PBD.Liquid(rho=1.0, density_relaxation=1.0, viscosity_relaxation=0.0, sampler="regular"),
37+
material=gs.materials.PBD.Liquid(
38+
sampler="regular",
39+
rho=1.0,
40+
density_relaxation=1.0,
41+
viscosity_relaxation=0.0,
42+
),
3843
morph=gs.morphs.Box(lower=(0.2, 0.1, 0.1), upper=(0.4, 0.3, 0.5)),
3944
)
4045
scene.build(n_envs=5)

genesis/__init__.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import traceback
88
from platform import system
99
from contextlib import redirect_stdout
10+
from typing import Callable, TypeVar, ParamSpec
1011

1112
# Import gstaichi while collecting its output without printing directly
1213
_ti_outputs = io.StringIO()
@@ -41,6 +42,20 @@
4142
global_scene_list = set()
4243

4344

45+
_P = ParamSpec("P")
46+
_R = TypeVar("R")
47+
48+
49+
def _noop(fn: Callable[_P, _R]) -> Callable[_P, _R]:
50+
return fn
51+
52+
53+
if os.environ.get("GS_BETA_PURE") == "1":
54+
maybe_pure: Callable[[Callable[_P, _R]], Callable[_P, _R]] = ti.pure
55+
else:
56+
maybe_pure = _noop
57+
58+
4459
########################## init ##########################
4560
def init(
4661
seed=None,
@@ -198,6 +213,9 @@ def init(
198213
"increasing compilation time is not a concern."
199214
)
200215

216+
if os.environ.get("GS_BETA_PURE") == "1":
217+
logger.info("Enabling pure kernels for fast cache loading.")
218+
201219
if seed is not None:
202220
global SEED
203221
SEED = seed
@@ -231,9 +249,8 @@ def init(
231249
)
232250

233251
# Make sure that gstaichi arch is matching requirement
234-
ti_runtime = ti.lang.impl.get_runtime()
235-
ti_arch = ti_runtime.prog.config().arch
236-
if backend != gs.cpu and ti_arch in (ti._lib.core.Arch.arm64, ti._lib.core.Arch.x64):
252+
ti_config = ti.lang.impl.current_cfg()
253+
if backend != gs.cpu and ti_config.arch in (ti._lib.core.Arch.arm64, ti._lib.core.Arch.x64):
237254
device, device_name, total_mem, backend = get_device(gs.cpu)
238255

239256
_globalize_backend(backend)
@@ -276,7 +293,7 @@ def destroy():
276293
_initialized = False
277294

278295
# Unregister at-exit callback that is not longer relevant.
279-
# This is important when `init` / `destory` is called multiple times, which is typically the case for unit tests.
296+
# This is important when `init` / `destroy` is called multiple times, which is typically the case for unit tests.
280297
atexit.unregister(destroy)
281298

282299
# Display any buffered error message if logger is configured
@@ -292,9 +309,8 @@ def destroy():
292309
# Destroy all scenes
293310
global global_scene_list
294311
for scene in global_scene_list:
295-
if scene._visualizer is not None:
296-
scene._visualizer.destroy()
297-
del scene
312+
if scene.visualizer is not None:
313+
scene.visualizer.destroy()
298314
global_scene_list.clear()
299315

300316
# Reset gstaichi

0 commit comments

Comments
 (0)