You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In porting piet-gpu to WebGPU, I have come across a serious miscompilation. It would be good to get coverage for this into the CTS. More details are at gfx-rs/wgpu#3181 but I will attempt to condense the essentials here.
The reduced case is a pattern consisting of an atomic add, storing the result of that add into workgroup shared memory, doing a workgroupBarrier() then storing that value (perhaps doing a tiny bit of additional computation such as adding an offset) into a storage buffer, but with that store protected by a conditional guard. If any of these elements are missing, then I am not able to repro the miscompilation. In addition, it only repros when buffer robustness is accomplished through conditionalizing memory accesses (which is the default in naga), not when clamping (the default in tint). That said, though I was not easily able to do so, it would not be surprising to me if it were possible to manifest the bug in other conditions, possibly including in a browser. I can continue exploring.
This was discussed in WGSL office hours earlier today. I'm a bit new at contributing to the WebGPU CTS, but happy to help however I can. I have come across a number of shader compilation issues while developing piet-gpu, and my goal is to land coverage for each of those into the appropriate CTS. Happy to answer any questions or provide more details.
The text was updated successfully, but these errors were encountered:
In porting piet-gpu to WebGPU, I have come across a serious miscompilation. It would be good to get coverage for this into the CTS. More details are at gfx-rs/wgpu#3181 but I will attempt to condense the essentials here.
The reduced case is a pattern consisting of an atomic add, storing the result of that add into workgroup shared memory, doing a
workgroupBarrier()
then storing that value (perhaps doing a tiny bit of additional computation such as adding an offset) into a storage buffer, but with that store protected by a conditional guard. If any of these elements are missing, then I am not able to repro the miscompilation. In addition, it only repros when buffer robustness is accomplished through conditionalizing memory accesses (which is the default in naga), not when clamping (the default in tint). That said, though I was not easily able to do so, it would not be surprising to me if it were possible to manifest the bug in other conditions, possibly including in a browser. I can continue exploring.https://gist.github.com/raphlinus/f32d9602241ea5c99b480e721f1ea834 contains a minimal WGSL and WebGPU repro of the problem. The expected value is [1, 1, 1], but when the WGSL code is run using wgpu 0.14 on a mac M1, it produces three identical garbage values. Rust code for the repro is in linebender/vello#199; I have not yet gotten a failure running in browser.
This was discussed in WGSL office hours earlier today. I'm a bit new at contributing to the WebGPU CTS, but happy to help however I can. I have come across a number of shader compilation issues while developing piet-gpu, and my goal is to land coverage for each of those into the appropriate CTS. Happy to answer any questions or provide more details.
The text was updated successfully, but these errors were encountered: