KhronosGroup / KhronosGroup/Vulkan-Docs

Definition of synchronization scopes as sets

Open
#1,815 18 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.3k
Forks
549
Avg merge
5d 5h
Merged PRs (30d)
2

Description

I've been trying to understand from the Vulkan spec the precise definition of a synchronization scope. It's not clear to me whether a synchronization scope is:
1. A set of pipeline stages. For example, a synchronization scope could be {TRANSFER, VERTEX_SHADER}.
2. Or, a set of operations. For example, { _Copy region R from buffer B to C_, _Run vertex shader V_ }. That is, a synchronization scope would be the set of actual operations across the relevant pipeline stages.

The consensus seems to be that the first definition is correct. For example, my reading of the answer to this StackOverflow question (https://stackoverflow.com/questions/63587925/what-happens-when-srcstagemask-specifies-a-stage-which-is-not-in-the-pipeline-of) seems to indicate definition 1.

Another example is the blog post at https://themaister.net/blog/2019/08/14/yet-another-blog-explaining-vulkan-synchronization/ in which the discussion of execution dependency chains also seems to imply definition 1.

However, assuming definition 1 is the intention, this seems to potentially present an issue with the definition of _execution dependency_ in S 7.1. Execution and Memory Dependencies of the Vulkan spec.

The spec states:

> Let A and B be separate sets of operations.
>
> Let S be a synchronization command.
>
> Let AS and BS be the synchronization scopes of S.
>
> Let A' be the intersection of sets A and AS.
>
> Let B' be the intersection of sets B and BS.
>

If the synchronization scopes AS and BS are sets of _pipeline stages_ according to definition 1, then the use of the term _intersection_ seems like it doesn't match the standard mathematical meaning of set intersection. I.e. AS would contain pipeline stages and A would contain operations, so we are taking the intersection of sets containing different types of objects. Is the spec using the term _intersection_ in a more informal sense rather than the specific mathematical concept of set intersection?

I'd really appreciate any insight into whether definition 1 or 2 is correct, and if definition 1, then how should the term _intersection_ be interpreted?

Contributor guide

Open the contributing guide

Research direction

Start with Section 7.1, “Execution and Memory Dependencies,” and the quoted definitions of synchronization scopes and intersections. Compare the specification wording with the linked Stack Overflow answer and blog post, then determine what clarification is needed so the intended meaning and use of “intersection” are unambiguous.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.