Repository navigation
vk_command_replay_test: cover a subresource copied twice in one list - #891
Conversation
85a1b0c to
3815be2
Compare
|
Rebased onto AI-assisted. |
|
Tested
No game files were used. |
quackottu
left a comment
There was a problem hiding this comment.
Tested 85a1b0c 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
ctest -C RelWithDebInfo: 100% tests passed, 0 tests failed out of 32vk_command_replay_test(changed here): exit=0 validation=0 | G: one subresource copied twice in one list, no validation errors- 32 test programs in the build pass with 0 validation errors
- Not run (they take an input file, not covered here): vk_binary_occlusion_test
d3d12_clear_testfails (R8G8B8A8_UNORM/SNORM 0.5 ties and a D16 clear byte differ from WARP) exactly as onmain4a36bb1 here, so not from this PR; #521 addresses it
Implicit Vulkan layers (overlays) were off through an empty VK_IMPLICIT_LAYER_PATH.
|
Rebased onto
Single commit, unchanged apart from the rebase. AI-assisted. |
3815be2 to
e315e26
Compare
|
A heads-up before anyone tests or merges this head: Your comment above says "single commit, unchanged apart from the rebase", so I'd guess it came in with the rebase rather than on purpose. The PR timeline shows a force-push to AI-assisted (Claude Code). |
copy_layout has to order a transfer write that finds its range already in the transfer layout, because a texture can stay in COPY_DEST and be copied into again; D3D12 orders copies on the queue and needs no barrier from the application. That ordering landed in 5ec780c without a test, and the BC7 copy case in d3d12_vulkan_device_test reaches it: on a tree without it the case reports ten WRITE_AFTER_WRITE hazards under synchronization validation. Part G records two buffer-to-image copies into the same subresource with no transition between them and reads the texture back, so the missing dependency shows up as a validation error and as the wrong texels. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
e315e26 to
033192d
Compare
|
Good catch, and thank you — that second commit was not mine and I have dropped it. The head is now Where it came from: Re-verified after the rewrite, same machine: build clean, Worth testing whenever you have a window — the code has not changed, only the head. AI-assisted. |
|
Thanks for dropping it so quickly, and for tracking down where it came from. Tested
Code read: Part G is the right minimal case. Two buffer-to-image copies into the same subresource with no transition between them make AI-assisted (Claude Code). |
Claimed in the coordination issue as: #634 (comment)
What and why
copy_layouthas to order a transfer write that finds its range already in the transfer layout, because a texture can stay inCOPY_DESTand be copied into again: D3D12 orders copies on the queue and needs no barrier from the application, Vulkan does not. That ordering landed in5ec780cwithout a test, and the path is reachable — on a tree without it, the BC7 copy case ind3d12_vulkan_device_testreports tenWRITE_AFTER_WRITEhazards under synchronization validation (that is what #775 is hitting on my card).This adds Part G to
vk_command_replay_test: one 4x4 RGBA texture, two buffer-to-image copies into the same subresource in a single list with no transition between them, then a readback. The test already fails on any validation error, so the missing barrier is caught directly instead of showing up as hazards in a differential test.No implementation change:
5ec780cis onmainand does the ordering correctly.Tested
RX 7900 XTX (RDNA3, gfx1100), AMD 26.10.1, Vulkan 1.4.359, Windows 11 26200.
LEONIDA_VK_VALIDATION=1 vk_command_replay_test.exe— exit 0,G: one subresource copied twice in one list, no validation errors; the texels read back as the second copy.memory_barrierincopy_layoutdisabled —validation: vkCmdCopyBufferToImage(): WRITE_AFTER_WRITE hazard detected …, 1 validation error, exit 1. So the part fails exactly when the ordering is missing.LEONIDA_VK_VALIDATION=1 ctest --test-dir runtime/build— 31/33 pass. The only failure is the existingd3d12_vulkan_deviceOPTIONS19.SupportedSampleCountsWithNoOutputs: ours 0xf not subset of host 0x1d, which Runtime: OPTIONS19 no-output sample counts are 1/4/8/16 (no 2x) — fixes the red d3d12_vulkan_device_test on AMD #855 addresses and which is unrelated to this change.Refs #775.
Checklist
docs/design.mdcontract-table entry.AI-assisted.