-
Notifications
You must be signed in to change notification settings - Fork 259
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 'aliases' field to show symbol aliasing relationship #138
Conversation
It's common to pull symbols first introduced in extensions to the core spec when SPIR-V version bumps. For such cases, the underlying value remains the same; it's just that we introduce a new symbol (without extension suffix) for it. Thus far we have been creating a entire new case for such cases incorporated into core. It's cluttering the grammar and complicates downstream consumers because downstream consumers need to understand the relationship. It's also quite confusing and error-prone: when introducing a new symbol, it can have different fields than the original one, either meaning subtle differences or caused by oversight. Instead, this commit introduces an 'aliases' field to properly show the relationship between symbols. Other fields describing the value, including 'version', 'extensions', etc., are cleaned up to make sure the canonical symbol collects all the information from duplicated cases. Now if a value has both 'version' and 'extensions', it means the value is available either starting from the given version, or with any of the extensions.
Thanks Lei. The aliases addition look good, but I think it's too early for removing the differences (union-ing the content) between the duplicated entries. Potentially, I believe, some differences are intentional between the duplicated entries, giving them value (e.g., the suffix comes from extension X, while no suffix comes from core). Copying in the multi-step prescription from the closed PR:
The point of the first one or two steps is that it can't break anything, because it's only a new field being added. Adding new entries with existing field names will change the way existing tools behave. I was considering (but failed to write explicitly in those steps) that such union-ing was part of the last step of removing redundancies. Can we have a PR that just adds a new field, to give tooling a chance to catch up, before changing existing fields in existing entries? |
Based on my observation, the grammar is inconsistent as for how it handles such "duplicated" entries.
So IMO this relationship is already broken; therefore downstream tooling is already likely in a confused or subtly broken state that needs to be fixed. I can certainly put up a PR to only strictly add |
Yes, it is logical, but I've been bit a few times recently with logical changes still unintentionally breaking consumers. There are some ad hoc things going on, and having the specification get printed differently would also deserve doing a diff and a change log entry explaining the differences. The solid thing to do is first add the new information, give tools a window of time to react/code to that, and then switch over to the final correct method. This will decouple, e.g., specification publication schedule from the schedule of this series of PRs. [edit: I'm not saying the one-off code has to be written, that can still be skipped.] This will result in a one-time change in behavior/specification for this change instead of two times. |
closing in favour of #447 |
It's common to pull symbols first introduced in extensions to the
core spec when SPIR-V version bumps. For such cases, the underlying
value remains the same; it's just that we introduce a new symbol
(without extension suffix) for it. Thus far we have been creating
a entire new case for such cases incorporated into core. It's
cluttering the grammar and complicates downstream consumers
because downstream consumers need to understand the relationship.
It's also quite confusing and error-prone: when introducing a new
symbol, it can have different fields than the original one, either
meaning subtle differences or caused by oversight.
Instead, this commit introduces an 'aliases' field to properly
show the relationship between symbols. Other fields describing
the value, including 'version', 'extensions', etc., are cleaned
up to make sure the canonical symbol collects all the information
from duplicated cases. Now if a value has both 'version' and
'extensions', it means the value is available either starting
from the given version, or with any of the extensions.