Repository navigation
d3d12: SYNC_COPY waits for the CLEAR stage too, ordering WriteBufferImmediate before copies (OLD-10048) - #751
Conversation
An enhanced barrier's D3D12_BARRIER_SYNC_COPY mapped to VK_PIPELINE_STAGE_2_COPY_BIT only. Two D3D12 copy-scope commands are not Vulkan copies: WriteBufferImmediate is recorded as vkCmdUpdateBuffer and ResolveQueryData's never-written queries as vkCmdFillBuffer, and synchronization2 runs both in the CLEAR stage. A SYNC_COPY barrier after either therefore did not order it, and a copy after the barrier could read the word before the write landed. vulkan_sync now maps SYNC_COPY to COPY | CLEAR. vk_command_replay_test part K records WriteBufferImmediate, a SYNC_COPY -> SYNC_COPY buffer barrier and a CopyBufferRegion of the written word; under LEONIDA_VK_VALIDATION=1 it is a read-after-write hazard without this change. d3d12_state_map_test and docs/d3d12_vulkan.md follow the new mapping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independently reviewed Applying the new part K regression test to the base reproduces the The updated stage mapping is consistent across global, buffer and texture barriers, and the transfer-only queue mask remains intact. Full suite: 70 passed, 1 skipped, 1 failed. The No regressions found. LGTM. |
Independent verification — Turing and BlackwellBaseline: PR head: Environment
Synchronization validation enabled. Three repetitions per revision on each GPU. Results
Total: 36 CTest executions — 24 passed, 12 failed, 0 skipped. Part K results are included in the Targeted verificationAll six HEAD executions successfully completed the new part K: The updated state-map checks also passed on both architectures. All 12 synchronization validation positive controls passed. Existing failuresThe overall
Each execution reports 10 instances, subject to the validation layer's duplicate message limit. Parts H and I report validation errors on both revisions. Conclusion
Synthetic fixtures only. No game files used. AI-assisted test automation and result analysis. |
SweatierKey
left a comment
There was a problem hiding this comment.
Independent Windows 11 + NVIDIA GeForce RTX 5070 Ti (driver 616.92) verification applied cleanly on main@d0da7dade (portable clang-cl 23.1.6 + Windows SDK 10.0.26100):
d3d12_state_map_test.exe: PASS (RC=0, confirmsSYNC_COPYmaps toCOPY | CLEAR).vk_command_replay_test.exeon RTX 5070 Ti: PASS (RC=0, Parts A–K including new Part K orderingWriteBufferImmediate/vkCmdUpdateBufferbeforeCopyBufferRegion).python3 -I scripts/check_no_game_data.py: PASS.
Clean, minimal fix; no game data. AI-assisted: yes.
Merging. **Why merged:** D3D-CLEAR-DEPTH-RANGE: enables VK_EXT_depth_range_unrestricted where the device has it, so depth clears outside [0,1] (and NaN) behave like D3D12 instead of being clamped. Without the extension it keeps clamping, and NaN becomes 0. Four independent passes; on AMD (660M, 7900 XTX), d3d12_clear still fails only on the NaN rows, which is the driver issue tracked in #307, not this PR. **Why it's good:** On the 4070 SUPER with validation on, main's d3d12_clear_test exits 1 with 4x VUID-VkClearDepthStencilValue-depth-00022. With this PR it exits 0 with no VUIDs, and the 1.5 / -0.5 / NaN clears match WARP. The new d3d12_clear_restricted_depth passes, and so do d3d12_clear and d3d12_clear_formats. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 3295055, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e2: no conflicts, and none of these touch the files #891/#882 changed. 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-SAMPLER-UNNORM-BIAS: an unnormalized-coordinates sampler gets mipLodBias 0, which VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01074 requires. kawaii-shakal ran it under ASan/UBSan and showed the new check fails on main. **Why it's good:** gfx10_descriptors and d3d12_descriptor 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 3295055, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e2: no conflicts, and none of these touch the files #891/#882 changed. 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: OLD-10048: SYNC_COPY maps to COPY|CLEAR, so WriteBufferImmediate (vkCmdUpdateBuffer) and the query zero-fill are ordered before later copies. moffington reproduced the read-after-write hazard on the base, and Timon360SB and SweatierKey checked it independently. Part K of vk_command_replay_test covers it. Why it's good: vk_command_replay, d3d12_state_map and replay_query_edges 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 3295055, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e2: no conflicts, and none of these touch the files #891/#882 changed. 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). |
…dup-wait Merging. **Why merged:** RT-RETIRE-TICKETS-DEDUP-WAIT: pending_through() merges entries per semaphore to the highest value, and completed_ can no longer move backwards. moffington (ASan/UBSan, with a differential test that fails on the base), Timon360SB, KernelSmoker and SweatierKey checked it independently. **Why it's good:** retire_tickets passes 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 3295055, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e2: no conflicts, and none of these touch the files #891/#882 changed. 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).
Restore old upstream PR 10048 (OLD-10048 / D3D-838).
An enhanced barrier's D3D12_BARRIER_SYNC_COPY mapped to VK_PIPELINE_STAGE_2_COPY_BIT only. Two D3D12 copy-scope commands are not Vulkan copies: WriteBufferImmediate is recorded as vkCmdUpdateBuffer and ResolveQueryData's never-written queries as vkCmdFillBuffer, and synchronization2 runs both in the CLEAR stage. A SYNC_COPY barrier after either therefore did not order it, and a copy after the barrier could read the word before the write landed.
vulkan_sync now maps SYNC_COPY to COPY | CLEAR. vk_command_replay_test part K records WriteBufferImmediate, a SYNC_COPY -> SYNC_COPY buffer barrier and a CopyBufferRegion of the written word; under LEONIDA_VK_VALIDATION=1 it is a read-after-write hazard without this change. d3d12_state_map_test and docs/d3d12_vulkan.md follow the new mapping.
Clean-room verified; zero game data.