Strip unused madrona subsystems (physics, navmesh) from the batch renderer - #66
Merged
duburcqa merged 14 commits intoJul 23, 2026
Merged
Conversation
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.
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
force-pushed
the
strip-madrona-physics
branch
from
July 23, 2026 11:46
a384b32 to
a70d687
Compare
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
force-pushed
the
strip-madrona-physics
branch
from
July 23, 2026 11:57
a70d687 to
00c32ee
Compare
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
force-pushed
the
strip-madrona-physics
branch
from
July 23, 2026 13:14
09df52b to
efc8627
Compare
…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
force-pushed
the
strip-madrona-physics
branch
from
July 23, 2026 13:38
efc8627 to
94fd7d7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
sim.cppsets up only rendering). Deletedxpbd,tgs,narrowphase,broadphase,physics.cpp,physics_assets,physics_loaderand their headers; dropped them from the JIT megakernel sources and the bridge links; removed thephysicsCMake subdirectory.madrona_navmeshwas 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.ExecMode::CUDA/MWCudaExecutor);madrona_mw_cpu(cpu_exec.cpp+mw_cpuheaders) is never instantiated. Removed the library, its bridge link, and the vestigialmw_cpu.hppinclude.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.cppnow includesmesh_bvh.hppdirectly instead ofphysics_assets.hpp(it only neededMeshBVH).Validation
Builds on the
v0.0.9.post1render-crash fix already onmain.