I believe that the maxThreadsPerThreadgroup reported by Metal backends can change based on pipeline/shader complexity.
This can cause issues where a user attempts to launch shaders based on WebGPU's reported maxComputeWorkgroupSize{XYZ} or maxComputeInvocationsPerWorkgroup limits, but the actual limit for that shader in a given context is lower.
I encountered this issue running WebGPU natively using Dawn's bindings, and it caused a silent failure which I was only able to diagnose after enabling Metal shader validation/debug mode. I'm not sure if something similar would happen in the browser.
Opening this issue to see if anyone else has encountered/thought about this issue, and to see if there are any good solutions.
I believe that the
maxThreadsPerThreadgroupreported by Metal backends can change based on pipeline/shader complexity.This can cause issues where a user attempts to launch shaders based on WebGPU's reported
maxComputeWorkgroupSize{XYZ}ormaxComputeInvocationsPerWorkgrouplimits, but the actual limit for that shader in a given context is lower.I encountered this issue running WebGPU natively using Dawn's bindings, and it caused a silent failure which I was only able to diagnose after enabling Metal shader validation/debug mode. I'm not sure if something similar would happen in the browser.
Opening this issue to see if anyone else has encountered/thought about this issue, and to see if there are any good solutions.