Skip to content

RT-54: bvh_builder_test uses WARP on NVIDIA; record why the 49th PSO fails - #1089

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
kotorvr:rt-54-bvh-nvidia-pso
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
kotorvr:rt-54-bvh-nvidia-pso

Conversation

@kotorvr

@kotorvr kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

RT-54 from #1006 (finding: @rafaelpssz in #634, reproduced by @Thatters).

On NVIDIA, the package's XboxBvhBuilder constructor dies in CreateComputePipelineState. The cause is the input, not Leonida's proxy: the builder's shaders are Xbox DXIL, which no PC driver has to accept. This PR makes bvh_builder_test get past construction on NVIDIA by using WARP there. It also records why, in shapes and counts only.

Findings (RTX 4090, 621.14, Windows 11 26200, my own 1.0.2.1 copy)

  • Where it fails: device slot 62 is called 49 times. Calls 1–48 return S_OK. Call 49 (a 38,248-byte CS) either returns E_OUTOFMEMORY, which the constructor throws, or ends the process inside the driver. The abort matches @Thatters's report: NVIDIA's LLVM 7.0.1 bitcode reader prints Never resolved value found in function, or Invalid record in their runs, and exits with code 127 here or 0xC0000409 there. It can't be caught, and the D3D12 debug layer prints nothing first.
  • What the proxy passes: the bytecode, unchanged.
  • What the shaders are: all 53 are signed containers with the same 9 parts (SFI0, ISG1, OSG1, PSV0, RTS0, STAT, ILDN, HASH, DXIL), shader model 6.5 / DXIL 1.5. dxil.dll from Windows SDK 10.0.26100 rejects all 53 with 0x80aa0009:
    • every one has target triple dxil-ms-xb2 and xbox.compiler.options metadata;
    • 44 call externals that aren't DXIL functions;
    • 16 use extractvalue on non-DXIL types;
    • 5 use instruction types PC DXIL doesn't allow.
  • What sets test(semantic): add interpreter tests for LDS basic allocation and workgroup bounds #49 apart: it is the only shader with a resource in a function signature (a non-entry function that takes a resource). Shader Index shader hashes and vertex signatures #36 has the same 265 extractvalue errors and is created, so those aren't the trigger.
  • WARP: creates all 53 PSOs; the constructor and destructor return.

Changes

  • bvh_builder_test:
    • On a PCI vendor 0x10DE adapter it switches to WARP and says why. LEONIDA_BVH_HARDWARE=1 keeps the NVIDIA device, to check a newer driver.
    • LEONIDA_BVH_RECORD62=1 now prints each container's shape before the call, so the last line before an abort names the shader.
    • LEONIDA_BVH_DXIL=1 adds counts of dx.op calls and a few type markers from dxcompiler.dll's disassembly in memory, plus dxil.dll's error kinds with quoted text masked. Nothing from the DLL is printed or written: only names of DXIL ops and counts.
  • docs/d3d12_vulkan.md A.2: the NVIDIA results and the cause. The runtime still needs to lower or translate these shaders (section 7.2 / M6) before they can run on hardware.

Unlike a driver workaround in the proxy, this doesn't hide anything from the runtime: the proxy still forwards everything, and the shaders still need a real DXIL path.

Tested

RTX 4090, NVIDIA 621.14, Windows 11 build 26200, MSVC 19.44, Vulkan SDK 1.4.363.0:

  • ctest passes 50/50; bvh_builder skips without a package.
  • bvh_builder_test with my own 1.0.2.1 copy:
    • default: switches to WARP, OK, 0 failures (16x17, 62x53);
    • LEONIDA_BVH_HARDWARE=1: still aborts at call 49, as documented;
    • LEONIDA_BVH_RECORD62=1 LEONIDA_BVH_DXIL=1 on WARP: produced the counts above.

Not tested: AMD Windows 11 hardware. An AMD run would show whether its driver takes all 53.

No game data in this PR or its description: counts, sizes, part names, DXIL op names and a target-triple name only. AI-assisted (Claude Code).

🤖 Generated with Claude Code

…der shapes

The package's 53 compute shaders are Xbox DXIL (target triple dxil-ms-xb2,
xbox.compiler.options metadata; dxil.dll rejects all 53). NVIDIA's DXIL reader
rejects the 49th, the only one with a resource in a function signature, and
either returns E_OUTOFMEMORY or aborts the process inside nvwgf2umx.dll.
The proxy forwards the bytecode unchanged, so the fix is in the test: an NVIDIA
adapter switches to WARP unless LEONIDA_BVH_HARDWARE=1. LEONIDA_BVH_RECORD62
now prints each container's shape before the call, and LEONIDA_BVH_DXIL=1 adds
dx.op counts and masked validator error kinds (names and counts only).

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

@quackottu quackottu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 39d5d0e on NVIDIA GeForce RTX 5070, driver 621.24, Windows 11 Pro (26300), VS 2022 Build Tools, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and LEONIDA_D3D12=vulkan: pass

  • Build ok. ctest: 50/50 (gameinput disabled, no SDL3).
  • bvh_builder_test (changed here): exit 0, SKIP without the game package, so its NVIDIA path wasn't exercised. The first full run had loader fail its Defender-scan timing check and d3d12_fence_timing_test miss calibration, with three builds running at once. Both pass when rerun alone, and neither is touched here.
  • 49 test programs exit 0 with 0 validation messages.
  • Same on main, not from this PR: d3d12_clear_test (NVIDIA 0.5 tie rounding, #521), vk_binary_occlusion_test (needs an input file), and the 3 VUID-vkCreateDevice-ppEnabledExtensionNames-01387 in d3d12_fence_timing_test/d3d12_vulkan_device_test (#1027).

@ItsNotRexed
ItsNotRexed merged commit 6fc7d49 into ItsNotRexed:main Nov 22, 2026
10 of 11 checks passed
@VeTkN

VeTkN commented Nov 22, 2026

Copy link
Copy Markdown

Tested 39d5d0e on RTX 5070 (Blackwell), NVIDIA 621.01, Windows 11 Pro (10.0.26200), MSVC 19.51 (VS 2026 Build Tools), with my own 1.0.2.1 copy: pass.

bvh_builder_test (default):            switches to WARP, OK, 0 failures (16x17, 62x53); constructor and destructor return
bvh_builder_test LEONIDA_BVH_HARDWARE=1 LEONIDA_BVH_RECORD62=1:
                                       calls 1-48 S_OK; call 49 (38,248-byte CS) -> 0x8007000e (E_OUTOFMEMORY),
                                       the constructor throws; no process abort on this driver
ctest:                                 51/51

Same failure point as the RTX 4090 run in the description, now on Blackwell with driver 621.

AI-assisted (Claude).

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.

4 participants