In the memory layout section in the WebGPU shading language, alignment and size are specified for many primitive types, vectors, arrays and matrices,
but nothing is mentioned for bool.
also in the type definitions, int/float types are detailed about what memory they use and how, while for bool, the spec only mentions it has 2 values: true and false
How should the bool type actually be implemented (bitwise), and what stride and size does it have in structs?

in WGSL, at least version 1, there is no
booltype that you can pass into/out of a shader so in general so there is no "memory layout" for a bool. You only need to know the size for computing things like workgroup storage size limits, not for memory layoutYou can see this if you try to use them:
In Chrome v120 the code above produces these error messages
If you want to pass bool values into your shader you'll have to pass them in via some other format and convert them in the shader. For example, you could pass 32 bits as a
u32and convert each bit to a bool in the shader.Or you could pass one
u32per bool and convert in the shader.Or pass four bool as bytes per u32
etc...