Skip to content

Strip unused madrona subsystems (physics, navmesh) from the batch renderer - #66

Merged
duburcqa merged 14 commits into
Genesis-Embodied-AI:mainfrom
duburcqa:strip-madrona-physics
Jul 23, 2026
Merged

Strip unused madrona subsystems (physics, navmesh) from the batch renderer#66
duburcqa merged 14 commits into
Genesis-Embodied-AI:mainfrom
duburcqa:strip-madrona-physics

Conversation

@duburcqa

@duburcqa duburcqa commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Aggressively remove everything the Genesis batch-render path doesn't use, in one PR (~8.4k lines deleted). Success criterion: the ~37 batch-render unit tests (rasterizer + raytracer) stay green.

Removed

  • Rigid-body physics simulation (~7.4k lines). Genesis runs its own physics and feeds transforms to the renderer, so madrona's solvers are never added to the render task graph (sim.cpp sets up only rendering). Deleted xpbd, tgs, narrowphase, broadphase, physics.cpp, physics_assets, physics_loader and their headers; dropped them from the JIT megakernel sources and the bridge links; removed the physics CMake subdirectory.
  • navmesh. madrona_navmesh was never linked by any target and no ECS system referenced it — pure dead weight in the megakernel. Removed the library, the megakernel source, and the files.
  • CPU multi-world executor. The renderer runs GPU-only (ExecMode::CUDA / MWCudaExecutor); madrona_mw_cpu (cpu_exec.cpp + mw_cpu headers) is never instantiated. Removed the library, its bridge link, and the vestigial mw_cpu.hpp include.

Kept (the render path needs it)

The mesh-BVH / geometry infrastructure the raytracer depends on: mesh_bvh.{hpp,inl}, geo.{hpp,inl,cpp}, gjk.hpp. mesh_bvh_builder.cpp now includes mesh_bvh.hpp directly instead of physics_assets.hpp (it only needed MeshBVH).

Validation

  • Host build: green.
  • The device megakernel is JIT-compiled at runtime, so the render path is validated by the batch-render tests on the cluster (genesis Production CI). Each removed subsystem was verified to be absent from the render task graph before deletion, so rendering should be unaffected.

Builds on the v0.0.9.post1 render-crash fix already on main.

duburcqa added 5 commits July 23, 2026 09:06
Genesis runs its own physics and feeds transforms to the renderer, so madrona's
rigid-body solvers are never part of the render task graph. Remove them from
what gets built:

- drop physics.cpp / xpbd / tgs / narrowphase / broadphase from the JIT
  megakernel sources (geo.cpp is kept, shared by the mesh BVH)
- stop linking madrona_mw_physics / madrona_physics_loader into the bridge
- drop the now-redundant physics.hpp / physics_loader.hpp includes (the bridge
  only used base components, which come from components.hpp)

The mesh-BVH / geo / physics_assets infrastructure the raytracer depends on is
kept. Dead source files and unused physics libs are deleted in a follow-up.
Following the unlink, remove the now-unused physics sources entirely: the
rigid-body solvers (xpbd, tgs, narrowphase, broadphase), physics.cpp,
physics_assets and physics_loader, plus their headers, and drop the physics
CMake subdirectory. The mesh-BVH builder no longer includes physics_assets (it
only needs MeshBVH from mesh_bvh.hpp). Only the geometry helpers (geo.cpp,
gjk.hpp) and the geo / mesh_bvh headers are kept -- the raytracer BVH needs them.
madrona_navmesh is never linked by any target and no ECS system references it;
it was only dead weight in the JIT megakernel. Drop navmesh.cpp from the
megakernel sources, delete the library, and remove the files.
@duburcqa duburcqa changed the title Strip the madrona rigid-body physics simulation Strip unused madrona subsystems (physics, navmesh) from the batch renderer Jul 23, 2026
duburcqa added 4 commits July 23, 2026 09:39
The batch renderer runs GPU-only (ExecMode::CUDA / MWCudaExecutor); the CPU
executor (madrona_mw_cpu: cpu_exec.cpp + mw_cpu headers) is never instantiated.
Drop the library, its bridge link, and the vestigial mw_cpu.hpp include in mgr.
- importer.cpp: drop the permanently-disabled #ifdef MADRONA_GLTF_SUPPORT /
  MADRONA_USD_SUPPORT branches (macros defined nowhere; they include gltf.hpp /
  usd.hpp which don't exist). Only OBJ + procedural primitives are used.
- src/core: remove the madrona_core static library. It is never linked by any
  target (the bridge and rendering system use madrona_mw_core); it only
  redundantly recompiled the core sources.
The GPU executor is hardcoded to TaskGraph (exec_mode was a compile-time
constant) and MADRONA_USE_JOB_SYSTEM is never defined, so the entire
JobSystem path was unreachable: device/host job managers, the job
megakernel body, the per-mode branches in cuda_exec.cpp, and the orphaned
getUserEntries / makeJobSysRunGraph helpers.
Genesis only calls MadronaBatchRenderer.{init,render,rgb/depth/
segmentation/normal_tensor} and consumes the results via Tensor.to_torch.
Remove the JAX interface (jax_register.py, JAXInterface, to_jax), the
TrainInterface/CudaSync/PyExecMode Python classes, the Tensor ndarray
constructor, and the four unused instance/camera tensor exports.
@duburcqa
duburcqa force-pushed the strip-madrona-physics branch from a384b32 to a70d687 Compare July 23, 2026 11:46
duburcqa added 2 commits July 23, 2026 13:56
None of these are referenced by the headless batch path: the viewer/
deferred-depth/voxel/blur/grid/shadow_gen/textured_quad shaders and the
unused vk basic.hlsl are never compiled at runtime; font.ttf has no
loader; scripts/ (profiling + benchmarks) is not part of the build; and
block_list.hpp has no includers.
postProcess (post_process.hlsl) and createVisualization (visualize_tris.hlsl)
are constructed in the BatchRenderer but never bound or dispatched in
renderViews. Drop the pipelines and their shaders. The enableAntialiasing
render-option field is unrelated (read by no shader) and left in place.
@duburcqa
duburcqa force-pushed the strip-madrona-physics branch from a70d687 to 00c32ee Compare July 23, 2026 11:57
duburcqa added 2 commits July 23, 2026 14:04
The voxel shaders are gone and nothing on the rgb/depth/segmentation/
normal path reads the voxel buffer. Remove VoxelConfig from the public
render config, the voxel buffer allocation and EngineInterop members, the
RenderECSBridge/RenderingSystemState voxel fields, the dangling getVoxelPtr
declaration, and the VoxelGenPushConst shader struct.
CUB 2.8.2 (CUDA 12.8) marks its own Traits<T>::CATEGORY deprecated but keeps
using it in WarpScan/BlockScan, which our ECS radix sort instantiates. CUB's
own _CCCL_SUPPRESS_DEPRECATED_PUSH is a clang pragma that nvrtc/cicc ignores
and cannot catch at the instantiation site, so the warnings leak. Define
CCCL_IGNORE_DEPRECATED_API (CCCL's documented opt-out) for the nvrtc compile.
@duburcqa
duburcqa force-pushed the strip-madrona-physics branch from 09df52b to efc8627 Compare July 23, 2026 13:14
…lines

objectDraw/instanceCull were never dispatched; they existed only so their
reflected descriptor-set layouts could back asset_set_mat_tex_/asset_set_cull_,
which the live batch path binds. Source those layouts from the batch shaders
instead (instanceCull <- prepare_views.hlsl set 2, objectDraw <- batch_draw_rgb.hlsl
set 3 - verified layout-identical), store just the PipelineShaders instead of
building unused pipelines, and drop the fully-dead asset_set_draw_ pool/set.
@duburcqa
duburcqa force-pushed the strip-madrona-physics branch from efc8627 to 94fd7d7 Compare July 23, 2026 13:38
@duburcqa
duburcqa merged commit 41c9b64 into Genesis-Embodied-AI:main Jul 23, 2026
1 check passed
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.

1 participant