Add wave-based UAV atomic waterfall experiment #787

Merged
potatoeking5150-commits merged 2 commits from upstream-pr/793 into main 2026-11-23 14:06:30 +00:00
potatoeking5150-commits commented 2026-11-23 04:00:33 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by potatoeking5150-commits on 2026-11-23T04:00:33Z.


I tested the dynamic-index UAV atomic behavior on an AMD Radeon RX 6500 (RDNA 2) using Windows 11, driver 32.0.21045.29003.

The original atomic-array probe consistently reports:

expected=64
actual=256,256,256,256

The main title-address lookup/write fixture still reports zero mismatches.

I created a separate experimental shader, tests/gpu_alias_atomic_waterfall.hlsl, that uses wave operations to group lanes by descriptor index and performs one InterlockedAdd per distinct index within each group.

Results:

  • RX 6500: 64,64,64,64
  • Four consecutive manual hardware runs passed.
  • Registered hardware CTest passed.
  • Registered WARP CTest passed.
  • Both CTest runs reported zero debug errors and warnings.

The original atomic probe was left unchanged. The waterfall implementation is an isolated experiment with its own test registration.

This demonstrates a working alternative on the RX 6500 and WARP, but does not establish the underlying driver or hardware cause.

I am sharing this for review and would appreciate feedback on whether this approach would be appropriate as a potential workaround.

Summary

Adds an isolated experimental implementation of the dynamic-index UAV atomic test using wave operations.

The original ProbeArrayAtomics shader and existing test remain unchanged.

Implementation

New shader:

tests/gpu_alias_atomic_waterfall.hlsl

The shader:

  • Groups active wave lanes by selected descriptor index.
  • Identifies a leader lane for each group.
  • Counts lanes targeting the same descriptor.
  • Performs one InterlockedAdd per distinct descriptor index per wave iteration.

Additional changes register the new shader build output and expose a separate test through offscreen_check.exe and CTest.

Hardware tested

AMD Radeon RX 6500

  • RDNA 2
  • Device ID: 743f
  • Driver: 32.0.21045.29003
  • Windows 11 build 26300

Microsoft WARP

  • Driver: 10.0.26100.10068

Results

Test Result
Original RX 6500 atomic-array probe Fails: 256 instead of 64 per buffer
Waterfall RX 6500 Passes: 64 per buffer
Waterfall WARP Passes: 64 per buffer
Four consecutive manual RX 6500 runs All pass
D3D12 debug errors/warnings Zero

Scope

This is an experimental workaround, not a confirmed diagnosis or correction of the underlying driver behavior.

The original test remains available for comparison.

Review requested

Please review the wave-based descriptor grouping approach and advise whether it is suitable for broader testing or eventual integration.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6551975041 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/793). Originally posted by [potatoeking5150-commits](https://github.com/potatoeking5150-commits) on 2026-11-23T04:00:33Z. --- I tested the dynamic-index UAV atomic behavior on an AMD Radeon RX 6500 (RDNA 2) using Windows 11, driver 32.0.21045.29003. The original atomic-array probe consistently reports: ```text expected=64 actual=256,256,256,256 ``` The main title-address lookup/write fixture still reports zero mismatches. I created a separate experimental shader, `tests/gpu_alias_atomic_waterfall.hlsl`, that uses wave operations to group lanes by descriptor index and performs one `InterlockedAdd` per distinct index within each group. Results: - RX 6500: 64,64,64,64 - Four consecutive manual hardware runs passed. - Registered hardware CTest passed. - Registered WARP CTest passed. - Both CTest runs reported zero debug errors and warnings. The original atomic probe was left unchanged. The waterfall implementation is an isolated experiment with its own test registration. This demonstrates a working alternative on the RX 6500 and WARP, but does not establish the underlying driver or hardware cause. I am sharing this for review and would appreciate feedback on whether this approach would be appropriate as a potential workaround. ## Summary Adds an isolated experimental implementation of the dynamic-index UAV atomic test using wave operations. The original `ProbeArrayAtomics` shader and existing test remain unchanged. ## Implementation New shader: `tests/gpu_alias_atomic_waterfall.hlsl` The shader: - Groups active wave lanes by selected descriptor index. - Identifies a leader lane for each group. - Counts lanes targeting the same descriptor. - Performs one `InterlockedAdd` per distinct descriptor index per wave iteration. Additional changes register the new shader build output and expose a separate test through `offscreen_check.exe` and CTest. ## Hardware tested **AMD Radeon RX 6500** - RDNA 2 - Device ID: 743f - Driver: 32.0.21045.29003 - Windows 11 build 26300 **Microsoft WARP** - Driver: 10.0.26100.10068 ## Results | Test | Result | |---|---| | Original RX 6500 atomic-array probe | Fails: 256 instead of 64 per buffer | | Waterfall RX 6500 | Passes: 64 per buffer | | Waterfall WARP | Passes: 64 per buffer | | Four consecutive manual RX 6500 runs | All pass | | D3D12 debug errors/warnings | Zero | ## Scope This is an experimental workaround, not a confirmed diagnosis or correction of the underlying driver behavior. The original test remains available for comparison. ## Review requested Please review the wave-based descriptor grouping approach and advise whether it is suitable for broader testing or eventual integration.
upstream-sync closed this pull request 2026-11-24 06:44:49 +00:00
R0Y00 commented 2026-11-24 06:48:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T04:19:34Z.


The RX 6500 contrast is useful for #369: the direct probe still reports 256,256,256,256, while your explicit waterfall reports 64,64,64,64 and the original title-address fixture remains correct. Please pin the experiment’s source commit, both commands, and the adapter/driver/build with the two readbacks. Keep the waterfall as an opt-in diagnostic for this patch. The original probe must continue to fail on a mismatch, and the measurement alone does not justify a change to the production write path or a new mandatory CI case.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7091485350 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/793#issuecomment-7091485350). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T04:19:34Z. --- The RX 6500 contrast is useful for #369: the direct probe still reports `256,256,256,256`, while your explicit waterfall reports `64,64,64,64` and the original title-address fixture remains correct. Please pin the experiment’s source commit, both commands, and the adapter/driver/build with the two readbacks. Keep the waterfall as an opt-in diagnostic for this patch. The original probe must continue to fail on a mismatch, and the measurement alone does not justify a change to the production write path or a new mandatory CI case.
R0Y00 commented 2026-11-24 06:49:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T13:46:27Z.


I updated your branch in 978273b. The waterfall runs explicitly with --gpu-alias-atomic-waterfall and shares resource setup and readback with the existing direct probe. The regular test still runs the direct probe with its original result check. The documentation links your RX 6500 measurement and shows both commands.

On Windows 26200.9974 with the debug layer enabled, both commands read 64 in all four slots on WARP 10.0.26100.9818 and RTX 4060 Laptop driver 32.0.16.1656. Adding one to each grouped add made WARP read 128 in all four slots and exit 1. Restoring the shader returned the expected counts. The diagnostic uses exit 77 for missing SM 6.0/WaveOps capability.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7103007925 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/793#issuecomment-7103007925). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T13:46:27Z. --- I updated your branch in 978273b. The waterfall runs explicitly with --gpu-alias-atomic-waterfall and shares resource setup and readback with the existing direct probe. The regular test still runs the direct probe with its original result check. The documentation links your RX 6500 measurement and shows both commands. On Windows 26200.9974 with the debug layer enabled, both commands read 64 in all four slots on WARP 10.0.26100.9818 and RTX 4060 Laptop driver 32.0.16.1656. Adding one to each grouped add made WARP read 128 in all four slots and exit 1. Restoring the shader returned the expected counts. The diagnostic uses exit 77 for missing SM 6.0/WaveOps capability.
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!787
No description provided.