News for hackers. Stuff that matters.
Re:Apple proposes new web 3D graphics API by brians on Tuesday February 07, 2017 @07:12PM (#13594369)
Vulkan isn't designed for adversarial input. The web language has to be. That alone is likely to require a ground-up redesign.
Re:Apple proposes new web 3D graphics API by boardwaalk on Tuesday February 07, 2017 @07:45PM (#13594580)
But OpenGL wasn't either. I'd like to hear concrete examples of how it couldn't be made workable. There are already validation layers that do a pretty good job of checking for bad usage.

Especially since things like NaCl exist(ed) which are inarguably lower level and still safe.

I think it's folly to create a whole new API before evaluating the option of using Vulkan.

Re:Apple proposes new web 3D graphics API by om2 on Tuesday February 07, 2017 @08:09PM (#13594761)
We did evaluate the option of using Vulkan. So have others. It's not even necessarily off the table, we just don't think it is the best design approach.

If you are very interested in the details of API design choices, then I'd suggest joining the Community Group. Anyone can join!

Re:Apple proposes new web 3D graphics API by pjmlp on Wednesday February 08, 2017 @02:55AM (#13596622)
Which is a good example why I don't have any issues with native code on OpenGL ES 3.x mobiles, while Chrome with WebGL is just choppy and dropping frames left and right.
Re:Apple proposes new web 3D graphics API by ThisIs_MyName on Wednesday February 08, 2017 @11:37AM (#13599591)
Naw, that's happening because you have a JS thread doing everything. Native code on OpenGL ES is structured very differently.
Re:Apple proposes new web 3D graphics API by ioquatix on Tuesday February 07, 2017 @07:56PM (#13594664)
I'd argue that Vulkan IS designed for adversarial input. It deliberately provides a layer mechanism within the driver for validation of function calls. It's trivial to create your own layers and they can be used to validate EVERY entry point into the Vulkan driver.
Re:Apple proposes new web 3D graphics API by Rusky on Tuesday February 07, 2017 @10:31PM (#13595459)
Validation layers were created so drivers could remove checks to improve performance. And regardless, properly handling adversarial input is much more involved than just a validation layer.
Re:Apple proposes new web 3D graphics API by ioquatix on Tuesday February 07, 2017 @10:55PM (#13595593)
Yes, you are right, but solving the problem of adversarial input is probably NP. A validation layer can intercept every API call and validate it. It's probably the best you can do. The nice thing about it, is that you could actually use it in many different contexts, since, you know, Vulkan makes it a standard feature of the driver.
Re:Apple proposes new web 3D graphics API by Rusky on Wednesday February 08, 2017 @01:31PM (#13600711)
It's not NP (whatever that means) if you're allowed to change the API instead of just inserting checks at each call.

Besides, Javascript doesn't really need driver support to intercept function calls...

Re:Apple proposes new web 3D graphics API by ioquatix on Wednesday February 08, 2017 @04:13PM (#13602179)
NP means non-determinstically polynomial. Validating a GPU shader is undecidable if it include flow control. This is a problem for security.

> if you're allowed to change the API instead of just inserting checks at each call.

The only case is where you simply make the API so limited that it becomes decidable, e.g. remove all backwards flow control and recursion.

> Besides, Javascript doesn't really need driver support to intercept function calls...

Nope, it doesn't, but it makes for a more flexible approach when there is an existing model and implementation (validation layer) which supports this approach.

Improving the quality of the validation layer means that everyone benefits. It's also a massive job and thus, that something already exists, and is standardised, is a good approach.

Re:Apple proposes new web 3D graphics API by Rusky on Wednesday February 08, 2017 @05:32PM (#13602835)
I know what NP means, my parenthetical implied that you used it in a way that made no sense.

Undecidable control flow does not inherently make validation undecidable, or NP, or anything else really. The key (like with any sort of type system) is that it's okay to reject some subset of valid programs in exchange for easy enforcement of the invariants you need.

Re:Apple proposes new web 3D graphics API by ioquatix on Wednesday February 08, 2017 @02:16AM (#13596449)
> remove checks to improve performance

In addition to my other points, the Vulkan validation layers are objectively (and IMHO significantly) better for debugging than OpenGL ever was. It's not just to improve performance. The debugging and development experience is significantly improved.