[PR #743] [CLOSED] xdxr_bvh: handle D3D12 inactive primitives and NaN bounds (OLD-10063) #781

Closed
opened 2026-11-26 20:19:01 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/743
Author: @abnalstlll-byte
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: restore/old-10063-xdxr-bvh-inactive


📝 Commits (1)

  • d242fa7 xdxr_bvh: handle D3D12 inactive primitives and NaN bounds

📊 Changes

2 files changed (+181 additions, -34 deletions)

View changed files

📝 tests/test_xdxr_bvh.py (+101 -0)
📝 tools/xdxr_bvh.py (+80 -34)

📄 Description

### Summary
Restores and updates work from draft PR #329 (old-pr/10063 / item OLD-10063).
Original commit by @ShotTechOp (c90d09b7092).

In D3D12 / DirectX Raytracing, inactive primitives are marked by setting a vertex coordinate to NaN (e.g. v0.x = NaN). Previously, tools/xdxr_bvh.py would crash or produce corrupt node bounding boxes when encountering NaN coordinates in triangles or inactive TLAS instances.

This change:

  • Generates empty boxes (+inf, -inf) for inactive (NaN) triangles and never pairs them.
  • Prevents NaNs from propagating into parent bounds or child boxes.
  • Properly handles inactive TLAS instances (null BLAS, singular transforms, zero masks).
  • Handles edge cases where all triangles in a BLAS are inactive (empty bounds, valid miss on traversal).

Verification

  • python -I scripts/check_no_game_data.py tools/xdxr_bvh.py tests/test_xdxr_bvh.py -> Clean (no game data)
  • python -m unittest tests/test_xdxr_bvh.py -> 53/53 PASS in 1.75s
  • Clean rebase onto latest ubi/main (21625bca8).

AI-assisted verification and rebase by Antigravity (Autonomous Direct Mode).


🔄 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/743 **Author:** [@abnalstlll-byte](https://github.com/abnalstlll-byte) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `restore/old-10063-xdxr-bvh-inactive` --- ### 📝 Commits (1) - [`d242fa7`](https://github.com/ubiquitarianism/leonida/commit/d242fa7039dfe74f0b85b71a8fb6c02984f88a15) xdxr_bvh: handle D3D12 inactive primitives and NaN bounds ### 📊 Changes **2 files changed** (+181 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_xdxr_bvh.py` (+101 -0) 📝 `tools/xdxr_bvh.py` (+80 -34) </details> ### 📄 Description ### Summary Restores and updates work from draft PR #329 (`old-pr/10063` / item `OLD-10063`). Original commit by @ShotTechOp (`c90d09b7092`). In D3D12 / DirectX Raytracing, inactive primitives are marked by setting a vertex coordinate to NaN (e.g. `v0.x = NaN`). Previously, `tools/xdxr_bvh.py` would crash or produce corrupt node bounding boxes when encountering NaN coordinates in triangles or inactive TLAS instances. This change: - Generates empty boxes (`+inf, -inf`) for inactive (NaN) triangles and never pairs them. - Prevents NaNs from propagating into parent bounds or child boxes. - Properly handles inactive TLAS instances (null BLAS, singular transforms, zero masks). - Handles edge cases where all triangles in a BLAS are inactive (empty bounds, valid miss on traversal). ### Verification - `python -I scripts/check_no_game_data.py tools/xdxr_bvh.py tests/test_xdxr_bvh.py` -> Clean (no game data) - `python -m unittest tests/test_xdxr_bvh.py` -> 53/53 PASS in 1.75s - Clean rebase onto latest `ubi/main` (`21625bca8`). AI-assisted verification and rebase by Antigravity (Autonomous Direct Mode). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:19:01 +01:00
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#781
No description provided.