Gradients Are the New Intervals

mattkeeter.com

147 points by surprisetalk 17 days ago


kragen - 16 days ago

This is very exciting! It seems like a lot of the interval stuff is bringing to fruition my idle speculations from 6 years ago in https://dercuano.github.io/notes/interval-raymarching.html. I'll have to read this carefully to see if it's actually the same approach or a different one that uses the same algebras.

yorwba - 16 days ago

The suggested normalization procedure, even with the ad-hoc fix for gradient discontinuities, doesn't actually ensure that the resulting function is 1-Lipschitz unless the gradient of the gradient magnitude vanishes. The signed-distance functions considered in the article seem to have piecewise constant gradient magnitudes (so are L-Lipschitz, just with L > 1) except for inside the "r", but for less well-behaved functions, higher order derivatives might start to matter.

guyomes - 16 days ago

A generalisation of this idea is known as Taylor model in 1998 [1]. It might even have been known in 1984 as neighborhood arithmetic [2]. The generalisation works by taking a Taylor expansion of the function up to order n, and then by using a bound for the remainder using bounds on the partial derivatives of order n+1 [3].

[1]: https://www.bmtdynamics.org/cgi-bin/display.pl?name=rdaic

[2]: https://books.google.fr/books?id=2zDUCQAAQBAJ

[3]: https://en.wikipedia.org/wiki/Taylor%27s_theorem#Taylor's_th...

diabllicseagull - 16 days ago

I've worked on a patent some years ago about SDF CSG Tree pruning and constant radius filleted blends. Sadly patents don't get the same visibility journals enjoy.

https://patentimages.storage.googleapis.com/7a/73/2d/8d2eeca...

3abiton - 16 days ago

It started interestingly, but then

> This blog post assumes a vague understanding of implicit surface rasterization, and how interval arithmetic is used to both skip regions of space and simplify complex expressions.

Can anyone give me a quick rundow of the article?

sfpotter - 16 days ago

Cool post.

The Lipschitz trick here relies on the assumption that the gradient has magnitude 1 everywhere. Evaluating the SDF in a box and using the Lipschitz property lets you get some quick estimates on the range of the SDF over the box.

This is a close cousin of the monotonicity interval inclusion: e.g., if f'([a, b]) > 0, then f([a, b]) is a subset of [f(a), f(b)]. Rounded interval arithmetic makes this rigorous on a computer; you can also do it in multiple dimensions, with higher derivatives, successively tightening inclusions for lower derivatives, etc.

ajkjk - 16 days ago

Don't know much about this kind of thing, but it seems like it would be useful, if possible, to store the actual displacement (dx,dy) vector to the surface instead of just its magnitude, the SDF. I can't evaluate the tradeoff of storing an extra value, but it seems like it would make the recursion in the first section a lot easier: when you want to test if a particular box contains the object, if [v+d, v-d] contains 0, you would know a lot more where to look: you need only continue the iteration on subdivisions that are in the correct direction.

fph - 16 days ago

One of the benefits of intervals is that you can ensure your results are correct irrespective of floating-point errors, if you carefully round all computations in the correct direction.

I don't think you can ensure that with gradients though: if f and f' are computed in machine arithmetic, cancellation errors might pile up.

constantcrying - 16 days ago

>In this case, "the Lipschitz property" means that the gradient of the distance value is bounded

This is total nonsense. The point of Lipschitz continuity is that it is more than continuity and less then differentiability. If you assert that it is differentiable the concept looses all meaning. It is specifically interesting because you do not have to assert differentiability.