# erichchan999/deformer architecture

> Architecture diagram of the GitHub repository erichchan999/deformer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/erichchan999/deformer
- Repository: https://github.com/erichchan999/deformer

## Overview

This C++ project compares four implementations of Houdini-style mesh peaking. The principal workflow opens a USD stage, extracts mesh topology and points, dispatches the same displacement operation through Eigen, std::thread, oneTBB, and CUDA, then writes the selected result back to USD. Tracy instrumentation supports performance comparison. The graph follows the calls visible in the sampled entry point and implementation files; CUDA kernel internals were not sampled, so their connection is documented by the CUDA host code rather than inferred from kernel details.

Main entry points: [`src/main.cpp`](https://github.com/erichchan999/deformer/blob/main/src/main.cpp) (Application entry), [`submodules/tracy`](https://github.com/erichchan999/deformer/tree/main/submodules/tracy) (Tracy instrumentation), [`src/DisplaceByNormalCuda.cpp`](https://github.com/erichchan999/deformer/blob/main/src/DisplaceByNormalCuda.cpp) (CUDA host implementation), [`src/DisplaceByNormalEigen.cpp`](https://github.com/erichchan999/deformer/blob/main/src/DisplaceByNormalEigen.cpp) (Eigen implementation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["USD mesh workflow"]
  node_input["USD input mesh<br/>[sphere.usd]"]
  node_runner["Application entry<br/>[main.cpp]"]
  node_meshdata["Mesh point and topology data<br/>[main.cpp]"]
  node_output["Exported USD stage"]
end

subgraph group_strategies["Displacement strategies"]
  node_strategy["Strategy interface"]
  node_eigen["Eigen implementation"]
  node_threads["std::thread implementation"]
  node_tbb["oneTBB implementation"]
  node_cuda["CUDA host implementation"]
  node_kernel["CUDA kernels"]
end

subgraph group_profiling["Performance profiling"]
  node_tracy["Tracy instrumentation"]
  node_profiler["Tracy profiler"]
end

node_user(("User"))

node_user -->|"runs"| node_runner
node_runner -->|"opens"| node_input
node_runner -->|"extracts"| node_meshdata
node_runner -->|"creates"| node_strategy
node_runner -->|"dispatches"| node_eigen
node_runner -->|"dispatches"| node_threads
node_runner -->|"dispatches"| node_tbb
node_runner -->|"dispatches"| node_cuda
node_cuda -->|"launches"| node_kernel
node_runner -->|"exports"| node_output
node_eigen -->|"instruments"| node_tracy
node_threads -->|"instruments"| node_tracy
node_tbb -->|"instruments"| node_tracy
node_cuda -->|"instruments"| node_tracy
node_profiler -->|"connects to"| node_tracy

click node_input "https://github.com/erichchan999/deformer/blob/main/geometry/sphere.usd"
click node_runner "https://github.com/erichchan999/deformer/blob/main/src/main.cpp"
click node_meshdata "https://github.com/erichchan999/deformer/blob/main/src/main.cpp"
click node_strategy "https://github.com/erichchan999/deformer/blob/main/include/DisplaceByNormalStrategy.h"
click node_eigen "https://github.com/erichchan999/deformer/blob/main/src/DisplaceByNormalEigen.cpp"
click node_threads "https://github.com/erichchan999/deformer/blob/main/src/DisplaceByNormalThreads.cpp"
click node_tbb "https://github.com/erichchan999/deformer/blob/main/src/DisplaceByNormalTBB.cpp"
click node_cuda "https://github.com/erichchan999/deformer/blob/main/src/DisplaceByNormalCuda.cpp"
click node_kernel "https://github.com/erichchan999/deformer/blob/main/src/DisplaceByNormalCudaKernels.cu"
click node_tracy "https://github.com/erichchan999/deformer/tree/main/submodules/tracy"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_input,node_runner,node_meshdata,node_output,node_user toneBlue
class node_strategy,node_eigen,node_threads,node_tbb,node_cuda,node_kernel toneAmber
class node_tracy,node_profiler toneMint
```

## Components

### USD mesh workflow

- [USD input mesh](https://github.com/erichchan999/deformer/blob/main/geometry/sphere.usd): `geometry/sphere.usd`
- [Application entry](https://github.com/erichchan999/deformer/blob/main/src/main.cpp): `src/main.cpp`
- [Mesh point and topology data](https://github.com/erichchan999/deformer/blob/main/src/main.cpp): `src/main.cpp`
- **Exported USD stage**

### Displacement strategies

- [Strategy interface](https://github.com/erichchan999/deformer/blob/main/include/DisplaceByNormalStrategy.h): `include/DisplaceByNormalStrategy.h`
- [Eigen implementation](https://github.com/erichchan999/deformer/blob/main/src/DisplaceByNormalEigen.cpp): `src/DisplaceByNormalEigen.cpp`
- [std::thread implementation](https://github.com/erichchan999/deformer/blob/main/src/DisplaceByNormalThreads.cpp): `src/DisplaceByNormalThreads.cpp`
- [oneTBB implementation](https://github.com/erichchan999/deformer/blob/main/src/DisplaceByNormalTBB.cpp): `src/DisplaceByNormalTBB.cpp`
- [CUDA host implementation](https://github.com/erichchan999/deformer/blob/main/src/DisplaceByNormalCuda.cpp): `src/DisplaceByNormalCuda.cpp`
- [CUDA kernels](https://github.com/erichchan999/deformer/blob/main/src/DisplaceByNormalCudaKernels.cu): `src/DisplaceByNormalCudaKernels.cu`

### Performance profiling

- [Tracy instrumentation](https://github.com/erichchan999/deformer/tree/main/submodules/tracy): `submodules/tracy`
- **Tracy profiler**

### Other components

- **User**

## Connections

- User → Application entry: runs (evidence: `README.md`)
- Application entry → USD input mesh: opens (evidence: `src/main.cpp`)
- Application entry → Mesh point and topology data: extracts (evidence: `src/main.cpp`)
- Application entry → Strategy interface: creates (evidence: `src/main.cpp`)
- Application entry → Eigen implementation: dispatches (evidence: `src/main.cpp`)
- Application entry → std::thread implementation: dispatches (evidence: `src/main.cpp`)
- Application entry → oneTBB implementation: dispatches (evidence: `src/main.cpp`)
- Application entry → CUDA host implementation: dispatches (evidence: `src/main.cpp`)
- CUDA host implementation → CUDA kernels: launches (evidence: `src/DisplaceByNormalCuda.cpp`)
- Application entry → Exported USD stage: exports (evidence: `src/main.cpp`)
- Eigen implementation → Tracy instrumentation: instruments (evidence: `src/DisplaceByNormalEigen.cpp`)
- std::thread implementation → Tracy instrumentation: instruments (evidence: `src/DisplaceByNormalThreads.cpp`)
- oneTBB implementation → Tracy instrumentation: instruments (evidence: `src/DisplaceByNormalTBB.cpp`)
- CUDA host implementation → Tracy instrumentation: instruments (evidence: `src/DisplaceByNormalCuda.cpp`)
- Tracy profiler → Tracy instrumentation: connects to (evidence: `README.md`)
