-
Notifications
You must be signed in to change notification settings - Fork 472
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 for 3D Tiles Next #563
Comments
This feels like the most natural starting point – were there any reasons that continuing to develop and extend the existing 3D Tiles validator might not be ideal? The glTF Validator doesn't currently have a clear process for third-party extensions (other than to fork the repository) that is probably a limitation to be aware of and/or request changes if needed. |
The current validator may or may not be a solid foundation. I am not aware as to how complete it is or how well written it is or how well it would integrate into other tools. @lilleyse may know best. |
Some other notes from past discussions about this:
|
I'd feel pretty strongly that a typed language is valuable here. E.g. TypeScript has exhaustiveness checks that can help ensure edge cases are not missed. From there it probably comes down to tradeoffs between having code that runs in any environment (hard to beat C/C++ here) and something that is practical to maintain. Targeting WASM builds could be a good compromise. Languages with good WASM tooling include:
But certain tasks, like disk read/write, don't happen in WASM and would require environment-specific wrappers. |
Since the 3D Tiles validator calls the glTF validator it makes the C++/Rust route a little less attractive knowing we won't have a full native solution. For that reason I'm leaning towards TypeScript. The current validator doesn't do a whole lot, and much of what it does do - validating batch tables, feature tables, etc - will no longer be relevant. So I think starting fresh is the right course of action here. |
There are a bunch questions regarding a 'revival' of a 3D Tiles validator, on different levels. Referring to the current The question about the programming language and environment is not answered yet. The glTF validator is written in Dart. The language is not sooo widely used, but it apparently has some desirable capabilities for such a project: It is possible to publish the validator as an npm package, for node and the browser (to create the drag-and-drop validator), or to compile it into an executable (yes, really ... an TypeScript was mentioned a few times. I have not yet used it extensively for actual projects, and don't know some things that one would have to know in order to make an informed decision. This refers to everything that is related to deployment, testing, but also to IO. (Is it possible to build something, with reasonable effort, that can either run at the command line and receive local file paths or receive data from a drag-and-drop into a browser? I'll have to read more about that...). I started a few experiments. These are currently drafted in TypeScript. But some of the following points are technical ones that are just so above the level of the language. The validator should have some sort of standardized, structured format for reporting issues. The current validator only prints a single error message, returned as a string. When there are multiple errors, this would imply some sort of "Fix-Check-Fix-Check...." cycle. An alternative would be to have something like this (from my current drafts - yes, it's certainly similar to the glTF validator output, but ... when it makes sense, then it does make sense...) :
The Note: The validator currently has a function
to the
But whether or not (or how) the list of issues from the glTF validator should or could be integrated into such a report has to be discussed. The JSON schema validation could leverage an existing validator. Validating the JSON against the JSON schema is tedious. Manually implementing a validation that covers what could be covered by the schema is nearly impossible. (For example: The current validator checks whether the We have put a lot of effort into the JSON schemas, and we could now benefit from that (and maybe even improve them if we encounter any issues). In my local experiments, I just wrapped
and this essentially comes for free. (Except for some quirks to feed the schema into ajv, but nothing big). It would fix issues like CesiumGS/3d-tiles-validator#126 , CesiumGS/3d-tiles-validator#208 , and probably many others that are prefixed with If we did this, we could focus the remaining validation work on things that can not be covered with the JSON schema. It may be hard to carve out what that is, exactly, but some of that is already known...: Some parts of the current validator should be salvaged. Even if the validator is supposed to be "started fresh", there are things like the binary header checks or bounding volume in bounding volume checks that either should be used directly, or be ported to the target language. The validator should play nicely with extensions This is important, but a very general achitectural question. (It is also not yet fully answered for the glTF validator. I consider this as a hint that it is not only 'not trivial', but potentially really difficult...). It might be necessary to think about some sort of a 'plugin concept' here, to easily add validation steps or passes for new extensions in a modular, non-invasive form. |
Ideally they would be separate repos, though I'm not sure how to do that without losing the commit history and issues. It would also be nice if the new validator started as a clean slate. I wonder if we could rename
Agreed, and the proposal here seems like a good start, and similar to the glTF validator.
That's what we originally did but it becomes easy to lose track of what the schema validation checks vs. what the code checks. It also makes it hard to have personalized error messages for schema validation failures. It can be a good place to start though.
Agreed - any utility functions can be ported over.
👍 |
That's generally true. There is an option for addressing this, to some extent: With
The message is ... confusing, to say the least. (It makes sense, due to the But it is possible to sneak a custom error message into ajv (using the
which turns the error into this:
But there are still some valid concerns:
The latter refers to the fact that in typescript, the method signatures are still looking like
with There are several options now:
I'm not sure whether introducing the specific types is really worth the effort, considering the manual overhead for building the actual instances. On the other hand, having a (typed) implementation of 3D Tiles could be nice, and offer a sensible context for types like |
A short update, to summarize the current direction that I've taken from the previous comment:
|
Draft PR of the new validator here: CesiumGS/3d-tiles-validator#222 Looking for any early feedback! |
The validator for 3D Tiles 1.1 now lives at https://github.com/CesiumGS/3d-tiles-validator/ - further discussion can happen there. |
Just like the glTF Validator, we should plan a validator for 3D Tiles Next.
I believe the glTF Validator is a key reason that the glTF ecosystem is robust. It is a handy tool to use ad hoc and some applications even embed it, e.g., validate after uploading a model, validate if import fails, integrate into unit tests, etc. Also, developing the glTF validator significantly helped harden the glTF specification and fix probably dozens of my own mistakes. 😟
Seems like we should evaluate how we would go about this, e.g.,
It would be great to brainstorm a game plan. I don't think it would be complete for #556.
The text was updated successfully, but these errors were encountered: