Set a limit for maximum array size - #3078
Conversation
| <tr><td>[=Nesting depth=] of a [=composite=] type<td>255 | ||
| <tr><td>Number of [=formal parameter|parameters=] for a function<td>255 | ||
| <tr><td>Number of case selector values in a [=statement/switch=] statement<td>16383 | ||
| <tr><td>[=Byte-size=] of an [=array=] type<td>655in35 |
There was a problem hiding this comment.
How does this work for types that have no defined byte size? e.g. bool and abstract numerics?
There was a problem hiding this comment.
I think it'd be ok to leave that based on the implementation. We could add a second limit on number of elements if that is necessary.
There was a problem hiding this comment.
I suggest adding:
For this limit, assume bool has byte-size of 4.
There was a problem hiding this comment.
What about abstract numerics? Suggest 8 bytes for them, given that we guarantee at least 64 bit precision.
|
|
kdashg
left a comment
There was a problem hiding this comment.
A brief explanation would be ideal here, if you can! This is something we're going to wonder about in the future both "why limit?" and "why this number?"
WGSL meeting minutes 2022-06-28
|
| <tr><td>Maximum [=byte-size=] of an [=array=] type instantiated in the following [=address spaces=]: | ||
| * [=address spaces/function=] | ||
| * [=address spaces/private=] | ||
| * [=address spaces/workgroup=] |
There was a problem hiding this comment.
WebGPU has a 16KB limit on workgroup storage.
Suggest making a different row for workgroup storage, use 16KB and indicate that https://gpuweb.github.io/gpuweb/#dom-supported-limits-maxcomputeworkgroupstoragesize is authoritative.
dneto0
left a comment
There was a problem hiding this comment.
I like the min/max phrasing.
Please update the rule for workgroup.
|
|
||
| For the purposes of this limit, [=bool=] has a size of 1 byte. | ||
| <td>[[WebGPU#dom-supported-limits-maxcomputeworkgroupstoragesize|16384]] | ||
| <tr><td>Maximum number of elements in [=creation-time expression=] of [=array=] type<td>65535 |
There was a problem hiding this comment.
This is a broken link, per the bot
There was a problem hiding this comment.
Right, this is from before the rename.
|
I'm not sure the group has agreed to these actual numbers. Let's put this on the agenda to verify |
Fixes gpuweb#2118 * Set a limit of 64k bytes for an array size
* Changes limits to minimum maximum style * Clarify array size byte size limit is for private, function and workgroup * specify bool is 1 byte for this limit * Add limit for maximum number of elements in a creation-time expression of array type
d249d58 to
4d70db6
Compare
|
Previews, as seen when this build job started (4d70db6): |
WGSL 2022-08-16 Minutes
|
Fixes #2118