[PR #549] RT-BVH-BUILDER: serve XboxBvhBuilder.dll with the layer's XDXR builder #597

Open
opened 2026-11-26 20:18:25 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/549
Author: @bobcatchris
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: rt-bvh-builder-throw


📝 Commits (1)

  • ed2866e RT-BVH-BUILDER: serve XboxBvhBuilder.dll with the layer's XDXR builder

📊 Changes

7 files changed (+776 additions, -1 deletions)

View changed files

📝 docs/xdxr.md (+34 -0)
📝 runtime/CMakeLists.txt (+20 -0)
📝 runtime/shims/d3d12_xs_device.cpp (+2 -0)
📝 runtime/shims/d3d12_xs_device.h (+4 -0)
➕ runtime/shims/xbox_bvh_builder.cpp (+285 -0)
➕ runtime/test/xbox_bvh_builder_test.cpp (+430 -0)
📝 scripts/build_runtime.ps1 (+1 -1)

📄 Description

Claimed in the coordination issue as: RT-BVH-BUILDER-THROW

Depends on: none

What and why

After the slot-73 IID and XMem lease fixes, the title reaches XboxBvhBuilder.dll and ends in a C++ throw while the bundled DLL creates 52 console compute pipelines. Their translated compile time runs past the title's startup watchdog on a cold driver cache.

This restores the final state of three preserved commits whose content was dropped from main by later mirror merges. A shim serves the seven XboxBvhBuilder.dll imports the executable binds, so the DLL is never loaded and no 52 console programs are created. It builds the layer's own XDXR BVH4 structures in the format the translated traversal shaders read, skips the offline-statistics postbuild type instead of throwing, unwraps console command-list proxies, and holds the device reference across prebuild calls. LEONIDA_BVH_BUILDER=console preserves the bundled DLL path.

Original work by romainveurrier, preserved in the local full history as 242a5dbf1, 98c065ca2 and 65a2da200.

Tested

  • Built xbox_bvh_builder_test against current main with MSVC in a local out-of-tree build.
  • xbox_bvh_builder_test <out> — 13/13 checks pass, including proxy device handling, offline-statistics skip, E_NOTIMPL rehydration, destructor cleanup, and BLAS/TLAS/compacted-BLAS fixture output.
  • xbox_bvh_builder_test --console with LEONIDA_BVH_BUILDER=console — 1/1 check passes.
  • python -I tools/xdxr_bvh.py check-build <out> --rays 1000 — all cases match; 0 validation errors and 0/1000 ray differences for BLAS, compacted BLAS and TLAS.
  • python -I scripts/check_no_game_data.py on every changed file — clean.
  • git diff --check clean.
  • Patch, diff and direct-file security sweeps: 0 hits.
  • No game executable was run. No game files, keys or decryption are included.

A local MSVC 14.39 incompatibility in the unrelated src/crt_timed_wait.cpp was worked around only in the throwaway build directory; no repository source was changed for it.

GPUs tested: AMD Radeon RX 7900 XTX, driver 32.0.32029.2010, Windows 11

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic: restore the XboxBvhBuilder shim and its tests.
  • No game data, keys or decryption.
  • Synthetic GPU/BVH fixtures and console-mode regression included.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/549 **Author:** [@bobcatchris](https://github.com/bobcatchris) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `rt-bvh-builder-throw` --- ### 📝 Commits (1) - [`ed2866e`](https://github.com/ubiquitarianism/leonida/commit/ed2866eaa17480d6ab4f945dfe07da402f861ae6) RT-BVH-BUILDER: serve XboxBvhBuilder.dll with the layer's XDXR builder ### 📊 Changes **7 files changed** (+776 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/xdxr.md` (+34 -0) 📝 `runtime/CMakeLists.txt` (+20 -0) 📝 `runtime/shims/d3d12_xs_device.cpp` (+2 -0) 📝 `runtime/shims/d3d12_xs_device.h` (+4 -0) ➕ `runtime/shims/xbox_bvh_builder.cpp` (+285 -0) ➕ `runtime/test/xbox_bvh_builder_test.cpp` (+430 -0) 📝 `scripts/build_runtime.ps1` (+1 -1) </details> ### 📄 Description Claimed in the coordination issue as: RT-BVH-BUILDER-THROW Depends on: none ### What and why After the slot-73 IID and XMem lease fixes, the title reaches `XboxBvhBuilder.dll` and ends in a C++ throw while the bundled DLL creates 52 console compute pipelines. Their translated compile time runs past the title's startup watchdog on a cold driver cache. This restores the final state of three preserved commits whose content was dropped from `main` by later mirror merges. A shim serves the seven `XboxBvhBuilder.dll` imports the executable binds, so the DLL is never loaded and no 52 console programs are created. It builds the layer's own XDXR BVH4 structures in the format the translated traversal shaders read, skips the offline-statistics postbuild type instead of throwing, unwraps console command-list proxies, and holds the device reference across prebuild calls. `LEONIDA_BVH_BUILDER=console` preserves the bundled DLL path. Original work by romainveurrier, preserved in the local full history as `242a5dbf1`, `98c065ca2` and `65a2da200`. ### Tested - Built `xbox_bvh_builder_test` against current `main` with MSVC in a local out-of-tree build. - `xbox_bvh_builder_test <out>` — 13/13 checks pass, including proxy device handling, offline-statistics skip, E_NOTIMPL rehydration, destructor cleanup, and BLAS/TLAS/compacted-BLAS fixture output. - `xbox_bvh_builder_test --console` with `LEONIDA_BVH_BUILDER=console` — 1/1 check passes. - `python -I tools/xdxr_bvh.py check-build <out> --rays 1000` — all cases match; 0 validation errors and 0/1000 ray differences for BLAS, compacted BLAS and TLAS. - `python -I scripts/check_no_game_data.py` on every changed file — clean. - `git diff --check` clean. - Patch, diff and direct-file security sweeps: 0 hits. - No game executable was run. No game files, keys or decryption are included. A local MSVC 14.39 incompatibility in the unrelated `src/crt_timed_wait.cpp` was worked around only in the throwaway build directory; no repository source was changed for it. GPUs tested: AMD Radeon RX 7900 XTX, driver 32.0.32029.2010, Windows 11 AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic: restore the XboxBvhBuilder shim and its tests. - [x] No game data, keys or decryption. - [x] Synthetic GPU/BVH fixtures and console-mode regression included. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#597
No description provided.