Repository navigation
Conversation
|
pkg.pr.new packages benchmark commit |
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.90, 1.85, 4.18, 6.09, 7.73, 12.29, 22.86, 24.02]
line [0.94, 1.97, 4.53, 6.57, 7.77, 12.73, 24.79, 24.63]
line [0.90, 1.87, 4.05, 6.33, 7.43, 11.69, 22.10, 24.52]
---
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.33, 0.54, 0.70, 0.87, 1.12, 1.16, 1.35, 1.52]
line [0.35, 0.57, 0.76, 0.88, 1.13, 1.25, 1.42, 1.55]
line [0.34, 0.53, 0.72, 0.84, 1.11, 1.15, 1.30, 1.47]
---
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.95, 2.29, 3.78, 6.94, 13.15, 26.80, 55.89, 108.04]
line [0.95, 2.08, 4.04, 6.82, 13.58, 25.04, 53.72, 110.87]
line [0.86, 2.13, 3.62, 6.83, 12.33, 24.48, 51.81, 108.12]
|
Bundle size comparison (
|
| 🟢 Decreased (max -0.00%) | ➖ Unchanged | 🔴 Increased | ❔ Unknown |
|---|---|---|---|
| 4 | 351 | 0 | 0 |
No notable changes.
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.
🟡 Changes recommended
The deprecated ~unstable command and render bundle encoder entry points no longer have tests, leaving their compatibility unverified.
1 open issue
What changed in this PR
This PR promotes TypeGPU’s command-encoder and render-bundle-encoder factories to the stable root API while retaining deprecated ~unstable entry points for compatibility.
Changes:
- Adds stable factory declarations and deprecates the experimental declarations.
- Migrates package consumers, examples, and tests to the stable API.
- Updates documentation and warning text, including removing the experimental notice.
| File | Description |
|---|---|
packages/typegpu/tests/renderPipeline.test.ts |
Uses the stable render-bundle factory. |
packages/typegpu/tests/immediates.test.ts |
Uses stable render-bundle creation in immediate-value tests. |
packages/typegpu/tests/guardedComputePipeline.test.ts |
Uses stable command-encoder creation. |
packages/typegpu/tests/computePipeline.test.ts |
Migrates factory calls and warning expectations. |
packages/typegpu/src/core/root/rootTypes.ts |
Exposes stable factories and deprecates experimental declarations. |
packages/typegpu/src/core/pipeline/drawState.ts |
Recommends the stable factory in warnings. |
packages/typegpu/src/core/commandEncoder/commandEncoder.ts |
Updates the documentation example. |
packages/typegpu-radiance-cascades/src/runner.ts |
Creates fallback encoders through the stable API. |
packages/typegpu-radiance-cascades/src/holographic/index.ts |
Uses stable encoder creation when needed. |
packages/typegpu-algorithm/README.md |
Updates the batching example. |
apps/typegpu-docs/src/examples/rendering/triplanar-mapping/index.ts |
Migrates frame encoder creation. |
apps/typegpu-docs/src/examples/rendering/simple-shadow/index.ts |
Migrates shadow-rendering encoder creation. |
apps/typegpu-docs/src/examples/rendering/render-bundles/index.ts |
Migrates both encoder factories. |
apps/typegpu-docs/src/examples/rendering/render-bundles-with/index.ts |
Migrates frame encoder creation. |
apps/typegpu-docs/src/examples/rendering/radiance-cascades-drawing/index.ts |
Migrates lighting-frame encoder creation. |
apps/typegpu-docs/src/examples/rendering/global-illumination/index.ts |
Migrates illumination-frame encoder creation. |
apps/typegpu-docs/src/examples/rendering/area-light/index.ts |
Migrates rendering encoder creation. |
apps/typegpu-docs/src/examples/image-processing/monocular-light-injection/renderer.ts |
Migrates relighting encoder creation. |
apps/typegpu-docs/src/examples/algorithms/sort/index.ts |
Migrates initialization, sorting, and benchmark encoders. |
apps/typegpu-docs/src/examples/algorithms/genetic-racing/index.ts |
Migrates simulation and reduction encoders. |
apps/typegpu-docs/src/examples/advanced/appjs-venue/index.ts |
Migrates scene encoder creation. |
apps/typegpu-docs/src/content/docs/ecosystem/typegpu-radiance-cascades.mdx |
Updates the shared compute-pass example. |
apps/typegpu-docs/src/content/docs/apis/pipelines.mdx |
Removes the experimental notice and updates examples. |
apps/typegpu-docs/src/content/docs/apis/buffers.mdx |
Updates the buffer-operation encoder example. |
Review effort: Balanced
| const pipeline = root.createComputePipeline({ compute: entryFn }); | ||
|
|
||
| const encoder = root['~unstable'].createCommandEncoder(); | ||
| const encoder = root.createCommandEncoder(); |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This PR stabilizes the command encoder API by moving createCommandEncoder and createRenderBundleEncoder from root['~unstable'] to the stable TgpuRoot interface, with mechanical call-site updates.
- Interface relocation — both method declarations and their JSDoc move from
ExperimentalTgpuRoottoTgpuRootinpackages/typegpu/src/core/root/rootTypes.ts.ExperimentalTgpuRootkeeps a one-line@deprecatedredeclaration of each, soroot['~unstable'].*still type-checks and now emits a deprecation hint. This mirrors the existingcreateGuardedComputePipeline/pipestabilization pattern. - No runtime change — the implementation in
core/root/init.ts(TgpuRootImpl) already defined both methods, so this is a type-surface change only. - Docs and examples — removed the "Experimental" caution from
apis/pipelines.mdx; updatedbuffers.mdx, the radiance-cascades doc, the algorithm README, and all example/test call sites. - Warning copy —
core/pipeline/drawState.tsand its assertion incomputePipeline.test.tsnow referenceroot.createCommandEncoder().
Verification
npx tsc -p packages/typegpu/tsconfig.json --noEmitpasses.computePipeline.test.ts(30 tests) andimmediates.test.ts(40 tests) pass.- The only remaining
root['~unstable'].createCommandEncoderreferences are in the historicalmigrations/0-12.mdxguide and the 0.12 blog post, which correctly document the old API and should stay as-is. typegpu-gl'sTgpuRootWebGLstubs are unaffected —initWithGLcasts throughunknown as TgpuRoot, and the fallback methods still throwWebGLFallbackUnsupportedErroras before.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
| * encoder.submit(); | ||
| * ``` | ||
| */ | ||
| /** @deprecated This feature is now stable, use `root.createCommandEncoder`. */ |
There was a problem hiding this comment.
| /** @deprecated This feature is now stable, use `root.createCommandEncoder`. */ | |
| /** @deprecated This feature is now stable, use {@link TgpuRoot.createCommandEncoder | root.createCommandEncoder}. */ |
| * const bundle = bundleEncoder.finish(); | ||
| * ``` | ||
| */ | ||
| /** @deprecated This feature is now stable, use `root.createRenderBundleEncoder`. */ |


Moves
createCommandEncoderandcreateRenderBundleEncoderfromroot['~unstable']toroot.root['~unstable'].createCommandEncoder/.createRenderBundleEncoderstill work, but are marked@deprecated.