Repository navigation
d3d12_copy_fuzz_test: random copy programs against WARP, every byte compared (shows #4997's hazard on NVIDIA) - #5272
Exopus-0x65f7ad0 wants to merge 2 commits into
Conversation
…ry byte compared Each program runs CopyBufferRegion, CopyTextureRegion (buffer to texture, texture to buffer, texture to texture, with boxes) and CopyResource over two buffers and three textures of one of 12 formats (BC1/3/7 among them, mips and arrays), with no barrier between back-to-back copies on a resource that stays in COPY_DEST or COPY_SOURCE. Every byte is read back and compared with WARP, which keeps program order; NVIDIA's own D3D12 driver (621.14) does not for a texture-to-buffer copy followed by an overlapping CopyBufferRegion, so it is only an option (--hardware). --reduce SEED shrinks a failing program. On main, 300 seeds match WARP; under synchronization validation they report 10 write-after-write hazards between buffer copies, which ItsNotRexed#4997's barriers remove. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
AI-assisted. At a1110cc, a missing seed count can make an automated run pass without testing any copies. Run I also ran the default 30 seeds against WARP on Windows 11 with |
|
Tested a1110cc (merged on
I didn't get the #4997 row: #4997 conflicts with this branch in |
…f running 0 seeds A count option (--seeds, --start, --ops, --cases, --reduce, --queues) now needs decimal digits that fit in 32 bits. A missing value, the next option, "-1" or "12x" exits 2 with a usage message. Before, "--seeds --verbose" read as 0 seeds and exited 0 without testing anything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@shdann thanks, confirmed and fixed in |
|
Tested 1f91eef (based on
|
|
Tested
Device lines from the run: The AI-assisted. No game data. |
Kam471
left a comment
There was a problem hiding this comment.
Reviewed 1f91eef (2 commits; the argument parsing is in 1f91eef). Built target d3d12_copy_fuzz_test with vcvars64/Ninja, RelWithDebInfo, Vulkan 1.4.363; no warnings.
On Windows 11, RTX 5070 Ti (LEONIDA_VK_DEVICE='RTX 5070 Ti'):
d3d12_copy_fuzz_test.exe(default 30 seeds) -> "copy fuzz (layer against WARP): 30 seeds, 0 differ", exit 0.ctest --test-dir build-5272 -R "^d3d12_copy_fuzz$"-> 1/1 passed (1.24 s).--hardware --seeds 2-> 2 seeds, 0 differ, exit 0.--seeds/--seeds 12x-> exit 2, "needs a decimal count";--start 4294967295 --seeds 2runs seeds 4294967295 and 0, exit 0;--reduce 1-> "seed 1 does not differ from WARP", exit 0.LEONIDA_VK_VALIDATION=1 --seeds 10-> 10 seeds, 0 differ, and the expected SYNC-HAZARD-WRITE-AFTER-WRITE messages (the #4997 gap); the ctest entry does not count them, as stated.git diff --check-> clean.
Verdict: passes; no blockers. Overlap: byte-exact pass on GPUs whose driver does not serialize these copies depends on #4997.
|
Tested a1110cc on RTX 3060, driver 617.14, Windows 11, MSVC 14.44 RelWithDebInfo: pass
One note: the hazard reproduces on driver 617.14 too, while the test header pins it to 621.14 - same bug class, just rarer; the wording could say "621.14 and 617.14" or "617.14+". Also worth documenting that the demonstration needs AI-assisted. |
Claimed in the coordination issue as: a new TEST item (claim).
Depends on: none. It complements #4997: this test passes on
mainand with #4997, and withLEONIDA_VK_VALIDATION=1it is what shows #4997's hazard on NVIDIA.What and why
d3d12_copy_fuzz_testruns seeded random copy programs on the layer and on WARP, and compares every byte of every resource afterwards.CopyBufferRegionat any offset and size;CopyTextureRegionbuffer→texture and texture→buffer through placed footprints, with block-aligned boxes;CopyTextureRegiontexture→texture between subresources;CopyResourcebetween two textures of the same description.COPY_SOURCEandCOPY_DEST. Back-to-back copies on a resource that stays in one state get no barrier, so they must run in program order.Why WARP and not the GPU's D3D12: NVIDIA's driver (621.14) does not keep program order for a texture→buffer copy followed by an overlapping
CopyBufferRegionwith no barrier between them. WARP and the layer do. I computed the expected bytes from the fill pattern to confirm which side is right; details on #4997.--hardwarecompares with the GPU's D3D12 anyway.--reduce SEEDdrops copies and list breaks while the layer still differs, and prints the smallest program left. That is how this program was found:Results
RTX 5060 Ti / 621.14,
LEONIDA_VK_VALIDATION=1(synchronization validation on):main3faac557vkCmdCopyBuffer↔vkCmdCopyImageToBuffer)13a9d807ctest runs 30 seeds (about 30 s) and doesn't count validation messages. The hazard needs the validation layer to be seen on this card, because the NVIDIA Vulkan driver happens to serialize these copies. A GPU that doesn't serialize them, such as the RX 9060 XT in #4997, fails on bytes.
Tested
LEONIDA_VK_VALIDATION=1 ctest -j4: 168/168 pass, 0 VUIDs.--hardware --seeds 1 --start 287reports the NVIDIA D3D12 difference described above, and--hardware --reduce 287shrinks it to the 3-copy program.--start 4294967295 --seeds 2runs seeds 4294967295 and 0: the seed count is counted from zero, as on d3d12: GetCopyableFootprints refuses what the PC runtime refuses (found by a host/WARP differential fuzzer) #5218.Same host/WARP differential approach as #5180 (fences), #5218 (
GetCopyableFootprints) and #5239 (CPU-heap buffers). AI-assisted (Claude Code). Synthetic data only, no game files.🤖 Generated with Claude Code