gpu: skip the title-address write fixture where array atomics are inexact #327
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/332"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-21T22:27:07Z.
Change
gpu_alias_lookup_writes_warp(added by #284) fails on the in-box WARP of Windows 10 22H2, driver 10.0.19041.5794. Onmainthe only output is the first mismatch:That word is the shared
InterlockedAddtarget, and the value is exactly four times the expected sum. The cause is in that adapter, not inTitleLookupor the fixture. This shader is enough to show it, on plain committed buffers with no aliased heap and no lookup:With
bound = 4andcount = 256each buffer must end at 64. The Windows 10 in-box WARP leaves 256 in each. That is a wrong result, so the test keeps failing there. This PR does not change that verdict; it adds the diagnostics that explain it.What the test does now:
ProbeArrayAtomics(a second entry point intests/gpu_alias_writes.hlsl, sameAliases[8]declaration and per-thread index asWriteTitleAddresses) runs on four zeroed plain buffers. The expected and actual counts are always printed.InterlockedAddthrough the dynamic index.The first commit on this branch returned 77 when the probe was wrong. The second commit replaces that with the behaviour above, following the review.
Refs #284. Thanks to @thegl0w for the Windows 11 measurement and for suggesting that the stores, compare-exchange words and rejected records still be checked on a failing adapter.
Overlap: #327 edits the same
offscreen_checksource block inCMakeLists.txt. This PR adds oneadd_custom_commandand onetarget_sourcesline after theWriteTitleAddresses.hrule, so whichever lands second needs a trivial merge.Verification
Commit
55adbe0(on0f2466f, onmainatbc24dfd). Windows 10 22H2 build 19045, debug layer enabled.In-box WARP 10.0.19041.5794, fails as intended, exit 1,
debug_errors=0 debug_warnings=0:(The first two lines go to stderr, so they appear first.)
WARP 1.0.22 (app-local, Agility SDK 1.620.2) and NVIDIA GeForce RTX 3060 (driver 32.0.15.9636), both pass, exit 0, same lines on both:
Windows 11 in-box WARP 10.0.26100.9818: measured by @thegl0w at
246990b(the first commit of this branch), probe 64,64,64,64 and mismatches 0. Not re-measured at55adbe0; I have no Windows 11 machine.Two local mutants on the RTX 3060, not committed. Each makes exactly one part fail:
operand ^ 1word record=0 field=0 expected=51000000 actual=51000001)Full suite,
ctest --preset dev --no-tests=error, 146 tests:dev, in-box WARP + RTX 3060gpu_alias_lookup_writes_warp(the documented adapter failure above)bvh_wave64_warp,wave_shuffle_warp(#145, not from this change)Evidence and follow-up
One-variable experiments on the Windows 10 in-box WARP with the minimal shader above unless noted. The array-of-8, literal-index,
InterlockedXorand constant-buffer-index cases were also run on the RTX 3060, and the array-of-8 and literal-index cases on every app-local WARP in the last row. All of those are exact. The other rows were measured on the in-box WARP only.id % nNonUniformResourceIndexRWStructuredBuffer<uint>) and typed (RWBuffer<uint>) viewsInterlockedXorwith 1, one thread per bufferArr[2]cs_6_0andcs_6_2What this measures: on WARP 10.0.19041.5794,
AtomicBinOpon a handle created with a per-thread index into a UAV range is applied four times per thread. Why it is four is a hypothesis only. The literal-index result is a second observation on the same adapter; the fixture does not use a literal index and the probe does not test it.Not verified: other hardware vendors, and whether later Windows 10 servicing changes the in-box WARP.
docs/experiments.md: thegpu_alias_lookup_writesrow describes the probe, the two groups and the failure exit, and a measurement entry records the Windows 10 result as a correctness failure of that adapter, with Windows 11 WARP, WARP 1.0.9 to 1.0.22 and the RTX 3060 as exact.Follow-up someone could pick up: a translator that emits atomics through
title_va_lookup.hlsliwould compute wrong sums on this WARP. The compare-exchange form is a working fallback there; this PR does not add it.AI-assisted (Claude Code). The Windows results were measured locally.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by thegl0w on 2026-11-21T22:55:14Z.
Thanks for tracking this down so thoroughly. As the fixture's author, I agree with the handling: a measured probe that returns 77 with the counts keeps the fixture exercising
InterlockedAddthrough the lookup everywhere it can be trusted, and the skip is decided by the adapter's behaviour rather than by its name.This fills the "Windows 11 in-box WARP" row you listed as not verified. At
246990bon Windows 11 build 26300 (debug layer unavailable on this PC):gpu_alias_warp,gpu_alias_lookup_warpand theera_title_va_*cases also pass at that commit.One optional idea, not a request. When the probe fails, the stores, the compare-exchange words and the nine rejected records are still exact on that adapter (your table shows that). A variant could keep checking everything except the add and sub words there. Skipping the whole test is simpler and matches "a skip is not a pass", so I'm happy with it as is.
A note on merge order: #327 also edits the
offscreen_checksource block inCMakeLists.txt, so whichever of the two lands second may need a one-line rebase.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T22:57:56Z.
Please keep the probe and its expected/actual counts. The two reports distinguish this well: Windows 10 WARP produced 256 in each buffer for a dispatch that should produce 64 each, while Windows 11 WARP produced 64 in all four. The Windows 10 result is a correctness failure. Please remove the early capability-skip path in
check_gpu_alias_lookup_writes, continue through the original fixture wherever possible, and report add/sub separately from the remaining checks. Exit with a failure for incorrect counts or resource creation/readback errors. Reserve CTest 77 for a missing required capability. Keep the dynamic-index atomic operation under test. The documented driver failure can land with the diagnostics without waiting for a driver fix.Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-21T23:17:44Z.
@R0Y00 agreed, and thanks for the clear direction.
55adbe0reworks it that way:expectedandactualcounts.InterlockedAddfor add and sub unchanged.On the Windows 10 in-box WARP 10.0.19041.5794 the test now fails with:
On WARP 1.0.22 and an RTX 3060 it passes with 64,64,64,64 and mismatches 0 in both groups. Two local mutants show the parts fail independently: stores writing
operand ^ 1giveother mismatches=14with the probe and add/sub clean, and a probe that adds 2 fails with both groups clean. The PR description has the full output and suite counts.@thegl0w thank you for the Windows 11 run and for the suggestion to keep checking the stores, compare-exchange words and rejected records on a failing adapter. That is what the second group now does. Your result is recorded in
docs/experiments.mdas measured at246990b; if you can rerun at55adbe0I will update the entry. On #327: this PR only adds oneadd_custom_commandand onetarget_sourcesline after theWriteTitleAddresses.hrule, so I am happy to rebase whichever way is easier for you.The PR title still says "skip", which no longer describes the change. CONTRIBUTING says not to rename existing pull requests, so I have left it. If you want it renamed, I suggest
gpu: report inexact array atomics in the title-address write fixture as a failure.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by thegl0w on 2026-11-21T23:32:07Z.
Rerun at
55adbe0, Windows 11 build 26300. This time it includes the hardware variant, and the D3D12 debug layer was enabled for every run (Graphics Tools is now installed here). All sixgpu_aliastests pass withdebug_errors=0 debug_warnings=0.gpu_aliasgpu_alias_lookupgpu_alias_lookup_writesgpu_alias_lookup_writesprinted the same lines on both adapters:The two-group report reads well, and the final message makes the Windows 10 result clear.
About #327: no need for you to do anything. Land this one whenever it's ready, and I'll rebase #327 onto it; it's the same one-block overlap in
CMakeLists.txt. The suggested title is accurate as far as I'm concerned; renaming is the maintainer's call.Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-21T23:38:07Z.
An RDNA 4 data point for the probe on
main(9bdbb20, which includes55adbe0). Heregpu_alias_lookup_writes_hardwarenow fails, as the revised rule intends for wrong probe counts. The fixture's own checks still pass.Environment: Windows 11 build 26200, AMD Radeon RX 9070 XT (
1002:7550), driver 32.0.32015.7029, D3D12 debug layer enabled, MSVC 19.50.35720, DXC 1.8.2502.11.gpu_alias_lookup_writes_warp(WARP 10.0.26100.9818) passes.To narrow it down, I swapped the single
InterlockedAddline ofProbeArrayAtomicsfor a few variants. These are local only and nothing is committed. Same adapter and build:actualmain:Aliases[NonUniformResourceIndex(id % rangeCount)].InterlockedAdd(0, 1, previous)previousresult(id / 32) % rangeCount(id / 64) % rangeCountif/elseonid % rangeCountwith a literal index in each branchEvery buffer gains one add per lane for each distinct index among the active lanes. That looks like a waterfall over the indices that does not mask the lanes on each pass. The 2-index row also implies 64-wide waves for this kernel here.
The add and sub words still come out exact, and I think I see why.
WriteTitleAddressesbranches on the operation before the atomic. Every lane that reaches the add (or the sub) targets the same word, so the lanes active at that atomic share one index. That last step is my reading of the code, not something I measured.So on this driver the probe does detect a real defect. The fixture's own access pattern just doesn't trigger it. Two other things are unmeasured: other AMD drivers, and whether
-Odor a different DXC changes the result.AI-assisted (Claude Code).