Skip to content

All subgroup operations are unsafe #305

Open
@liamwhite

Description

@liamwhite

Subgroup operations don't appear to violate the Rust safety rules. And at least one other non-uniform operation, is_helper_invocation, isn't unsafe.

It would be more convenient for developers if all subgroup operations were safe except for OpGroupNonUniformBallotFindLSB / OpGroupNonUniformBallotFindMSB (value undefined when 0, though you could probably make the argument that this is also safe, as it only produces garbage and doesn't access memory).

A read through of the SPIR-V and Vulkan specs suggests no cases where other subgroup operations will result in undefined behavior. SPIR-V also makes a fairly strong requirement about program ordering for GroupNonUniform operations:

An invocation will not execute a dynamic instance of this instruction (X') until all invocations in its scope restricted tangle have executed all dynamic instances that are program-ordered before X'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions