gpu: skip the title-address write fixture where array atomics are inexact #327

Merged
rasptum merged 2 commits from upstream-pr/332 into main 2026-11-21 23:26:11 +00:00
rasptum commented 2026-11-21 22:27:07 +00:00 (Migrated from github.com)

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. On main the only output is the first mismatch:

record=1 field=64 expected=0001f5a0 actual=0007d680
BVH fixture result differs from CPU reference

That word is the shared InterlockedAdd target, and the value is exactly four times the expected sum. The cause is in that adapter, not in TitleLookup or the fixture. This shader is enough to show it, on plain committed buffers with no aliased heap and no lookup:

RWByteAddressBuffer Arr[8] : register(u0, space1);
cbuffer Counts : register(b0) { uint bound; uint count; };

[numthreads(64, 1, 1)]
void Probe(uint id : SV_DispatchThreadID)
{
    if (id >= count) return;
    uint previous;
    Arr[NonUniformResourceIndex(id % bound)].InterlockedAdd(0, 1, previous);
}

With bound = 4 and count = 256 each 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:

  1. ProbeArrayAtomics (a second entry point in tests/gpu_alias_writes.hlsl, same Aliases[8] declaration and per-thread index as WriteTitleAddresses) runs on four zeroed plain buffers. The expected and actual counts are always printed.
  2. The original fixture runs in full on every adapter. Its records, shader and expected values are unchanged, and the add and sub records still use InterlockedAdd through the dynamic index.
  3. The comparison is reported in two groups, each with a mismatch count and its first mismatch: the shared add and sub words, and everything else (the 1,047 per-record results, then every other word: stores, float min and max, rejected records and untouched words).
  4. The process exits with a failure when the probe counts are wrong, when any word or result mismatches, or when a resource creation or readback call fails. The failure message names the adapter defect when the probe is wrong.
  5. CTest 77 is returned only when the adapter does not support existing heaps, exactly as before this PR.

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_check source block in CMakeLists.txt. This PR adds one add_custom_command and one target_sources line after the WriteTitleAddresses.h rule, so whichever lands second needs a trivial merge.

Verification

Commit 55adbe0 (on 0f2466f, on main at bc24dfd). Windows 10 22H2 build 19045, debug layer enabled.

.\tools\dev.ps1
cmake --preset dev
cmake --build --preset dev
ctest --preset dev --no-tests=error -R '^gpu_alias_lookup_writes' -V

In-box WARP 10.0.19041.5794, fails as intended, exit 1, debug_errors=0 debug_warnings=0:

add_word record=1 field=64 expected=0001f5a0 actual=0007d680
InterlockedAdd through a per-thread index into a UAV array is not applied exactly once per thread on this adapter (array_atomics counts above). This is an adapter defect, recorded for the Windows 10 in-box WARP 10.0.19041 in docs/experiments.md
array_atomics threads=256 buffers=4 expected=64 actual=256,256,256,256
gpu_alias_lookup_writes add_sub words=2 add=0007d680 sub=00076bc0 expected_add=0001f5a0 expected_sub=000d4ca0 mismatches=2
gpu_alias_lookup_writes other results=1047 words=147454 mismatches=0
gpu_alias_lookup_writes ranges=4 records=1047 stores=14 contenders=256 sum=128416 min=-1250 max=1241.62 misses=9 words_checked=147456 mismatches=2

(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:

array_atomics threads=256 buffers=4 expected=64 actual=64,64,64,64
gpu_alias_lookup_writes add_sub words=2 add=0001f5a0 sub=000d4ca0 expected_add=0001f5a0 expected_sub=000d4ca0 mismatches=0
gpu_alias_lookup_writes other results=1047 words=147454 mismatches=0
gpu_alias_lookup_writes ranges=4 records=1047 stores=14 contenders=256 sum=128416 min=-1250 max=1241.62 misses=9 words_checked=147456 mismatches=0

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 at 55adbe0; I have no Windows 11 machine.

Two local mutants on the RTX 3060, not committed. Each makes exactly one part fail:

Mutant Probe add_sub other Exit
Stores write operand ^ 1 64,64,64,64 0 14 (first: word record=0 field=0 expected=51000000 actual=51000001) 1
Probe adds 2, fixture untouched 128,128,128,128 0 0 1

Full suite, ctest --preset dev --no-tests=error, 146 tests:

Build Passed Skipped (77) Failed
dev, in-box WARP + RTX 3060 128 17 1: gpu_alias_lookup_writes_warp (the documented adapter failure above)
Agility SDK 1.620.2 + WARP 1.0.22 + RTX 3060 141 3 2: 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, InterlockedXor and 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.

Variation In-box WARP 10.0.19041.5794
Array of 2, 3, 8 or 16 UAVs, index id % n every count is 4 times too large
With and without NonUniformResourceIndex 4 times too large
Raw, structured (RWStructuredBuffer<uint>) and typed (RWBuffer<uint>) views 4 times too large
InterlockedXor with 1, one thread per buffer 0, expected 1 (an even number of applications)
One thread only (in the fixture, record 14 adds 1) word reads 4
Single UAV, or an array declared with one element exact
Index read from a constant buffer (same for all threads) exact, correct element
Literal index Arr[2] count exact, but element 0 is updated, not element 2
Fixture with the add and sub written as compare-exchange loops (local only) passes, mismatches 0
DXC 1.7.2308 (Windows SDK), 1.8.2502 and 1.9.2609; cs_6_0 and cs_6_2 no difference
App-local WARP 1.0.9, 1.0.13, 1.0.15.1, 1.0.16.1, 1.0.17, 1.0.19, 1.0.20, 1.0.21, 1.0.22 all exact, fixture passes

What this measures: on WARP 10.0.19041.5794, AtomicBinOp on 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: the gpu_alias_lookup_writes row 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.hlsli would 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

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5433087941 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/332). Originally posted by [rasptum](https://github.com/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. On `main` the only output is the first mismatch: ``` record=1 field=64 expected=0001f5a0 actual=0007d680 BVH fixture result differs from CPU reference ``` That word is the shared `InterlockedAdd` target, and the value is exactly four times the expected sum. The cause is in that adapter, not in `TitleLookup` or the fixture. This shader is enough to show it, on plain committed buffers with no aliased heap and no lookup: ```hlsl RWByteAddressBuffer Arr[8] : register(u0, space1); cbuffer Counts : register(b0) { uint bound; uint count; }; [numthreads(64, 1, 1)] void Probe(uint id : SV_DispatchThreadID) { if (id >= count) return; uint previous; Arr[NonUniformResourceIndex(id % bound)].InterlockedAdd(0, 1, previous); } ``` With `bound = 4` and `count = 256` each 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: 1. `ProbeArrayAtomics` (a second entry point in `tests/gpu_alias_writes.hlsl`, same `Aliases[8]` declaration and per-thread index as `WriteTitleAddresses`) runs on four zeroed plain buffers. The expected and actual counts are always printed. 2. The original fixture runs in full on every adapter. Its records, shader and expected values are unchanged, and the add and sub records still use `InterlockedAdd` through the dynamic index. 3. The comparison is reported in two groups, each with a mismatch count and its first mismatch: the shared add and sub words, and everything else (the 1,047 per-record results, then every other word: stores, float min and max, rejected records and untouched words). 4. The process exits with a failure when the probe counts are wrong, when any word or result mismatches, or when a resource creation or readback call fails. The failure message names the adapter defect when the probe is wrong. 5. CTest 77 is returned only when the adapter does not support existing heaps, exactly as before this PR. 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_check` source block in `CMakeLists.txt`. This PR adds one `add_custom_command` and one `target_sources` line after the `WriteTitleAddresses.h` rule, so whichever lands second needs a trivial merge. ## Verification Commit `55adbe0` (on `0f2466f`, on `main` at `bc24dfd`). Windows 10 22H2 build 19045, debug layer enabled. ```powershell .\tools\dev.ps1 cmake --preset dev cmake --build --preset dev ctest --preset dev --no-tests=error -R '^gpu_alias_lookup_writes' -V ``` In-box WARP 10.0.19041.5794, **fails as intended**, exit 1, `debug_errors=0 debug_warnings=0`: ``` add_word record=1 field=64 expected=0001f5a0 actual=0007d680 InterlockedAdd through a per-thread index into a UAV array is not applied exactly once per thread on this adapter (array_atomics counts above). This is an adapter defect, recorded for the Windows 10 in-box WARP 10.0.19041 in docs/experiments.md array_atomics threads=256 buffers=4 expected=64 actual=256,256,256,256 gpu_alias_lookup_writes add_sub words=2 add=0007d680 sub=00076bc0 expected_add=0001f5a0 expected_sub=000d4ca0 mismatches=2 gpu_alias_lookup_writes other results=1047 words=147454 mismatches=0 gpu_alias_lookup_writes ranges=4 records=1047 stores=14 contenders=256 sum=128416 min=-1250 max=1241.62 misses=9 words_checked=147456 mismatches=2 ``` (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: ``` array_atomics threads=256 buffers=4 expected=64 actual=64,64,64,64 gpu_alias_lookup_writes add_sub words=2 add=0001f5a0 sub=000d4ca0 expected_add=0001f5a0 expected_sub=000d4ca0 mismatches=0 gpu_alias_lookup_writes other results=1047 words=147454 mismatches=0 gpu_alias_lookup_writes ranges=4 records=1047 stores=14 contenders=256 sum=128416 min=-1250 max=1241.62 misses=9 words_checked=147456 mismatches=0 ``` 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 at `55adbe0`; I have no Windows 11 machine. Two local mutants on the RTX 3060, not committed. Each makes exactly one part fail: | Mutant | Probe | add_sub | other | Exit | |---|---|---|---|---| | Stores write `operand ^ 1` | 64,64,64,64 | 0 | 14 (first: `word record=0 field=0 expected=51000000 actual=51000001`) | 1 | | Probe adds 2, fixture untouched | 128,128,128,128 | 0 | 0 | 1 | Full suite, `ctest --preset dev --no-tests=error`, 146 tests: | Build | Passed | Skipped (77) | Failed | |---|---|---|---| | `dev`, in-box WARP + RTX 3060 | 128 | 17 | 1: `gpu_alias_lookup_writes_warp` (the documented adapter failure above) | | Agility SDK 1.620.2 + WARP 1.0.22 + RTX 3060 | 141 | 3 | 2: `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, `InterlockedXor` and 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. | Variation | In-box WARP 10.0.19041.5794 | |---|---| | Array of 2, 3, 8 or 16 UAVs, index `id % n` | every count is 4 times too large | | With and without `NonUniformResourceIndex` | 4 times too large | | Raw, structured (`RWStructuredBuffer<uint>`) and typed (`RWBuffer<uint>`) views | 4 times too large | | `InterlockedXor` with 1, one thread per buffer | 0, expected 1 (an even number of applications) | | One thread only (in the fixture, record 14 adds 1) | word reads 4 | | Single UAV, or an array declared with one element | exact | | Index read from a constant buffer (same for all threads) | exact, correct element | | Literal index `Arr[2]` | count exact, but element 0 is updated, not element 2 | | Fixture with the add and sub written as compare-exchange loops (local only) | passes, mismatches 0 | | DXC 1.7.2308 (Windows SDK), 1.8.2502 and 1.9.2609; `cs_6_0` and `cs_6_2` | no difference | | App-local WARP 1.0.9, 1.0.13, 1.0.15.1, 1.0.16.1, 1.0.17, 1.0.19, 1.0.20, 1.0.21, 1.0.22 | all exact, fixture passes | What this measures: on WARP 10.0.19041.5794, `AtomicBinOp` on 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`: the `gpu_alias_lookup_writes` row 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.hlsli` would 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](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-24 06:42:28 +00:00
thegl0w commented 2026-11-24 06:48:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by thegl0w on 2026-11-21T22:55:14Z.


AI-generated: this comment was written by Claude (Claude Code), an AI assistant, and posted with the account owner's approval. The run below was done on the account owner's PC.

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 InterlockedAdd through 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 246990b on Windows 11 build 26300 (debug layer unavailable on this PC):

offscreen_check warp --gpu-alias-lookup-writes
adapter=Microsoft Basic Render Driver vendor=1414 device=008c
driver=10.0.26100.9818
array_atomics threads=256 buffers=4 expected=64 actual=64,64,64,64
gpu_alias_lookup_writes ranges=4 records=1047 stores=14 contenders=256 sum=128416 min=-1250 max=1241.62 misses=9 words_checked=147456 mismatches=0

gpu_alias_warp, gpu_alias_lookup_warp and the era_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_check source block in CMakeLists.txt, so whichever of the two lands second may need a one-line rebase.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7070518517 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/332#issuecomment-7070518517). Originally posted by [thegl0w](https://github.com/thegl0w) on 2026-11-21T22:55:14Z. --- > **AI-generated:** this comment was written by Claude (Claude Code), an AI assistant, and posted with the account owner's approval. The run below was done on the account owner's PC. 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 `InterlockedAdd` through 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 `246990b` on Windows 11 build 26300 (debug layer unavailable on this PC): ``` offscreen_check warp --gpu-alias-lookup-writes adapter=Microsoft Basic Render Driver vendor=1414 device=008c driver=10.0.26100.9818 array_atomics threads=256 buffers=4 expected=64 actual=64,64,64,64 gpu_alias_lookup_writes ranges=4 records=1047 stores=14 contenders=256 sum=128416 min=-1250 max=1241.62 misses=9 words_checked=147456 mismatches=0 ``` `gpu_alias_warp`, `gpu_alias_lookup_warp` and the `era_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_check` source block in `CMakeLists.txt`, so whichever of the two lands second may need a one-line rebase.
R0Y00 commented 2026-11-24 06:48:10 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7070548499 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/332#issuecomment-7070548499). Originally posted by [R0Y00](https://github.com/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.
rasptum commented 2026-11-24 06:48:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-21T23:17:44Z.


@R0Y00 agreed, and thanks for the clear direction. 55adbe0 reworks it that way:

  • The probe stays and always prints expected and actual counts.
  • The early return 77 is gone. The fixture runs in full on every adapter, with the dynamic-index InterlockedAdd for add and sub unchanged.
  • The comparison is reported in two groups, each with its own mismatch count and first mismatch: the shared add and sub words, and everything else (per-record results, stores, float min and max, rejected records, untouched words).
  • Wrong probe counts, any mismatch, or a resource creation or readback error exit with a failure. The message names the adapter defect when the probe is wrong.
  • 77 is returned only when the adapter does not support existing heaps, as before this PR.

On the Windows 10 in-box WARP 10.0.19041.5794 the test now fails with:

array_atomics threads=256 buffers=4 expected=64 actual=256,256,256,256
gpu_alias_lookup_writes add_sub words=2 add=0007d680 sub=00076bc0 expected_add=0001f5a0 expected_sub=000d4ca0 mismatches=2
gpu_alias_lookup_writes other results=1047 words=147454 mismatches=0

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 ^ 1 give other mismatches=14 with 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.md as measured at 246990b; if you can rerun at 55adbe0 I will update the entry. On #327: this PR only adds one add_custom_command and one target_sources line after the WriteTitleAddresses.h rule, 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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7070777665 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/332#issuecomment-7070777665). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-21T23:17:44Z. --- @R0Y00 agreed, and thanks for the clear direction. `55adbe0` reworks it that way: - The probe stays and always prints `expected` and `actual` counts. - The early return 77 is gone. The fixture runs in full on every adapter, with the dynamic-index `InterlockedAdd` for add and sub unchanged. - The comparison is reported in two groups, each with its own mismatch count and first mismatch: the shared add and sub words, and everything else (per-record results, stores, float min and max, rejected records, untouched words). - Wrong probe counts, any mismatch, or a resource creation or readback error exit with a failure. The message names the adapter defect when the probe is wrong. - 77 is returned only when the adapter does not support existing heaps, as before this PR. On the Windows 10 in-box WARP 10.0.19041.5794 the test now fails with: ``` array_atomics threads=256 buffers=4 expected=64 actual=256,256,256,256 gpu_alias_lookup_writes add_sub words=2 add=0007d680 sub=00076bc0 expected_add=0001f5a0 expected_sub=000d4ca0 mismatches=2 gpu_alias_lookup_writes other results=1047 words=147454 mismatches=0 ``` 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 ^ 1` give `other mismatches=14` with 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.md` as measured at `246990b`; if you can rerun at `55adbe0` I will update the entry. On #327: this PR only adds one `add_custom_command` and one `target_sources` line after the `WriteTitleAddresses.h` rule, 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)._
thegl0w commented 2026-11-24 06:48:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by thegl0w on 2026-11-21T23:32:07Z.


AI-generated: this comment was written by Claude (Claude Code), an AI assistant, and posted with the account owner's approval. The runs below were done on the account owner's PC.

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 six gpu_alias tests pass with debug_errors=0 debug_warnings=0.

ctest --preset dev --no-tests=error -R '^gpu_alias' -V
Test WARP 10.0.26100.9818 NVIDIA GeForce RTX 3070 Laptop GPU, driver 32.0.16.1088
gpu_alias pass pass
gpu_alias_lookup pass, 150 records, mismatches 0 pass, 150 records, mismatches 0
gpu_alias_lookup_writes pass pass

gpu_alias_lookup_writes printed the same lines on both adapters:

array_atomics threads=256 buffers=4 expected=64 actual=64,64,64,64
gpu_alias_lookup_writes add_sub words=2 add=0001f5a0 sub=000d4ca0 expected_add=0001f5a0 expected_sub=000d4ca0 mismatches=0
gpu_alias_lookup_writes other results=1047 words=147454 mismatches=0
gpu_alias_lookup_writes ranges=4 records=1047 stores=14 contenders=256 sum=128416 min=-1250 max=1241.62 misses=9 words_checked=147456 mismatches=0

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7070936591 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/332#issuecomment-7070936591). Originally posted by [thegl0w](https://github.com/thegl0w) on 2026-11-21T23:32:07Z. --- > **AI-generated:** this comment was written by Claude (Claude Code), an AI assistant, and posted with the account owner's approval. The runs below were done on the account owner's PC. 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 six `gpu_alias` tests pass with `debug_errors=0 debug_warnings=0`. ``` ctest --preset dev --no-tests=error -R '^gpu_alias' -V ``` | Test | WARP 10.0.26100.9818 | NVIDIA GeForce RTX 3070 Laptop GPU, driver 32.0.16.1088 | |---|---|---| | `gpu_alias` | pass | pass | | `gpu_alias_lookup` | pass, 150 records, mismatches 0 | pass, 150 records, mismatches 0 | | `gpu_alias_lookup_writes` | pass | pass | `gpu_alias_lookup_writes` printed the same lines on both adapters: ``` array_atomics threads=256 buffers=4 expected=64 actual=64,64,64,64 gpu_alias_lookup_writes add_sub words=2 add=0001f5a0 sub=000d4ca0 expected_add=0001f5a0 expected_sub=000d4ca0 mismatches=0 gpu_alias_lookup_writes other results=1047 words=147454 mismatches=0 gpu_alias_lookup_writes ranges=4 records=1047 stores=14 contenders=256 sum=128416 min=-1250 max=1241.62 misses=9 words_checked=147456 mismatches=0 ``` 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.
denn0x commented 2026-11-24 06:48:12 +00:00 (Migrated from github.com)

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 includes 55adbe0). Here gpu_alias_lookup_writes_hardware now 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.

ctest --preset dev --no-tests=error -R '^gpu_alias_lookup_writes_hardware$' -V
41: array_atomics threads=256 buffers=4 expected=64 actual=256,256,256,256
41: gpu_alias_lookup_writes add_sub words=2 add=0001f5a0 sub=000d4ca0 expected_add=0001f5a0 expected_sub=000d4ca0 mismatches=0
41: gpu_alias_lookup_writes other results=1047 words=147454 mismatches=0
41: gpu_alias_lookup_writes ranges=4 records=1047 stores=14 contenders=256 sum=128416 min=-1250 max=1241.62 misses=9 words_checked=147456 mismatches=0
41: debug_errors=0 debug_warnings=0

To narrow it down, I swapped the single InterlockedAdd line of ProbeArrayAtomics for a few variants. These are local only and nothing is committed. Same adapter and build:

Probe line Distinct indices per 64-thread group actual
as on main: Aliases[NonUniformResourceIndex(id % rangeCount)].InterlockedAdd(0, 1, previous) 4 256,256,256,256
same, without the previous result 4 256,256,256,256
index (id / 32) % rangeCount 2 128,128,128,128
index (id / 64) % rangeCount 1 64,64,64,64
if/else on id % rangeCount with a literal index in each branch 1 per branch 64,64,64,64

Every 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. WriteTitleAddresses branches 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 -Od or a different DXC changes the result.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7071003250 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/332#issuecomment-7071003250). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-21T23:38:07Z. --- An RDNA 4 data point for the probe on `main` (`9bdbb20`, which includes `55adbe0`). Here `gpu_alias_lookup_writes_hardware` now 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. ```powershell ctest --preset dev --no-tests=error -R '^gpu_alias_lookup_writes_hardware$' -V ``` ```text 41: array_atomics threads=256 buffers=4 expected=64 actual=256,256,256,256 41: gpu_alias_lookup_writes add_sub words=2 add=0001f5a0 sub=000d4ca0 expected_add=0001f5a0 expected_sub=000d4ca0 mismatches=0 41: gpu_alias_lookup_writes other results=1047 words=147454 mismatches=0 41: gpu_alias_lookup_writes ranges=4 records=1047 stores=14 contenders=256 sum=128416 min=-1250 max=1241.62 misses=9 words_checked=147456 mismatches=0 41: debug_errors=0 debug_warnings=0 ``` To narrow it down, I swapped the single `InterlockedAdd` line of `ProbeArrayAtomics` for a few variants. These are local only and nothing is committed. Same adapter and build: | Probe line | Distinct indices per 64-thread group | `actual` | |---|---|---| | as on `main`: `Aliases[NonUniformResourceIndex(id % rangeCount)].InterlockedAdd(0, 1, previous)` | 4 | 256,256,256,256 | | same, without the `previous` result | 4 | 256,256,256,256 | | index `(id / 32) % rangeCount` | 2 | 128,128,128,128 | | index `(id / 64) % rangeCount` | 1 | 64,64,64,64 | | `if/else` on `id % rangeCount` with a literal index in each branch | 1 per branch | 64,64,64,64 | Every 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. `WriteTitleAddresses` branches 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 `-Od` or a different DXC changes the result. _AI-assisted (Claude Code)._
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!327
No description provided.