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

Add provisional key to grammar #464

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

spencer-lunarg
Copy link
Contributor

@spencer-lunarg spencer-lunarg commented Nov 13, 2024

closes #460

The idea is like VK_ENABLE_BETA_EXTENSIONS the consumer of the headers can now consume the SPIR-V if they desire ( by adding something like add_compile_definitions(SPV_ENABLE_BETA_EXTENSIONS) to their build)

Open to suggestions on other ways to go about this

@spencer-lunarg spencer-lunarg force-pushed the spencer-lunarg-provisional branch 2 times, most recently from 75ce22d to cfe070f Compare November 13, 2024 05:30
Comment on lines 127 to 128
virtual std::string enumProvisionalStart(const std::string& name) const { return ""; };
virtual std::string enumProvisionalEnd(const std::string& name) const { return ""; };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
virtual std::string enumProvisionalStart(const std::string& name) const { return ""; };
virtual std::string enumProvisionalEnd(const std::string& name) const { return ""; };
virtual std::string guardIfProvisionalStart(const std::string& name) const { return ""; };
virtual std::string guardIfProvisionalEnd(const std::string& name) const { return ""; };

just to convey better the function checks before emitting, otherwise it would be better to hoist the check out of the function

@spencer-lunarg
Copy link
Contributor Author

Thinking about this for a night, I realize maybe the #ifdef in the header isn't needed

To my knowledge what is breaking people is not so much having some AMDX extension change in the header, but actually when people are parsing the grammar themselves.

Maybe the simpler first step is to just add the provisional to the grammar

@Naghasan
Copy link
Member

Maybe the simpler first step is to just add the provisional to the grammar

Make sense and I agree. We only generated enums and utils against this enum. So if a user of the generated headers needs to guard a provisional spec they'll need one on their side anyway.

@alan-baker
Copy link
Contributor

Everything related to SPV_KHR_untyped_pointers is also provisional.

@spencer-lunarg
Copy link
Contributor Author

Everything related to SPV_KHR_untyped_pointers is also provisional.

good catch, added

Copy link
Member

@Naghasan Naghasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks Alan

@bashbaug
Copy link
Contributor

We discussed this PR in the November 13th teleconference. Everything looks reasonable, but it'd be nice to have an example using these provisional additions to the grammar before merging to increase confidence it has everything that we need and so we don't make changes again.

@spencer-lunarg do you plan to use the provisional key in the validation layers? If not, maybe we should resurrect the header changes?

@dneto0
Copy link
Contributor

dneto0 commented Nov 15, 2024

This docs for the JSON grammar should be updated too.
See https://registry.khronos.org/SPIR-V/specs/unified1/MachineReadableGrammar.html

Although I'm having trouble finding the source for that (!)

@dneto0
Copy link
Contributor

dneto0 commented Nov 15, 2024

What exactly does "provisional" mean, and what is going to act on it? I feel it's a little loose.

This docs for the JSON grammar should be updated too. See https://registry.khronos.org/SPIR-V/specs/unified1/MachineReadableGrammar.html

Although I'm having trouble finding the source for that (!)

oh, it's in the Khronos-internal SPIR-V spec repo under specs/MachineReadableGrammar.asciidoc

@bashbaug
Copy link
Contributor

What exactly does "provisional" mean, and what is going to act on it?

Good question. The name "provisional" comes from "provisionally ratified", but I think it's being used to mean "hey this isn't final, so it might change or go away".

If we update the header generation scripts to act on it we could add preprocessor guards around the "provisional" features, to provide a way for compilers or tools to opt-out of the features that are likely to break compatibility for example (see #460).

Maybe we should use a different name instead?

This docs for the JSON grammar should be updated too.

Yep, agreed, and @Naghasan already filed a Khronos issue so this doesn't slip through the cracks. Thanks for caling this out though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add provisional information in the grammar
5 participants