Repository navigation
test: indirect RT scratch size without nested std::max, miscompiled by MSVC 19.52 (TEST-INDIRECT-RT-ARENA) - #954
Conversation
|
Independent Windows check against parent Both memory modes exercised BLAS clone and compaction. Each reported a compacted size of 1,152 bytes and the ray query produced one hit and one miss on both revisions. Core and synchronization validation were active, both test modes reported zero validation errors, and the validation self-test passed. This covers the older compiler. The 19.52-specific failure remains covered by the author's run. Synthetic inputs only. AI-assisted: OpenAI Codex. |
Independent testing resultsTested the indirect ray tracing scratch-size change on NVIDIA Blackwell hardware with Vulkan validation enabled. Both BASE and HEAD exhibit a reproducible RayQueryKHR failure with matching acceleration structure validation diagnostics. Tested revisions
Test environment
Test configuration
Both revisions compiled successfully. Execution logs and run timestamps confirm that tests were executed again during subsequent attempts. CTest results
All 18 CTest process invocations completed with exit code 8 due to the indirect RT test failures. RayQueryKHR failureBoth indirect RT test variants consistently reported:
The failure reproduced in all 36 executions of the two indirect RT tests across BASE and HEAD. Acceleration structure validationThe failing tests reported:
Representative diagnostic: The validation layer reports invalid acceleration structure references in the instance geometry passed to
The same diagnostic category and functional failure were present on both revisions. The exact root cause of the invalid acceleration structure references was not established during this verification. Upload heap configurationsThe failure reproduced with both upload heap configurations:
Consequently, the observed failure was not limited to the VRAM upload heap configuration. Successful subchecksDespite the overall indirect RT test failures, the following subchecks passed consistently: The recorded compaction size results remained identical between BASE and HEAD. No scratch-buffer GPU address arena exhaustion diagnostic matching the original reported failure was identified in the examined logs. Compiler-specific limitationThe compiler used here was MSVC 19.44.35230. This differs from MSVC 19.52.37029, which is associated with the nested Therefore, these results do not independently reproduce or confirm the original compiler-specific fix. Synchronization validationAll The expected intentional ConclusionResult: FAIL on both revisions — no new failure introduced by HEAD was identified in the tested scenarios. The indirect ray tracing tests consistently failed on both BASE and HEAD due to a RayQueryKHR output mismatch accompanied by invalid acceleration structure reference validation diagnostics. The original compiler-specific scratch-size issue could not be independently verified with this MSVC version. The acceleration structure reference issue appears to warrant separate investigation. Testing with the affected MSVC 19.52 toolchain would be required to directly verify the intended fix. Testing was limited to one NVIDIA GPU, synthetic fixtures and validation-enabled execution. No real-title testing was performed. AI-assisted log analysis and report preparation. |
2bd7953 to
d6b40a0
Compare
|
Rebased on CI. The failed run built this branch on
Both are in the new base. The new CI run has not finished, so this is read from the logs and those changes. @Timon360SB's report (thanks). The RayQueryKHR miss and the four Rerun on Windows 11, MSVC 19.52.37029 (
AI-assisted: yes (Claude Code). |
…EST-INDIRECT-RT-ARENA)
d6b40a0 to
f4fc762
Compare
Merging. **Why merged:** RT-4444-TARGET: where the device can't use a 4444 format as a colour attachment (NVIDIA), a B4G4R4A4 render target becomes an RGBA8 image. Its T#s keep the 4_4_4_4 format, and PSO RTV formats follow the image. Before this, the render target couldn't be created at all (size UINT64_MAX). sodove (5070 Ti) and SweatierKey approved. **Why it's good:** The new d3d12_b4g4r4a4_target really runs here (not skipped): "B4G4R4A4_UNORM ... using RGBA8", OK, 0 validation errors. b5g5r5a1_uav, srgb_uav and vulkan_device also pass. **Follow-up, not a blocker:** sodove measured that the RGBA8 fallback stores clears at 8-bit precision instead of quantising to 4 bits (0/1920 texels matched WARP's 4-bit result), and buffer-footprint copies from it move 4-byte texels (documented in the code). Quantising on clear and store would close that gap. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: ProjectLeonida#517, ProjectLeonida#907, ProjectLeonida#927, ProjectLeonida#954 and ProjectLeonida#1074 merged onto main 32a5d96 (after aslan2142's runtime merges). There the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The 2 failures are d3d12_depth_resolve (pre-existing) and d3d12_close_parity, which fails on plain 32a5d96 too: a regression from ProjectLeonida#510, reported there, not from these PRs. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Merging. **Why merged:** VK-UAV-CLEAR-PACK16: B5G6R5, B5G5R5A1 and B4G4R4A4 join the UAV-clear layout table, with conversion checks and an exhaustive 65,536-word round trip. Timon360SB (2060S and 5070, 60/60) and SweatierKey approved. The current head b67109e is a content-identical rebase of the reviewed one. **Why it's good:** uav_clear, short_uav_clear, b5g5r5a1_uav and replay_uav_clear_offset all pass both plain and under validation. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #517, #907, #927, #954 and #1074 merged onto main 32a5d96 (after aslan2142's runtime merges). There the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The 2 failures are d3d12_depth_resolve (pre-existing) and d3d12_close_parity, which fails on plain 32a5d96 too: a regression from #510, reported there, not from these PRs. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Merging. **Why merged:** RT-TITLE-HOST-REGION: a test-only probe that imports a 185 MiB host region as a BDA buffer through VK_EXT_external_memory_host and checks coherence both ways. A machine that can't import exits 77 (skip). No runtime source changes. Timon360SB, madhyn (3060 Ti/Wine) and SweatierKey approved. **Why it's good:** vk_host_region_import and its _validation variant: "185 MiB imported ... cpu-gpu-coherence=ok", 0 validation errors. Nit for a follow-up: the _validation test sets VK_VALIDATE_SYNC=1, which nothing in the tree reads; if sync validation is the goal, the Khronos layer setting is spelled differently, so that variant probably runs core validation only. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #517, #907, #927, #954 and #1074 merged onto main 32a5d96 (after aslan2142's runtime merges). There the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The 2 failures are d3d12_depth_resolve (pre-existing) and d3d12_close_parity, which fails on plain 32a5d96 too: a regression from #510, reported there, not from these PRs. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
|
Merging. Why merged: TEST-INDIRECT-RT-ARENA: d3d12_indirect_rt_test replaces a nested std::max with an initializer-list std::max to work around an MSVC 19.52 miscompile. It's 6 lines. sodove passed both revisions, and the current head is a content-identical rebase. Why it's good: indirect_rt and indirect_rt_upload_sysmem: PASS with 0 validation errors, and the RayQuery got hit=1 here under validation. Timon360SB's hit=0 on a 5070 with GPU-assisted validation shows up on the base too, so it isn't this PR. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #517, #907, #927, #954 and #1074 merged onto main 32a5d96 (after aslan2142's runtime merges). There the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The 2 failures are d3d12_depth_resolve (pre-existing) and d3d12_close_parity, which fails on plain 32a5d96 too: a regression from #510, reported there, not from these PRs. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5). |
Merging. **Why merged:** RT-INPUT-SCRIPT-LENGTH: the shim's env() reader now handles values of any length (64 characters or more used to read as unset). The PR also adds the LEONIDA_INPUT_SCRIPT keyboard-pad scheduler (`button@seconds`, 300 ms presses), documented in docs/gameinput.md. That's a second topic, but the body says so, and both parts were reviewed. sodove checked 14/14 runs across lengths, with the control failing 12/12, and kawaii-shakal's harness follow-ups were addressed. **Why it's good:** gameinput_host, gameinput and the new gameinput_script pass; with validation, gameinput_script passes and logs "8 accepted / 11 rejected". The parsing is bounded (strtod with end-pointer and finiteness checks) and reads only its own env var. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #517, #907, #927, #954 and #1074 merged onto main 32a5d96 (after aslan2142's runtime merges). There the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The 2 failures are d3d12_depth_resolve (pre-existing) and d3d12_close_parity, which fails on plain 32a5d96 too: a regression from #510, reported there, not from these PRs. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Claimed in the coordination issue as: TEST-INDIRECT-RT-ARENA
What and why
d3d12_indirect_rtandd3d12_indirect_rt_upload_sysmemstopped atGPU address arena full ... buffer size in KiB: 105903andFAIL: CreateCommittedResource(compaction/clone buffers)on an RTX 3080.The sizes are not the problem. Printed on that GPU, in bytes (hex, result/scratch): BLAS
a00/200, TLAS800/300, the compaction BLAS from the layera00/200, and fromvkGetAccelerationStructureBuildSizesKHRb00/500. The compaction scratch buffer should be0x600bytes.The cause is the compiler. MSVC 19.52.37029 (toolset 14.52) at
/O2 /Ob1compiles the test'sto this.
_Right$is meant to hold the inner result, but nothing inmainstores it under that name. It shares its stack slot withtv7896, the savedvkDestroyDevicepointer. The code loads that pointer and reads the first eight bytes of the function as the size:That value is not a size, so
arena_allocaterefused it for being larger than the arena. The message prints the size throughint(Width / 1024), so105903may be truncated.The fix takes the maximum of the three values with one
std::maxover a list (and includes<algorithm>for it). The layer and the arena allocator are unchanged. Nothing is skipped.Tested
Windows 11, MSVC 19.52.37029 (
RelWithDebInfo).After the rebase on
main6293c1c (d6b40a0a, same patch as2bd79535). The head is nowf4fc7623on 58be9cd, with the same patch;runtime/onmaindid not change between the two, so these were not rerun:main, both tests fail witharena full ... buffer size in KiB: 105903. With this commit both pass, 4 runs out of 4.ctest -j 1 --timeout 300: 259 passed, 1 failed, 12 skipped,gameinputdisabled. The failure isd3d12_execute_indirect_validation, also failing in the first run below (d3d12: ExecuteIndirect accepts the argument ranges newer D3D12 runtimes accept (D3D-EXECIND-RANGE-CARRY) #1066 is open for it). The skipped tests are the 12 listed below.First run, on
maina289278:LEONIDA_ARENA_LOG=1the first allocation after the RT buffers is0x600bytes, as expected.cmovb. Compiled with 14.52 and linked the same way, it fails. Adding only aprintfof the values after the calculation also made the 14.52 build pass, so the failure depends on the surrounding code.gta6rt_d3d12_comsources, built with the same flags, have nocmovfrom a_Left$/_Right$slot that is never stored.<algorithm>: pass.ctest -j 1 --timeout 300: 257 passed, 1 failed, 12 skipped (the log of the baseline f3e26be: 255 passed, 3 failed, 12 skipped). The only failure isd3d12_execute_indirect_validation, which also fails in the baseline and is known (d3d12_execute_indirect_validation_test: handle Windows 11 26300 relaxed max=0 and padded-stride bounds #306, d3d12_execute_indirect_validation_test: handle Windows 11 26300 relaxed max=0 and padded-stride bounds (OLD-10041) #749). Every other result is unchanged. Skipped, as in the baseline (the run predates the<algorithm>line):shader_library_corpus,bink_decode,bink_abi,bink_play_headless,fsr_dispatch,bvh_builder,bink_audio,vk_sync_validation,d3d12_sparse_queue_family_contract,d3d12_rgb9e5_rtv,d3d12_boot_movie,d3d12_first_light. Disabled:gameinput.git diff --checkandpython -I scripts/check_no_game_data.py runtime/test/d3d12_indirect_rt_test.cpp: clean.No CPU regression: the fault is in the code the compiler makes for this function, and a small standalone copy of the calculation, built with the same options, does not reproduce it.
With GPU-assisted validation on, the RayQueryKHR check misses on
mainand on this branch alike, with fourVUID-vkCmdBuildAccelerationStructuresKHR-pInfos-12281reports; #710 describes the same result and covers the addresses. It is a separate topic and was not rerun here.Not covered: the parts of these tests that need
glslangValidator(the drawing andRayQueryKHRchecks) are not built on this PC, the validation layer was off, GCC and Clang were not used. Whether other MSVC 14.52 builds have the same fault elsewhere was only checked in the files above.GPUs tested: NVIDIA GeForce RTX 3080, driver 621.24, Windows 11
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)