All recursion in the WGSL front end should be audited #6964
Description
The fuzzers are having a good time making the WGSL front end exhaust it's stack. We've had #5757 for expressions, and #4352 for statements. I think there is also recursion in type parsing. Waiting for the fuzzers to find everything is dorky; we should just think about the grammar, identify everywhere that recursion is used, and slap limits on all of them.
It's true that the WGSL spec doesn't impose any limits on this nesting, as Erich pointed out in his comment: #6885 (review) But the fact is that Naga exhausts its stack with unbounded nesting; our architecture doesn't parse these things successfully anyway. So we need to treat this as an uncategorized error:
An uncategorized error may occur even when all WGSL and WebGPU requirements have been satisfied. Possible causes include:
The shaders are too complex, exceeding the capabilities of the implementation, but in a way not easily captured by prescribed limits. Simplifying the shaders may work around the issue.
A defect in the WebGPU implementation.
Metadata
Assignees
Type
Projects
Status
Done