Skip to content

tests: cs_bvh16, image_bvh64_intersect_ray on a BOX16 node on the GPU - #7377

Open
iLucasRT wants to merge 2 commits into
ItsNotRexed:mainfrom
iLucasRT:cs-bvh16-gpu-test
Open

iLucasRT wants to merge 2 commits into
ItsNotRexed:mainfrom
iLucasRT:cs-bvh16-gpu-test

Conversation

@iLucasRT

Copy link
Copy Markdown

Claimed in the coordination issue as: SHADER-1136

Depends on: none. It conflicts in docs/design.md with #5887 (the image_bvh row); whichever lands second rebases.

What and why

The XDXR builder writes BOX16 nodes for MINIMIZE_MEMORY builds, but the translator's image_bvh on a BOX16 node had
no GPU test: cs_bvh and cs_bvh32 use a BOX32 root. cs_bvh16 runs cs_bvh's scene with its root as BOX16 (six halves
per child at 16 + 12 i). Its z=5 child has a +inf max.x, the bound the builder writes past the half range, and its
last box a half NaN min.x. It must return cs_bvh's eight words: 0x68 0x48 0x40 0xffffffff, then -10 -1 -0.25 -0.25.

vk_compute_test takes "bvh16" for that scene. check.py and run_gpu_tests.py run it, and the image_bvh row of
docs/design.md names it.

Tested

Tested on an AMD Radeon RX 7900 XTX (Windows 11, driver 32.0.32029.2010): cs_bvh, cs_bvh16 and cs_bvh32 pass.
Re-run after merging main 0c46fa1: the three pass again, and tests/test_run_gpu_tests.py and the tests/test_docs_*.py
checks pass.

AI-assisted: yes (Claude)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No new translator rule in this PR.)

🤖 Generated with Claude Code

iLucasRT and others added 2 commits November 23, 2026 12:35
The XDXR builder writes BOX16 nodes for MINIMIZE_MEMORY builds, but the translator's image_bvh on a BOX16 node had
no GPU test: cs_bvh and cs_bvh32 use a BOX32 root. cs_bvh16 runs cs_bvh's scene with its root as BOX16 (six halves
per child at 16 + 12 i). Its z=5 child has a +inf max.x, the bound the builder writes past the half range, and its
last box a half NaN min.x. It must return cs_bvh's eight words: 0x68 0x48 0x40 0xffffffff, then -10 -1 -0.25 -0.25.

vk_compute_test takes "bvh16" for that scene. check.py and run_gpu_tests.py run it, and the image_bvh row of
docs/design.md names it.

Tested on an AMD Radeon RX 7900 XTX (Windows 11, driver 32.0.32029.2010): cs_bvh, cs_bvh16 and cs_bvh32 pass.
AI-assisted (Claude).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in run_gpu_tests.py: main reports compute results through compute_result() now; cs_bvh16 joins cs_bvh and cs_bvh32 there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dadsmallbuk1

Copy link
Copy Markdown

Tested 216f4d0 on NVIDIA GeForce RTX 5090 (subgroup 32), driver 617.42, Windows 11 (26200), native MSVC 2022 RelWithDebInfo, llvm-mc 21.1.8 (AMDGPU): pass.

  • scripts/run_gpu_tests.py --filter cs_bvh: 3/3 pass: cs_bvh, cs_bvh32 and the new cs_bvh16. So the BOX16 root (the +inf max.x past the half range and the half-NaN min.x) gives cs_bvh's eight words on NVIDIA too.
  • Code read: a new fixture and its check.py row. vk_compute_test gains a bvh16 mode that writes the four BOX16 children as halves at 16 + 12 i, and the bvh path is unchanged.

AI-assisted (Claude Code).

@ErayOzdayioglu

Copy link
Copy Markdown

Tested 216f4d0 on an RDNA2 GPU (the runs above were RDNA3 and Blackwell) plus a second NVIDIA card. Windows 11 26200, MSVC 14.51 (VS 2026), Vulkan SDK 1.4.363, llvm-mc 23.1.6. vk_compute_test was built from this head, since it gains the bvh16 scene. pass

run_gpu_tests.py --filter cs_bvh: 3/3 translated and spirv-val-valid, and cs_bvh, cs_bvh16, cs_bvh32 all PASS in each of these four runs:

GPU native LEONIDA_W64_EMULATE=1
Radeon iGPU, Ryzen 5 7600 (RDNA2, subgroup 32..64, AMD 32.0.21042.62) 3/3 3/3
RTX 5070 (617.42, subgroup 32) 3/3 3/3

So the BOX16 root, with the +inf max.x child and the half-NaN min.x box, gives cs_bvh's eight words on this AMD driver too.

AI-assisted: yes

@umnitus

umnitus commented Nov 23, 2026

Copy link
Copy Markdown

Independent Windows GPU check at 216f4d0 on RTX 3060 12 GB, NVIDIA 621.14, with same-head harnesses built using clang-cl/xwin. run_gpu_tests.py --filter cs_bvh translated and passed spirv-val for 3/3 shaders. cs_bvh, cs_bvh16, and cs_bvh32 all passed (3/3, no skips). The completed run used Vulkan runtime validation off. AI-assisted testing.

@moldyharriet

Copy link
Copy Markdown

Tested 216f4d047918b5f8b2ebdffacf66e6a644c829ff on CachyOS with an RX 7800 XT (RADV, Mesa 26.3.1-arch3.4).

scripts/run_gpu_tests.py --filter cs_bvh --require-pass: 3/3 passed (cs_bvh, cs_bvh16, cs_bvh32). All three shaders translated and passed spirv-val.

AI-assisted testing with Codex. Handwritten fixtures only.

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.

5 participants