Repository navigation
d3d12: GetCopyableFootprints refuses what the PC runtime refuses (found by a host/WARP differential fuzzer) - #5218
Conversation
…refuses, found by a footprint fuzzer d3d12_footprint_fuzz_test asks the layer, the host adapter and WARP about seeded random descriptions and compares where the two hosts agree. On main, about 930 of 20,000 descriptions per seed got footprints the host refuses. Over 49,739 descriptions (RTX 5060 Ti 621.14 and WARP agree on all but two), neither host ever accepts: - ALLOW_DEPTH_STENCIL on a buffer, or on a format outside the R32G8X24, R32, R24G8 and R16 families; - an extent past 16384 (1D, 2D) or 2048 (3D); - a block-compressed 1D texture; - a 3D texture in the R32G8X24 or R24G8 families, D32_FLOAT or D16_UNORM. footprint_refused() checks those. The fuzzer runs in ctest: the layer answering where the host refuses, or answering differently, fails it; the layer refusing where the host answers is printed as a gap. Volume subresources of 4 GiB or more are skipped: the PC runtime wraps their offsets at 32 bits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heir typeless family R32_FLOAT_X8X24_TYPELESS and X32_TYPELESS_G8X24_UINT lay out as R32G8X24_TYPELESS, R24_UNORM_X8_TYPELESS and X24_TYPELESS_G8_UINT as R24G8_TYPELESS (two planes), as on the host adapter and WARP; the layer refused them. d3d12_footprint_fuzz_test's gaps go from about 250 to about 50 per 20,000 descriptions (the rest are video and palette formats), with none wrong. --gaps now also prints the host's answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kam471
left a comment
There was a problem hiding this comment.
Built and ran d3d12_footprint_fuzz_test at 21254166c on Windows 11, RTX 5070 Ti: exit 0 — footprint fuzz (NVIDIA GeForce RTX 5070 Ti and WARP): 19906 descriptions, 0 wrong, 51 gaps (the layer refuses), 0 where the two hosts disagree, 1 where the host wraps a 4 GiB subresource; git diff --check clean.
The differential fuzzer drives GetCopyableFootprints over 19,906 descriptions and compares the layer with the host and WARP; none of the 19,906 answers is wrong, the 51 refusals are the layer's documented gaps, and the two hosts never disagree. The change lays out depth-stencil view formats as their typeless family, which is what the host does, and the one 4 GiB wrap is the host's own behavior. No blocking issue.
|
At 2125416, the last valid unsigned seed produces a false pass. AI-assisted review on Windows 11. Run For comparison, seed 1 ran on both the RTX 4090 and the AMD Radeon iGPU as the Vulkan device. The native D3D12 references were the RTX 4090 and WARP in both runs. Each run reported 19,906 descriptions, 0 wrong answers, 51 gaps, and 1 skipped host size wrap. The same test built against merge base 3faac55 reported 939 wrong answers on the RTX 4090 and exited with code 1. |
|
Relation to #4533 (query sweep): that PR's grid found no footprint value difference and counts a layer refusal as a gap. The same is true here, since every footprint the layer answers matches. What this PR adds is the opposite direction, which a grid of engine-style descriptions rarely reaches: the layer answering descriptions both hosts refuse (depth flag on colour formats and buffers, extents past the limits, BC 1D, 3D depth families). The two touch different methods ( |
|
Tested 2125416 on NVIDIA GeForce RTX 4080, driver 617.42: d3d12_footprint_fuzz_test with its default arguments exits 0 and prints "footprint fuzz (NVIDIA GeForce RTX 4080 and WARP): 19906 descriptions, 0 wrong, 51 gaps (the layer refuses), 0 where the two hosts disagree, 1 where the host wraps a 4 GiB subresource". d3d12_vulkan_device_test also exits 0, and it prints no check summary on a pass. The five-seed comparison from the description was not run, only the default seed, and the build is clang-cl rather than MSVC. AI-assisted. |
|
Verified on Windows 11, MSVC v17.14 (BuildTools), Vulkan SDK 1.4.363.0, NVIDIA GeForce RTX 4060 Ti (16 GB) with WARP host reference:
Also confirmed @shdann's edge case with for (unsigned i = 0; i < seeds; ++i) {
const unsigned seed = start + i;
std::mt19937_64 rng(seed);Overall looks solid and ready to land once the loop bound is adjusted. AI-assisted. |
…5 --seeds 1 runs instead of wrapping to none Found by @shdann on ItsNotRexed#5218: start + seeds wrapped to 0 and the loop never ran, a false pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… cannot wrap the seed range to none The same wrap @shdann found in d3d12_footprint_fuzz_test (ItsNotRexed#5218). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@shdann thanks, confirmed and fixed in |
|
Tested aea6f35 on NVIDIA GeForce RTX 4080, driver 617.42: d3d12_footprint_fuzz_test with its default arguments exits 0 and prints "footprint fuzz (NVIDIA GeForce RTX 4080 and WARP): 19906 descriptions, 0 wrong, 51 gaps (the layer refuses), 0 where the two hosts disagree, 1 where the host wraps a 4 GiB subresource". d3d12_vulkan_device_test exits 0 and prints no pass summary. Only these two targets and only the default seed were run, so the full ctest count and the multi-seed comparison from the description were not reproduced. AI-assisted. |
…ead of 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>
|
Same argument-parsing hole as @shdann found in #5272: |
|
Tested
Argument handling from
Negative control: I put Not re-run on this head: the full AI-assisted (Claude Code). |
|
Tested bc2b6c1 on NVIDIA GeForce RTX 5080 Laptop GPU, driver 621.14, Windows 11 (build 26300), MSVC 14.44, RelWithDebInfo: pass. |
1 similar comment
|
Tested bc2b6c1 on NVIDIA GeForce RTX 5080 Laptop GPU, driver 621.14, Windows 11 (build 26300), MSVC 14.44, RelWithDebInfo: pass. |
|
Tested bc2b6c1 on Windows 11, AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: pass
AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). |
Claimed in the coordination issue as: a new D3D item, GetCopyableFootprints answering descriptions the PC runtime refuses (claim).
Depends on: none. #2498 (unaligned
BaseOffset) touches the same method but not the same lines; the fuzzer only uses 512-aligned bases so it doesn't overlap with that PR.What and why
d3d12_footprint_fuzz_test(new, in ctest) asks the layer, the host adapter and WARP about seeded random descriptions:GetCopyableFootprintsis the runtime's arithmetic and validation, so wherever the two hosts agree the layer must give the same answer. Onmain3faac557it answers about 930 of every 20,000 descriptions that both hosts refuse. An application probing a description withGetCopyableFootprintswould get a layout for a resource it can never create.These are the rules, derived over the whole population, not a sample. I dumped all 49,739 descriptions with the three answers. The RTX 5060 Ti and WARP disagree on 2 of them, and neither host ever accepts a description that breaks one of these rules:
mainacceptsALLOW_DEPTH_STENCILon a bufferALLOW_DEPTH_STENCILon a format outside the R32G8X24, R32, R24G8, R16 familiesD32_FLOAT,D16_UNORMI also checked rules that turned out wrong, and they stay unchecked:
R32_TYPELESS/R16_TYPELESS-family volumes.The changes:
footprint_refused()holds those five checks, andGetCopyableFootprintscalls it next toxr_bias_compatibleandrgb96_refused. The old comment saying extent limits "differ between adapters" is updated: on these two hosts they don't.R32_FLOAT_X8X24_TYPELESS,X32_TYPELESS_G8X24_UINT,R24_UNORM_X8_TYPELESS,X24_TYPELESS_G8_UINT) lay out as their typeless family, with two planes, as on both hosts. The layer used to refuse them.How the test judges: the layer answering where the host refuses, or answering differently, fails the run. The layer refusing where the host answers is a gap: it is counted, printed with
--gaps, and doesn't fail. The remaining gaps are video and palette formats (AYUV, Y416, R8G8_B8G8, P8…).A host quirk, not copied: the PC runtime computes a volume subresource's size in 32 bits. For 805×777×750 RGBA32, the next mip lands at 7,608,384,000 − 2^32 = 3,313,416,704 on both hosts, while the layer keeps the true offset. The test skips subresources of 4 GiB or more, and the docs record it.
DXGI_FORMAT_420_OPAQUEis skipped because the host runtime fast-fails on some 3D descriptions of it.Tested
Windows 11 (26300), RTX 5060 Ti / 621.14, MSVC 14.51 (VS 2026), Vulkan SDK 1.4.363.0, RelWithDebInfo.
main3faac557The full
LEONIDA_VK_VALIDATION=1 ctest -j4on the head gives 168/168 pass, 0 VUIDs. That includesd3d12_vulkan_device, whosecompare_footprintsstill matches the PC runtime, and the newd3d12_footprint_fuzz(about 25 s).Found with the same differential approach as #5180 (fences). AI-assisted (Claude Code). Synthetic descriptions only, no game files.
🤖 Generated with Claude Code