#include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · taichi as of 2018 taichi...
TRANSCRIPT
![Page 1: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/1.jpg)
#include <taichi>
Yuanming Hu MIT CSAIL
![Page 2: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/2.jpg)
What is Taichi?
2015 Random codebase of a computer graphics newbie
2016 Physically based Computer Graphics Library
2017 Computer Graphics Library
2018 Computer Graphics R&D Infrastructure
![Page 3: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/3.jpg)
Taichi as of 2018Taichi MLS-MPM-CPIC Simulator
SIGGRAPH 2018, SCA 2018
Narrowband Topology Optimization SIGGRAPH Asia 2018
ChainQueen Differentiable Physics Engine, Taichi-GPU
(in submission to ICRA 2019)
#include <taichi> Advanced Computer Graphics@ MIT & UW
Computational Methods for Physical Systems@ Dartmouth …
,
![Page 4: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/4.jpg)
What is the minimal time to have a hackable computer graphics application
deployed?
![Page 5: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/5.jpg)
What is the minimal time to have a hackable computer graphics application
deployed?
![Page 6: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/6.jpg)
What is the minimal time to have a hackable computer graphics application
deployed?
![Page 7: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/7.jpg)
What is the minimal time to have a hackable computer graphics application
deployed?
![Page 8: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/8.jpg)
What is the minimal time to have a hackable computer graphics application
deployed?
![Page 9: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/9.jpg)
What increases deployment time?
✦ Large files
✦ Long build instructions
✦ Missing hardware (e.g. GPUs)
✦ Missing/wrong/broken external software dependencies
✦ Long compilation time
✦ Compilation errors
✦ Linking errors
✦ Slow, long turnaround time
![Page 10: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/10.jpg)
Related Work
✦ Virtual machines
✦ smallpt (hard to read, no GUI) ๏ smallpssmlt ๏ smallppm
✦ shader toys (limited computational patterns)
✦ #include <os>
✦ …
![Page 11: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/11.jpg)
![Page 12: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/12.jpg)
taichi.h (Single C++ header)
#include <taichi> demo implementation cpp
~100 lines of code
![Page 13: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/13.jpg)
Is it even possible?
![Page 14: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/14.jpg)
multigrid.cpp
sparse_grid.h conjugate_gradient.h
cstdio unistd.h immintrin.h
![Page 15: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/15.jpg)
Amalgamation
✦ Analyze #include’s and simulate pre-processor (recursively) ๏ Do not include non-taichi files ๏ painful (a lot of corner cases), but doable
✦ Benefits ๏ Faster compilation/execution speed (sqlite.h/c) ๏ Single header - extremely portable
![Page 16: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/16.jpg)
Eliminating Hardware Dependencies
✦No GPU -> No OpenGL
✦Software rasterizer
✦painful to write, but worthy….
![Page 17: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/17.jpg)
taichi.h (Single C++ header)
#include <taichi> demo implementation cpp
~100 lines of code
Helvetica.ttf Go-Regular.ttf
…
![Page 18: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/18.jpg)
No, no, no… No extra files!
![Page 19: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/19.jpg)
![Page 20: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/20.jpg)
Microsoft Visual Studio: Fatal error C1091:
compiler limit: string exceeds 65535 bytes in length
![Page 21: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/21.jpg)
![Page 22: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/22.jpg)
Opening a Window
✦Need to show the bitmap in memory on screen
✦Cannot depend on Qt
✦Cross-platform: manual engineering for all platforms
✦Windows (C API)
✦Linux X11 (C API)
✦OS X (Cocoa - Objective-C only)
![Page 23: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/23.jpg)
taichi.h (Single C++ header)
#include <taichi> demo implementation cpp
~100 lines of code
cocoa_gui.m
![Page 24: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/24.jpg)
No Objective-C!
![Page 25: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/25.jpg)
Opening a Window (OS X)✦ Run Objective-C code with pure-C++
[window setAcceptsMouseMovedEvents:YES] -> call(window, "setAcceptsMouseMovedEvents:", YES);
![Page 26: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/26.jpg)
Finally….
![Page 27: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/27.jpg)
Examples: Topology Optimisation (120 LoC)
![Page 28: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/28.jpg)
Examples: MLS-MPM (88 LoC)
![Page 29: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/29.jpg)
Examples: MLS-MPM Tetris (140 LoC)
![Page 30: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/30.jpg)
Pros
✦ Extremely Portable
✦ Easy to read, understand, build and hack
✦ Relatively long compilation time (5-10 seconds)
✦ Not suitable for large projects
Cons
Practical applications:
prototyping/education/learning/proof-of-simplicity
![Page 31: #include taichi.graphics/wp-content/uploads/2018/11/include_taichi.pdf · Taichi as of 2018 Taichi MLS-MPM-CPIC Simulator SIGGRAPH 2018, SCA 2018 Narrowband Topology](https://reader030.vdocuments.site/reader030/viewer/2022040105/5e4b5e8a9334226c1a7f53da/html5/thumbnails/31.jpg)
10 seconds.
What is the minimal time to have a hackable computer graphics application
deployed?
Thank you! Questions are welcome!
Thank Andy, Tao, Liang, Beichen, Wojciech, Bo, Fanfu for testing & support