290 likes | 309 Views
In the realm of interactive entertainment, the demand for realism has pushed real-time physics engines to their limits. This research delves into leveraging object-level locality to improve the performance of physics simulations. By exploring value prediction techniques and analyzing object movement patterns, the study aims to enhance instruction-level parallelism in real-time physics applications. The utilization of Open Dynamics Engine (ODE) and custom predictors sheds light on how predicting object values can boost simulation efficiency. Results indicate the prevalence of adjacent and trivial values, leading to the construction of tailored predictors to optimize performance in physics simulations.
E N D
CS 194 Research Results Paul Salzman Advisor: Professor Glenn Reinman Winter 2007 - Spring 2007
Outline • Motivation • Initial Project: Polymorphism • Idea • Progress and Problems • Final Project: Object Level Locality • Idea • Previous Work • Methodology • Results
Motivation: Interactive Entertainment • Simulates virtual worlds with objects and characters that interact. • Large computational requirements with the increasing demand for realism. • Interactions previously relied on predefined animations. • Real time physics engines currently used to dynamically calculate interactions. • These systems can use all the performance boosts possible to make them more feasible.
Initial Project: Polymorphism • Explore a currently proposed dedicated physics architecture, ParallAX. • Explore how different facets of interactive entertainment can be applied to a dedicated architecture.
Initial Project: Progress • Investigating SESC as a viable architectural simulator. • Creating an architecture with heterogeneous cores in SESC. • Hard coding in the ParallAX topology into SESC.
Initial Project: Difficulties • Lack of up to date simulator documentation. • Key out-of-the-box simulator feature, network communication latency modeler, removed without mention. • Simulator construction occupying far too much time.
Initial Project: Experience • Working in a large, open-source code base with bad documentation. • Academic and industry research projects do not always end successfully. • Learn when to pursue a new idea.
Object Level Locality in Real-Time Physics Applications • Idea: Objects in motion stay in motion. • Can this lend to locality at the object level in physics simulation? • If so, how can this be harness to speed up real-time physics simulation?
Value Prediction in Physics Simulation • We will observing load values pertaining to physical objects in the simulator. • Loads are long latency instructions. • Accurately predicting loads can increase instruction level parallelism and in turn performance.
Instruction Level Parallelism (ILP) • Independent instructions can be executed simultaneously. • Data dependencies prevent the processor from working on the chain of dependent instructions. • Predictions allow the processor to attempt useful work past data dependencies.
Previous Work • Value Prediction has been shown as a viable option for performance enhancement. • Various implementations of value predictors have been explored. • Methods to improve which instructions to predict and how to predict with confidence. • Correlations between High-Level information and lower level locality have been found
Methodology • Profile object info in a real-time physics simulator • Observe locality in values associated with physical objects • Construct predictors based on the locality information • Observe the performance of these predictors
Open Dynamics Engine (ODE) • Open source physics engine. • Used commercially on the PC, XBOX 360, and other IE platforms. • Large code library, hone in on hotspot functions using gprof. • Use a complex benchmark to exercise the physics engine’s functionality.
Benchmark • Many entities in the enviornment. • Collisions between multitudes of stacked boxes, rigid bodies, and rag doll constraint humanoid objects. • Used with permission from Dr. Thomas Yeh.
Profiling ODE • gprof utility • Place trace code in the hotspot function • Track each object’s values • Associate values with the objects id (address) • Maintain an index via the PC as well as with the (PC XOR object id) • Maintain chronological order
Observing and Analyzing Locality • Parse through the trace code observing locality with respect to the two indexing methods. • Check for adjacent values • Stride values • Trivial values (0,1,-1)
Constructing/Analyzing Predictors • Use the locality data to construct pertinent predictors. • Run the various predictors through the trace data to observe their performance.
ODE Hotspots • 43%: dBoxBox - Bounding Box collision function • 18%: collideAABBs – General geometric collision function • These two functions were chosen to profile. • The load instructions observed scale up to ~40% (rough value)
Locality Results • Charts
Locality Results • Charts
Locality Results • Adjacent values appear very often. • Stride values do not appear (intuitively runs with the idea of a physical object) • Trivial values appear in varying forms across the functions. • Different trivial values may appear for different physics engines.
Predictor Construction • Adjacent Values • Last Value Predictor • Simple Implementation, • Finite Context Method Predictor (FCM) • Maintains small table of previous values • Tracks appearance of tables values • Chooses most likely candidate • Trivial Values • 0 and -1 predictors. • Extremely simply implementation.
Predictor Construction (cont’d) • Same two functions will be profiled. • The predictors will be indexed in the same fashion as the locality data • By PC • By (PC XOR object ID) • No limit will be placed on the size of the predictor tables • Avoids constructive and destructive aliasing.
Predictor Results • FCM2 appears to function most accurately. • Predictors indexed by (PC XOR object ID) act exactly as zero value predictors • By convention, a predictor that has not seen a value will guess zero. • As expected, trivial value predictors have hit rates equal to the appearance of their trivial values in the locality data.
Summary – Objects in Motion… • Object level locality does appear in real-time physics simulators. • This data can be leveraged by further research to increase ILP in IE architecture. • Next Step: Pursuing the connection between the high-level data to architecture.
References • [1] Brad Calder, Glenn Reinman, and Dean Tullsen. Selective Value Prediction. In 26th International Symposium on Computer Architecture, May 1999 • [2] Mikko Lipasti, Christopher Wilkerson, and John Shen. Value locality and load value prediction. In Seventh International Conference on Architectural Support for Programming Languages and Operating Systems, 1996. • [3] Open Dynamics Engine. http://ode.org/. • [4] Yiannak Sazeides and James E. Smith. The predictability of data values. In 30th International Symposium on Microarchitecture, pages 248-258, December1997. • [5] Thomas Y. Yeh, Petros Faloutsos, and Glenn Reinman. Accelerating Real-Time Physics Simulation by Leveraging High-Level Information. In UCLA CSD-TR 060023, 2006.