-
Notifications
You must be signed in to change notification settings - Fork 60
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
Validator and friends versioning policy #1
Comments
It would be awesome if the validator could validate against "all" versions (which would mean to implement the second of your listed strategies). But I can imagine that it will be difficult to organize this in view of possible future changes. When the RFQ for the validator was opened, I thought about this, and thought that there are several forms or "levels" of validation - most importantly:
The crucial thing is that they might be conceptually independent: The schema validation could be done in a form that is, in fact, independent of glTF: It could be implemented as a generic validator that takes an arbitrary JSON and an arbitrary (v03) JSON schema, and blindly does all the checks for invalid properties, missing The nice thing would be:
(Of course, the latter is a bit idealistic. E.g. the ID I haven't yet digged into the source code, and am not familiar with dart or the general approach you took. Do you validate against a schema, or did you "bake" the current schema into your validation code? |
Thanks for the feedback, @javagl! One of the goals for validation is to ensure that glTF asset won't trigger any runtime errors. This implies checking not only schema and IDs: actually we need to check correctness of all values which will be used as parameters in GL calls. The main issue with "blind" schema validation is that it's not possible to express lots of "sibling" properties limitations with it. E.g. (
Moreover, glTF extensions can add valid values for existing enums (see CESIUM_RTC). Currently, everything is baked into code with possibility to load extension validation code externally. |
Sure, these comments have just been initial thoughts. (I'm not even sure whether this is the right place to discuss the details. The basic question about the versioning policy could be answered independently of the general validation strategy. I just mentioned these points because I think that making the validation as version-agnostic as possible could avoid some hassle in the future. But if you think that this should be discussed elsewhere, just point it out). Regarding the given example: One could argue that one main problem here is that the schema simply cannot capture semantics. But that's why I thought that a clean separation could help to avoid mixing unrelated concepts. I'd consider all the checks that you described as "conceptual" checks (particularly, I don't see where Stage 1 refers to the schema). For example: In 1.0.0, the However, I see that this separation may not always be trivial, and maybe not even sufficient, maybe not even beneficial in all cases, and regardless of that, it probably makes sense to further split the conceptual checks into "intra-object" and "cross-object" checks. Some nitpicking side notes (because I think that a validator is a place where nitpicking is appropriate ;-))
I don't think this is the case. The
I think the constraint is in the other direction: A |
If an an asset conforms only to schema, we can't say anything on its validity. So I don't think there is any reason to have schema-only validation. Currently, schema validation is always the first step of Stage 1. If future spec updates make support of several versions troublesome, such separation could be done.
BufferView and Accessor Byte Alignment
There're both constraints, because |
The argument for the schema-only-validation mainly aimed at some sort of "separation of concerns": It could be done mechanically, and would handle changes like a missing (EDIT: Although, this would raise the question of whether the validator would bail out early, or try to eagerly detect all errors) However, I see that these points are rather high-level design issues, and maybe they can be tackled later (independent of the original question about the versioning). Regarding the alignment: So this is indeed justified with the use of an
in the |
Pull requests into the glTF
From the end user perspective, I totally agree here. I need to know that my engine or tool is getting validate glTF, not just valid with respect to what the JSON schema can represent. From a validator implementation perspective, totally up to @lexaknyazev. |
At the moment, we have glTF spec version
1.0.1
, withWebGL 1.0.3
profile (this also impliesGLSL ES 1.0
).First release version of Validator will obviously have version
1.0
. However numbering future versions could become a mess, because it's unclear should Validator's version be aligned with spec or not.Some possible strategies:
Ideas?
The text was updated successfully, but these errors were encountered: