Repository navigation
XDXR builder follow-up: small-build sort, and MSVC C4456 in vulkan_replay.h (D3D-178) - #1743
Conversation
…R one Two `const auto* build` in one else-if chain: the second hides the first and MSVC /W4 warns (C4456) in every file that includes the header (reported by @zneel on ItsNotRexed#1667). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The radix sort's fixed latency dominated small builds (2,000 triangles: 0.81 ms with the sort, 0.08 ms without, on an RTX 2050; the 10k regression @exhawk measured on ItsNotRexed#1572). Up to 1,024 keys are now sorted in one workgroup's shared memory (bitonic, ties by element index: the stable order; 8 KiB, within the 16 KiB minimum with the radix arrays), and the radix tiles are 256 elements (4 chunks instead of 32 per workgroup). RTX 2050: 1,000 triangles 0.24 ms, 2,000 0.28 ms (0.83), 10,000 0.38 ms (0.81), 100,000 2.3 ms (2.5); 1M 21.9 ms (20.3, the larger scan). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Flyander
left a comment
There was a problem hiding this comment.
Revu le head fa2712e. Le tri bitonique garde un ordre stable via l’indice en départage et le padding à une puissance de deux est sûr puisque les clés Morton restent sur 30 bits. Le seuil 1 024 et les tailles partagées respectent la limite device indiquée; la régression mesurée sur gros builds est documentée, et les runs RTX/Iris/llvmpipe rapportent zéro rayon divergent. Checks CI en attente.
|
Tested fa2712e on AMD Radeon RDNA2 iGPU (Ryzen 9 9950X3D, driver 26.10.1, subgroup 32..64) and NVIDIA RTX 5080 (616.92), Windows 11 with MSVC (RelWithDebInfo, glslang from a local install): pass on both.
AI-assisted. |
|
Tested Median BLAS build time fell by 56.7% at 10,000 triangles and rose by 12.2% at 2,000,000.
Each pair ran the stock harness once per commit, with each commit going first equally often. Each invocation warmed up once and reported its best of three wall-clock builds, including submission and wait. Validation was off for timings.
Synthetic inputs only. AI-assisted (Codex). |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested fa2712e on NVIDIA GeForce RTX 5090 (driver 621.24), Windows 11 Pro build 10.0.26300.9974 (26H2), MSVC 14.51.36231 with Visual Studio 18 BuildTools, RelWithDebInfo, Vulkan SDK 1.4.363.0: pass, and this is the first runtime build I have seen with no C4456 anywhere. What I ran, from the PR head
The include check @Vonsek could not run (glslc is installed on this machine):
Read of the shader change: padding to the next power of two writes AI-assisted review. |
|
Tested fa2712e on Windows 11 (26200), MSVC 19.4x (VS 2022 Build Tools), Ninja RelWithDebInfo: pass on both GPUs of a two-GPU PC.
No game files. AI-assisted check (Claude Code), Vonsek3. |
…ulkan_replay.h) The test's global `constexpr UINT extent = 64` is hidden by a local `extent` in runtime/src/vulkan_replay.h, so every MSVC build of the runtime prints `warning C4459: declaration of 'extent' hides global declaration`. It came in with #907, whose earlier fix renamed the global `size` to `extent` for the same reason. The global is now `target_extent`, a name nothing under runtime/ uses; the test is otherwise unchanged. Tested on Windows 11 Pro 25H2, MSVC 14.51 + Ninja (scripts/build_runtime.ps1), RTX 5070 Ti / 621.24: the build has no C4459 (main's 49x C4456 in vulkan_replay.h remain; #1743 handles them). d3d12_translated_draw_test passes with validation off and on: three draws, 4064/4096 exact, 32 edge pixels, 0 VUIDs. Full ctest with validation: 106/107; the one failure is d3d12_draw's bundle-blend check, which fails on main too (#1793). No game files. AI-assisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Item: D3D-178 (#313), a follow-up to #1572 and #1667. The 13:35 merge round took those two at their older heads (51a0281 and 1c58d6c). These are the two commits that came after, rebased onto
main89b047c.1. MSVC C4456 in
vulkan_replay.h(6e8a140)emithad twoconst auto* build = std::get_if<BuildAccelerationStructure>(&command)in oneelse ifchain. The second hides the first, and MSVC/W4warns in every file that includes the header (reported by @zneel on #1667). The XDXR branch's binding is nowxdxr_build. No behaviour change.2. Small builds: one-workgroup sort, 256-element radix tiles (fa2712e)
The radix sort's fixed latency dominated small builds. This is the 10k regression @exhawk measured on #1572 (0.44 → 0.63 ms on an RTX 3090 Ti). On an RTX 2050, 2,000 triangles took 0.81 ms with the sort and 0.08 ms without it.
RTX 2050, best of 3, device-local memory:
Large builds lose about 8%, because the digit-count scan grows with the tile count. Small and medium builds are the ones a game rebuilds every frame, so the trade favours them. A 512-element tile gave 0.45 ms at 10k and 21.2 ms at 1M, if a reviewer prefers the other balance. The 5,000-triangle case now spans 20 radix tiles, and the 1,000-triangle cases take the shared-memory path.
Tested (Fedora 44)
xdxr_buildand its check give 0 differing rays.xdxr_build,d3d12_xdxr_rt(with their checks) andd3d12_indirect_rtpass on both GPUs.main(fsr_dispatchandbvh_builderare the clang 22.1.8 crash;device_proxy,d3d12_presentandd3d12_indirect_zerofail onmainunder Wine too).python -I tests/test_xdxr_bvh.pyOK, andxdxr_build.incmatchesglslc --target-env=vulkan1.2 -O -mfmt=c xdxr_build.comp.No game files. AI-assisted (Claude Code).
🤖 Generated with Claude Code