Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structural semantics is stronger #32

Open
vili-1 opened this issue Oct 20, 2021 · 4 comments
Open

Structural semantics is stronger #32

vili-1 opened this issue Oct 20, 2021 · 4 comments

Comments

@vili-1
Copy link
Collaborator

vili-1 commented Oct 20, 2021

For this example, spirv-val says:

error: line 21: block <ID> 12 branches to the selection construct, but not to the selection header <ID> 11
  %12 = OpLabel

This is due to the fact that the semantics of structural dominance is more restrictive: in spirv-val semantics block 9 is member of selection headed by 11 but in structural semantics it's not because %9 is not structurally dominated by %11

cfg_1
Archive 4.zip

@afd
Copy link
Member

afd commented Oct 20, 2021

Nice example!

I think this is acceptable.

Could you find the simplest possible example that illustrates this phenomenon and add it to the structural dominance doc?

Thanks

@vili-1
Copy link
Collaborator Author

vili-1 commented Oct 23, 2021

While trying to simplify the example above, I noticed something strange.
Just take a look at the graphs below: for the first one spirv-val is complaining that %11 branches to the selection construct, but not to the selection header %10. Firstly, node 9 (where 11 is branching to) is not part of the selection headed at 10 because it is dominated by an outer constructs’ merge blocks. Am I right? The spec by the way is not crystal clear when the outer is a switch/case.
But even if we take for granted what spirv-val says, that %11 branches to the selection construct, why if we remove the node 12 the graph is then accepted by spirv-val?

rejected

Archive.zip

accepted
Archive 2.zip

@afd
Copy link
Member

afd commented Oct 26, 2021

To me this seems like a bug in spirv-val - I don't think there is anything wrong with the example that spirv-val rejects. It would be good to include this in the doc under the "synthetic" section.

@vili-1
Copy link
Collaborator Author

vili-1 commented Jun 24, 2022

Alan acknowledged that spirv-val should accept the example above (email 5 Apr). This is one of the mismatches here: https://docs.google.com/document/d/1B2AEGChk4VgOzjWwScb1Hc580WP_nWu1ONcpOpLB0ig/edit

@afd afd added the modelling label Oct 19, 2022
@afd afd transferred this issue from another repository Oct 19, 2022
@afd afd changed the title Σtructural semantics is stronger Structural semantics is stronger Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants