-
Notifications
You must be signed in to change notification settings - Fork 286
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
Please document JSON file format compatibility rules #248
Comments
Or, trying to rephrase that in a way that is maybe more suitable for both layers and ICDs: It is safe for a consumer to load manifest files with a major and minor version that it understands, and a micro version that is newer that the consumer understands (micro versions will not introduce incompatible changes that require the loader to be changed). It is not safe for a consumer to load manifest files with a (major, minor) version pair that it does not understand (major or minor versions may introduce incompatible changes that require loader changes). |
I think I see what you're saying. The statement:
is a little strange given that the version is the same for the layer and ICD manifests (and they can be combined). We could change that language. I would think we should go with something along the lines of:
Does that sound good to you? |
For some context that I should probably have mentioned first, I'm working on some code to pick up Vulkan ICDs from the host system outside a container, and make them available inside the container. To do that, I need to be able to enumerate ICDs in the same way the loader would, and work out which shared library they refer to, without actually loading them (which is why I'm not using the reference loader itself) - and I need to be able to distinguish between JSON files that it is safe for me to load (those where I can assume that the format is compatible with 1.0.0), and JSON files that I can't assume I'm understanding correctly (because they were written to a future version of the specification). The rule that's documented in GLVND/EGL is that a 1.0.0 parser can safely read any 1.0.x JSON file (where 1.0.x is allowed to add new non-critical fields, but only if a 1.0.0 parser can gracefully degrade by ignoring them), whereas a JSON file labelled as format 1.1.x or 2.0.x is allowed to contain incompatible changes (fields that would cause broken behaviour if ignored, or fields that changed their meaning) that would break a 1.0.0 consumer, so 1.0.0 consumers must consider 1.1.x or 2.0.x JSON files to be an error. What I was hoping for is a similar compatibility/incompatibility rule for Vulkan ICD JSON files. I'm not currently looking at layers in any detail, but it would probably make sense to have a similar compatibility/incompatibility rule for layer JSON files, and it would probably make things simpler if it is literally the same rule. Or when you say "Furthermore, the file_format_version will not affect the ICD", do you mean the rule is that for ICDs specifically, it's safe for a 1.0.0 parser to load any ICD JSON file, regardless of file_format_version? (That would mean that future format versions in ICD JSON can add new fields, as long as it would be valid for an existing consumer to fall back by ignoring them - but they cannot change the meaning of an existing field, or add new fields where it would be wrong for a consumer to ignore the new field.) |
Apologies for not responding. Yes, the general pattern for ICD manifests is that 1.0.x means only optional fields are to be added to the manifest format. Currently, there are two optional fields, one for specifying if the driver is a 'portability driver' and one for the architecture of the driver (32 or 64 bit). I'm trying to think of a resolution to the issue, would documentation that the stated intend of versioning is to follow the above pattern? |
I'm looking into resolving this issue, and the fact that maintaining compatibility between versions has not been consistent makes it more difficult. For example, Layer version 1.0.1 allows manifests to contain a node called "layers" containing an array of individual layers, rather than a single "layer" node. That means any consumer that only knows about 1.0.0 would be unable to use manifest files from 1.0.1 using the "layers" node. Incrementing the patch version certainly shouldn't cause such breakages but here it has. (Although, the 1.0.1 came out in 2016/2017, is easy enough to implement, so this only not a major concern). Driver (ICD) manifests are much better in this regard. 1.0.0 and 1.0.1 are the only versions and the newer one adds optional components that can safely be ignored by 1.0.0 consumers. A parallel effort to this is PR #1273 which adds schema files for each manifest version (both layer & driver). This greatly enhances the ability to define what is in each version, but it does not address whether consumers can use manifests from versions newer than what they were compiled with. I'm thinking of using the following language to define the compatibility.
Criticism & comments are welcome. |
Thanks for documenting the JSON file format specification - it's a useful resource, and I'm now trying to add a similar (but simpler) spec to GLVND for the EGL ICDs.
https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#icd-manifest-file-format documents that the current file format is 1.0.0, but does not document what formats a consumer can assume to be compatible with the current format.
Similar code in GLVND says this:
If the intention is to have the same versioning policy as GLVND/EGL, perhaps something like this would be appropriate:
(I'm not sure what the intended distinction is between major and minor versions, if an increment to the minor version is allowed to include incompatible changes.)
The text was updated successfully, but these errors were encountered: