Skip to content

Add wave-based UAV atomic waterfall experiment - #793

Open
potatoeking5150-commits wants to merge 2 commits into
R0Y00:mainfrom
potatoeking5150-commits:experiment/gpu-alias-atomic-waterfall
Open

potatoeking5150-commits wants to merge 2 commits into
R0Y00:mainfrom
potatoeking5150-commits:experiment/gpu-alias-atomic-waterfall

Conversation

@potatoeking5150-commits

Copy link
Copy Markdown

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.

R0Y00 commented Nov 23, 2026

Copy link
Copy Markdown
Owner

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

R0Y00 commented Nov 23, 2026

Copy link
Copy Markdown
Owner

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants