Adaptive Mesh Approach for Predicting Algorithm Behavior with Application to Visibility Culling in Computer Graphics

Reading time: 6 minute
...

📝 Original Info

  • Title: Adaptive Mesh Approach for Predicting Algorithm Behavior with Application to Visibility Culling in Computer Graphics
  • ArXiv ID: 0903.2119
  • Date: 2009-03-12
  • Authors: Researchers from original ArXiv paper

📝 Abstract

We propose a concise approximate description, and a method for efficiently obtaining this description, via adaptive random sampling of the performance (running time, memory consumption, or any other profileable numerical quantity) of a given algorithm on some low-dimensional rectangular grid of inputs. The formal correctness is proven under reasonable assumptions on the algorithm under consideration; and the approach's practical benefit is demonstrated by predicting for which observer positions and viewing directions an occlusion culling algorithm yields a net performance benefit or loss compared to a simple brute force renderer.

💡 Deep Analysis

Deep Dive into Adaptive Mesh Approach for Predicting Algorithm Behavior with Application to Visibility Culling in Computer Graphics.

We propose a concise approximate description, and a method for efficiently obtaining this description, via adaptive random sampling of the performance (running time, memory consumption, or any other profileable numerical quantity) of a given algorithm on some low-dimensional rectangular grid of inputs. The formal correctness is proven under reasonable assumptions on the algorithm under consideration; and the approach’s practical benefit is demonstrated by predicting for which observer positions and viewing directions an occlusion culling algorithm yields a net performance benefit or loss compared to a simple brute force renderer.

📄 Full Content

Although it is possible to give bounds for different aspects of many algorithms' runtime behaviors (like for running time or memory consumption) by formal analysis, the input can heavily influence the actual behavior (e.g. algorithms for real-time rendering of virtual 3d-scenes).

To evaluate algorithms for practical applications, in which the input (or the characteristics of the input) is known, a more detailed estimation of the algorithm’s behavior s necessary in order to

• select the appropriate algorithm for the given setting (hardware, application and input).

• find suitable parameters to adapt the selected algorithm to the setting.

• identify bottlenecks and starting points for further improvements of the algorithm.

If the number of possible inputs is sufficiently small, it may be possible to evaluate the observed property of the algorithm (e.g. the running time) for every input and use this as basis for the evaluation. But in most cases the input space is too big (e.g. all possible positions inside a virtual scene), so that only a few samples can be evaluated experimentally. For a simple uniform sampling approach, it is difficult to capture the structures the input may exhibit. Another common way in computer graphics is e.g. to select a camera path covering all relevant inputs manually. But if small changes in the input mostly lead to small changes in the behavior of the algorithm only, we can apply our adaptive sampling method. Thereby the input space is subdivided into regions, in which the algorithm behaves similarly. This subdivision can then represent an easy-to-handle model of the algorithm.

In the following, we i) present the method that creates this subdivision of the input. ii) prove that, if the function, which describes the behavior of the algorithm is Lipschitzcontinuous, it can be approximated by this method. iii) evaluate the method in the domain of real-time 3d rendering, in which we can make use of the distinct local coherence of many rendering algorithms.

The goal of our approach is to preprocess a given algorithm via blackbox queries at certain inputs, in order to quickly and approximately predict its behavior on other inputs. The data structure constructed during preprocessing is a hierarchical subdivision described in Section 2 and gives a kind of global picture of the algorithm under consideration with many applications to Algorithm Engineering (Section 2.1). The success of our approach is both proven formally in Section 3 (under reasonable analytical assumptions) and § demonstrated empirically on the Occlusion Culling problem in Computer graphics: see Sections 4, 5, 6 and 7.

Algorithm 1. Fix dimension d ∈ N, sample size k, so-called splitting threshold s > 0, and the unknown f : C ⊆ R d → R.

• Sample k arguments x 1 , . . . , x k ∈ C independently uniformly at random.

• Query values process of Algorithm 1 yields a piecewise constant function g, in which the locally constant parts constitute a hierarchical subdivision known in 2D as quadtree (indicated in Figure 1) and in 3D as octree. In particular, this g naturally comes with a very practical and efficient representation as a data structure: a hierarchical subdivision. That is, Algorithm 1 can be considered as preprocessing f for the following interpolation:

Algorithm 2. Fix a d-dimensional octree T over C as produced by Algorithm 1. Given x ∈ C, iteratively

• determine which of the 2 d subcuboids C ′ of C this input x lies in;

• proceed to this C ′ (i.e. to the corresponding subtree of T )

• unless C is already a leaf of T .

• In the latter case, return the constant value z of g on C.

Because of the exponential term 2 d , this approach can be efficient only for small values of d. (In Section 4 we will apply it for d = 2 1 2 : two spatial dimensions and a discrete directional one.) The piecewise constant function g, output by Algorithm 1 (and thus also the extrapolated values produced by Algorithm 2) can of course not be expected to approximate the given f in general. But Section 3 asserts that it does so for Lipschitz-continuous f and sufficiently large sample sizes.

Consider some algorithm A operating on (integral or continuous) inputs x from the cuboid C. Let f (x) denote the value at input x of some profileable quantitative property of A. This may for instance be running time, memory consumption, number of instructions etc. (Section 4 will for example consider the number of occlusion queries.) Then Algorithm 1 produces a hierarchical subdivision of C and piecewise constant approximation g to f from profiled values f (x) at ‘few’ adaptively sampled inputs x; and Algorithm 2 uses this data structure to approximately predict the value f (x) (i.e. the quantitative property of algorithm A) on other inputs x ∈ C. Now this approach cannot be expected to succeed all the time and for every A. On the other hand many practical algorithms (in particular those operating on continuous, e.g. floating point data) do exhibit

…(Full text truncated)…

📸 Image Gallery

cover.png

Reference

This content is AI-processed based on ArXiv data.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut