Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions genesis/engine/solvers/rigid/rigid_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,9 @@ def _build_static_config(self):
# Prefer the monolith solver on CPU (always faster there, perf dispatch is a waste of effort)
if gs.backend == gs.cpu or self.sim.options.requires_grad:
static_rigid_sim_config["prefer_decomposed_solver"] = 0
# Prefer the decomposed solver on CUDA, which supports hardware accelerated graph and do-while condition
elif gs.backend == gs.cuda:
static_rigid_sim_config["prefer_decomposed_solver"] = 1

if self.is_active:
# TODO: These alternative tiled algorithms are designed to reduce the impact of latency. However, naive
Expand Down
9 changes: 9 additions & 0 deletions genesis/ext/_trimesh_patch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import re
import warnings
from collections import defaultdict, deque

import numpy as np
Expand All @@ -25,6 +26,14 @@
import genesis as gs


# Silence trimesh mass_properties divide-by-zero on degenerate meshes.
warnings.filterwarnings(
"ignore",
category=RuntimeWarning,
message=r"(divide by zero|invalid value) encountered in (divide|scalar multiply)",
)
Comment on lines +30 to +34
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restrict warning suppression to trimesh module

This warnings.filterwarnings call is process-global and runs on every import genesis (via genesis/__init__.py), so it suppresses any RuntimeWarning matching these very common NumPy messages across the entire application, not just trimesh mass-properties code. That can hide real divide/invalid numerical issues in unrelated simulation or user code and reduce debuggability. Please scope the filter (for example with a module= constraint or a local catch_warnings block around the trimesh call site) so only the intended trimesh warning is silenced.

Useful? React with 👍 / 👎.



def load_obj(
file_obj,
resolver=None,
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ ignore = [
[tool.pytest.ini_options]
addopts = [
"--verbose",
"-r", "a",
# Exclude 'f' (failed) from short test summary because it duplicates the FAILURES section in verbose mode.
# A plain list of failed test IDs is printed instead by 'pytest_terminal_summary' hook in tests/conftest.py.
"-r", "EsxXw",
"--color=yes",
"--import-mode=importlib",
"--pdbcls=IPython.terminal.debugger:TerminalPdb",
Expand Down
23 changes: 23 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,29 @@ def pytest_runtest_makereport(item, call):
report.longrepr = (os.path.relpath(__file__), lineno, reason)


def pytest_terminal_summary(terminalreporter, exitstatus, config):
"""Print a plain list of failed test IDs at the end of the run.

Replaces pytest's default 'FAILED test_id - msg' short summary lines (which in verbose mode
duplicate the FAILURES section) with a compact, easy-to-scan ID-only list.
"""
failed = terminalreporter.stats.get("failed")
if not failed:
return
terminalreporter.write_sep("=", "Failed tests")
fullwidth = terminalreporter._tw.fullwidth
for report in failed:
reprcrash = getattr(report.longrepr, "reprcrash", None)
msg = " ".join(reprcrash.message.split()) if reprcrash is not None else ""
if not msg:
terminalreporter.write_line(report.nodeid)
continue
line = f"{report.nodeid} - {msg}"
if len(line) > fullwidth:
line = line[: fullwidth - 3] + "..."
terminalreporter.write_line(line)


def pytest_addoption(parser: pytest.Parser) -> None:
parser.addoption("--backend", action="store", default=None, help="Default simulation backend.")
parser.addoption(
Expand Down
Loading