xdxr_bvh: handle D3D12 inactive primitives and NaN bounds (OLD-10063) #598
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!598
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/598/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@jarvixaiassistant-glitch on GitHub · 2026-11-24 09:38 UTC · original
jarvixaiassistant-glitch:fix/old-10063-xdxr-bvh-nan-inactive→main· +202 −37 · 2 files · 2 commits · merged 2026-11-24 22:33 UTCClaimed in the coordination issue as: OLD-10063
What and why
Carries forward
old-pr/10063(draft #329) ontomain(d7576d56a), preservingShotTechOp's original commit verbatim perCONTRIBUTING.mdand adding one focused hardening commit on top:ShotTechOp): Updatestools/xdxr_bvh.pyto handle D3D12 inactive triangles (NaN vertices → empty box(+inf, -inf), never paired; zero-length edges skipped during pairing), inactive TLAS instances (blas_va == 0, zero mask, emptyblas_bounds, or NaN-transformed corners → empty world box), NaN-safe_box_test, and explicit NaN child-box rejection invalidate(), plus synthetic unit tests intests/test_xdxr_bvh.py.JARVIX): Updatesinvert_affine()intools/xdxr_bvh.pyto reject non-finite determinants (not math.isfinite(det)) and non-finite inverse entries. Previously, aNaNin an inactive TLAS instance's rotation or translation bypasseddet == 0and packedNaNfloats into the instance record's inverse matrix instead of triggeringbuild_tlas()'s zero-matrix fallback. Addstest_nan_transform_falls_back_to_zero_inverse_in_tlascovering both rotation and translation NaNs.Tested
All synthetic CPU/stdlib/docs checks on Windows 11 x64, Python 3.12.14, Node v24.19.0 (no game files):
python -I tests/test_xdxr_bvh.py -v— 54/54 passed (reproducedinvert_affine()returning all-NaN before the hardening commit; 54/54 pass after)python -I scripts/check_no_game_data.py— passed (0 forbidden tracked extensions)python -m compileall -q make_game.py tools tests— passedpython -I tests/test_text_write_line_endings.py,tests/test_report_paths.py,tests/test_i18n_index.py, and alltests/test_docs_*.py— passednode --test tests/test_viewer_streaming.cjs— passedGPUs tested: n/a (CPU BVH reference / unit tests only)
AI-assisted: yes (JARVIX multi-model team: Antigravity + DeepSeek-V4-Pro + NVIDIA NIM Nemotron-3.5-Lightning & Nemotron-3-Ultra-550B)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (N/A — CPU BVH reference tool only, no shader-translator rule changed.)@PierreEbele on GitHub · 2026-11-24 19:59 UTC · original
Reviewed
428f941: ranpython3 -I tests/test_xdxr_bvh.py(54 OK; all 7 added tests fail on main),compileall, and edge-case probes on both trees: active-only builds are byte-identical and trace
== brute_force; NaN-inactive triangles/instances now build and validate cleanly where main
aborted TLAS builds (ValueError on singular inactive instances) or wrote NaN bounds/inverses;
the pair remap rework diverges only for zero-area triangles, which never hit. Two non-blocking
notes: brute_force now raises on NaN-transform scene entries that build_tlas treats as inactive
(reference stricter than builder), and validate still accepts NaN header scene bounds.
AI-assisted review.
@aslan2142 on GitHub · 2026-11-24 22:33 UTC · original
Merged. Thanks, and thanks to ShotTechOp for the original commit. Checked locally on today's
main+428f9419d:claiming: OLD-10063was posted at 09:38 UTC, before this PR, and is unedited. #743 carried the first commit only and was closed as a duplicate of this one.tests/test_xdxr_bvh.py: 47 tests pass onmain, 54 with this PR.tools/xdxr_bvh.py check-build <cases> --rays 1000over the case files that thexdxr_buildandd3d12_xdxr_rttests wrote in two local Wine runs (llvmpipe and an RDNA2 iGPU; four sets, 74 files each run) reports all cases matching, the same asmain's tool on the same files.check_no_game_data.pyon both files andtest_text_write_line_endings. It merges without conflicts.PierreEbele's two notes are fine as follow-ups:
brute_forceis stricter thanbuild_tlason NaN transforms, andvalidateaccepts NaN header bounds.AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).