docs: Move DepthART inference to 'common' - #2898
Conversation
Resolution Time Benchmark---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.80, 1.64, 3.69, 5.90, 7.01, 11.06, 20.02, 20.49]
line [0.83, 1.75, 3.85, 5.80, 6.66, 10.94, 20.27, 20.67]
line [0.90, 1.76, 3.73, 5.68, 6.37, 11.26, 21.38, 22.79]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.32, 0.42, 0.60, 0.69, 0.92, 0.96, 1.19, 1.31]
line [0.28, 0.48, 0.63, 0.79, 1.07, 1.06, 1.27, 1.43]
line [0.29, 0.53, 0.65, 0.74, 1.01, 1.08, 1.23, 1.38]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.85, 2.02, 3.10, 5.85, 10.69, 23.32, 49.66, 101.12]
line [0.88, 1.87, 2.90, 6.06, 10.79, 22.96, 50.81, 100.71]
line [0.86, 1.92, 3.12, 6.20, 11.02, 23.82, 49.00, 100.04]
|
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased | ❔ Unknown |
|---|---|---|---|
| 0 | 325 | 0 | 0 |
import { ... } in PR vs import * as ... in PR (is the library tree-Shakeable?):
| Test | tsdown |
|---|---|
| tgpu_init.ts | 263.10 kB ( |
| tgpu_initFromDevice.ts | 262.56 kB ( |
| tgpu_resolve.ts | 161.75 kB ( |
| tgpu_resolveWithContext.ts | 161.68 kB ( |
| tgpu_bindGroupLayout.ts | 62.32 kB ( |
| tgpu_mutableAccessor.ts | 57.04 kB ( |
| tgpu_accessor.ts | 57.04 kB ( |
| tgpu_privateVar.ts | 55.73 kB ( |
| tgpu_workgroupVar.ts | 55.73 kB ( |
| tgpu_const.ts | 55.15 kB ( |
| tgpu_lazy.ts | 54.95 kB ( |
| tgpu_fragmentFn.ts | 39.68 kB ( |
| tgpu_fn.ts | 39.62 kB ( |
| tgpu_vertexFn.ts | 39.50 kB ( |
| tgpu_computeFn.ts | 39.20 kB ( |
| tgpu_vertexLayout.ts | 28.33 kB ( |
| tgpu_comptime.ts | 15.93 kB ( |
| tgpu_unroll.ts | 1.75 kB ( |
| tgpu_slot.ts | 1.70 kB ( |
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Moved 33 DepthART-inference files from
image-processing/monocular-light-injection/inference/tocommon/depthart-inference/— pure renames, no content change. - Updated two import paths in
monocular-light-injection/index.tsandrenderer.tsto point at the relocated../../common/depthart-inference/...modules.
I verified this is a clean, mechanical move: the old inference/ directory is fully removed, no import inside the moved directory escapes it (all internal relative imports are sibling-level, so they still resolve), and no other references to the old path remain anywhere in the docs app. The example-discovery globs are unaffected — the relocated .ts files match the same usedApis analysis glob as before, and are not picked up as gallery examples (no index.ts in the moved set), so no meta.json/index.html/thumbnail is expected. The docs astro check typechecks the two importing files, whose new import statements resolve to existing files.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
pkg.pr.new No packages changed since release |
There was a problem hiding this comment.
Pull request overview
This PR moves the DepthART inference implementation used by the monocular-light-injection docs example into the shared examples/common area, so the inference engine can be reused by additional docs examples without duplicating the implementation.
Changes:
- Updated the monocular-light-injection example to import DepthART inference utilities from
src/examples/common/depthart-inference. - Added the DepthART bundle parser, inference plan orchestration, and GPU resource management under
examples/common/depthart-inference. - Added/relocated the compute kernels and dispatch builders needed to execute DepthART on the GPU (including Winograd, depthwise, pointwise/spatial conv, scan-project, selective scan, etc.).
Reviewed changes
Copilot reviewed 2 out of 35 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| apps/typegpu-docs/src/examples/image-processing/monocular-light-injection/renderer.ts | Switches DepthART estimator/plan imports to the shared common/depthart-inference location. |
| apps/typegpu-docs/src/examples/image-processing/monocular-light-injection/index.ts | Switches DepthART bundle parsing and plan construction imports to common/depthart-inference. |
| apps/typegpu-docs/src/examples/common/depthart-inference/bundle.ts | Adds bundle format parsing (DARTBND) into a reusable helper. |
| apps/typegpu-docs/src/examples/common/depthart-inference/conv-dispatches.ts | Adds convolution dispatch building logic for multiple precision/layout variants. |
| apps/typegpu-docs/src/examples/common/depthart-inference/depthart.ts | Adds the shared DepthInferencePlan orchestration class (preprocess + dispatch execution). |
| apps/typegpu-docs/src/examples/common/depthart-inference/dispatch-helpers.ts | Adds shared helpers for shapes, section bindings, pipeline caching, and uniform/storage creation. |
| apps/typegpu-docs/src/examples/common/depthart-inference/dispatches.ts | Adds construction of the full execution dispatch list from the bundle’s recorded ops. |
| apps/typegpu-docs/src/examples/common/depthart-inference/disparity-range.ts | Adds a reusable disparity range estimator implementation. |
| apps/typegpu-docs/src/examples/common/depthart-inference/execution-plan.ts | Adds the PreparedDispatch representation and a helper to record dispatches. |
| apps/typegpu-docs/src/examples/common/depthart-inference/gpu-resources.ts | Adds immutable weight upload + optional lane transpose handling. |
| apps/typegpu-docs/src/examples/common/depthart-inference/half-weights.ts | Adds conversion utility for FP32 weights to FP16. |
| apps/typegpu-docs/src/examples/common/depthart-inference/preprocess.ts | Adds shared preprocessing kernel + wrapper for input frame normalization/cropping. |
| apps/typegpu-docs/src/examples/common/depthart-inference/tensor-arena.ts | Adds tensor arena allocation and typed buffer views for IO/slots. |
| apps/typegpu-docs/src/examples/common/depthart-inference/types.ts | Adds the shared model/bundle/dispatch/tensor type definitions. |
| apps/typegpu-docs/src/examples/common/depthart-inference/winograd-dispatches.ts | Adds the Winograd dispatcher (scratch sizing, pipeline selection, dispatch emission). |
| apps/typegpu-docs/src/examples/common/depthart-inference/winograd-weight.ts | Adds weight section slicing + Winograd F(4x4,3x3) weight transform logic. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/channel-views.ts | Adds kernels for channel split/concat used by the graph. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/cross-scan.ts | Adds cross-scan indexing helpers and merge kernel. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/depthwise.ts | Adds depthwise kernel family and variant generator. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/elementwise.ts | Adds binary/unary/affine kernel builders and broadcast logic. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/helpers.ts | Adds activation helpers, indexing helpers, dot-product helpers, and softplus/component helpers. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/layouts.ts | Adds bind group layouts and uniform schemas for all kernels. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/native-f16-conv.ts | Adds native-FP16 convolution kernels and IO specialization slots. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/normalization.ts | Adds specialized layer norm kernel generator. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/packed-f16-conv.ts | Adds packed-FP16 depthwise conv decoding + kernels. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/pointwise.ts | Adds pointwise (1x1) kernels and specialized kernel generator. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/pooling.ts | Adds average pooling kernel. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/resize.ts | Adds nearest/bilinear resize kernels matching ONNX modes. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/scan-project.ts | Adds specialized scan-project kernel generator. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/selective-scan.ts | Adds sequential selective scan kernel. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/spatial-conv.ts | Adds spatial (3x3) kernel + specialized generator hookup. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/spatial-specialized.ts | Adds shape-specialized 3x3 convolution generator used by multiple variants. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/types.ts | Adds shared kernel constants and planning helpers for specialized launches. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/winograd-f4.ts | Adds Winograd F(4x4,3x3) input/output transform kernels. |
| apps/typegpu-docs/src/examples/common/depthart-inference/kernels/winograd-gemm.ts | Adds Winograd GEMM kernels and a shape-specialized GEMM generator. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ffddf7c to
e139f9f
Compare

I'd like more examples to be able to use this inference engine, so I think moving it to 'common' until we create a separate library is the best bet for now.