The d3d12 documentation is less than complete. It uses the language "all UAV accesses (read or writes)" when talking about UAV barriers, but then only mentions "draw or dispatch calls" specifically. It's not really clear whether clears count. Has this test ever failed on Windows? Should we just add a barrier there anyway?
Right. I guess the concrete question would be whether UAV clears imply a barrier or not. I don't think I've seen this fail on the Windows CI runs at least, but that may not be very meaningful. The CI runs these on WARP (any chance we could fix that?), which may simply not need the barriers.
For the tests, I think we should just add the barrier and see if that fixes the issue. Clears implying a barrier seems like something that would be fairly painful to debug in an actual application though; it's probably worth spending a bit of time to figure out the correct behaviour. Perhaps someone with Windows 10+ on an AMD and/or NVIDIA GPU could try running test_cs_uav_store() in a loop for a while?