fix(breaking): shaderGenerator option should be unstable_shaderGenerator in tgpu.init and tgpu.initFromDevice - #2745
fix(breaking): shaderGenerator option should be unstable_shaderGenerator in tgpu.init and tgpu.initFromDevice#2745iwoplaza wants to merge 2 commits into
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.93, 1.88, 4.34, 6.65, 7.48, 12.58, 22.56, 26.90]
line [0.91, 1.81, 4.15, 6.27, 7.70, 11.78, 21.25, 25.13]
line [0.96, 2.08, 4.56, 6.62, 8.00, 11.88, 21.95, 26.23]
---
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.30, 0.49, 0.66, 0.85, 1.11, 1.13, 1.36, 1.53]
line [0.29, 0.56, 0.70, 0.81, 1.10, 1.21, 1.41, 1.55]
line [0.31, 0.54, 0.68, 0.86, 1.14, 1.25, 1.46, 1.61]
---
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.88, 2.17, 4.07, 6.90, 12.65, 26.17, 56.34, 111.97]
line [0.77, 2.24, 4.20, 7.22, 12.43, 26.07, 54.55, 110.53]
line [0.90, 2.06, 3.60, 6.53, 12.96, 27.98, 57.36, 118.76]
|
2c996e4 to
5e68df2
Compare
|
pkg.pr.new packages benchmark commit |
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased (max 0.01%) | ❔ Unknown |
|---|---|---|---|
| 0 | 301 | 21 | 0 |
import { ... } in PR vs import * as ... in PR (is the library tree-Shakeable?):
| Test | tsdown |
|---|---|
| tgpu_init.ts | 258.91 kB ( |
| tgpu_initFromDevice.ts | 258.40 kB ( |
| tgpu_resolve.ts | 164.59 kB ( |
| tgpu_resolveWithContext.ts | 164.53 kB ( |
| tgpu_bindGroupLayout.ts | 68.97 kB ( |
| tgpu_mutableAccessor.ts | 65.97 kB ( |
| tgpu_accessor.ts | 65.96 kB ( |
| tgpu_privateVar.ts | 65.31 kB ( |
| tgpu_workgroupVar.ts | 65.30 kB ( |
| tgpu_const.ts | 64.55 kB ( |
| tgpu_fn.ts | 38.14 kB ( |
| tgpu_fragmentFn.ts | 38.14 kB ( |
| tgpu_vertexFn.ts | 37.96 kB ( |
| tgpu_computeFn.ts | 37.66 kB ( |
| tgpu_vertexLayout.ts | 26.79 kB ( |
| tgpu_comptime.ts | 14.48 kB ( |
| tgpu_unroll.ts | 1.66 kB ( |
| tgpu_slot.ts | 1.54 kB ( |
| tgpu_lazy.ts | 1.19 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.
Pull request overview
This PR updates the public initialization options API so that the shader generator hook is explicitly marked unstable by renaming shaderGenerator to unstable_shaderGenerator in tgpu.init and tgpu.initFromDevice.
Changes:
- Rename
InitOptions.shaderGenerator→InitOptions.unstable_shaderGeneratorand wire it throughinit(). - Rename
InitFromDeviceOptions.shaderGenerator→InitFromDeviceOptions.unstable_shaderGeneratorand wire it throughinitFromDevice().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — a breaking rename of the shaderGenerator option to unstable_shaderGenerator in tgpu.init and tgpu.initFromDevice.
- Renames the public option key in
InitOptionsandInitFromDeviceOptionsto align with the existingunstable_-prefixed experimental options (unstable_names,unstable_logOptions). - Updates destructuring in both entry points to use the new key and passes the value through to
TgpuRootImplunchanged. - Internal
shaderGeneratorproperty names onTgpuRootImpl,ExperimentalTgpuRoot, resolve contexts, pipelines, and the GL package remain correctly untouched.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
57f2b22 to
6ae7b41
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior review, the JSDoc @default for unstable_names was corrected from 'random' to 'strict' in init.ts and tgpuResolve.ts, and init() / initFromDevice() now destructure unstable_logOptions and unstable_shaderGenerator with consistent local aliases.
- Fixed the documented default for
InitOptions.unstable_namesinpackages/typegpu/src/core/root/init.tsto match the runtime'strict'default. - Fixed the documented default for
InitFromDeviceOptions.unstable_namesin the same file. - Fixed the documented default for
TgpuResolveOptions.namesinpackages/typegpu/src/core/resolve/tgpuResolve.ts. - Refactored destructuring of
unstable_logOptionsandunstable_shaderGeneratorininit()andinitFromDevice()to use renamed locals (logOptions,shaderGenerator) before passing them toTgpuRootImpl.
Ran pnpm --filter typegpu test:types successfully.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
…u.init and tgpu.initFromDevice
6ae7b41 to
3078b10
Compare
184d1fd to
3f6f1bc
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior review, the branch was rebased onto recent main and a merge commit brought in base-branch updates. The PR's diff is identical to what was already reviewed and approved.
- Rebased the
unstable_shaderGeneratorrename and JSDoc@defaultfixes onto recentmain(no net-new changes).
<!--
Pullfrog review metadata — for any agent (or human-with-agent) reading this
review. Incorporate the fields below into your understanding of the context
this review was made in. The findings below were written against
3f6f1bc; if new commits have landed on fix/unstable-shader-generator-in-root since this review
was submitted, treat any specific bug, file, or line callout as POTENTIALLY
STALE — re-diff against 3f6f1bc (or trigger a fresh review) and
factor commits past 3f6f1bc into your understanding of the current
state before acting on findings.
- Mode: IncrementalReview (delta against prior pullfrog review)
- Files reviewed: 2
- Commits reviewed: 2
- Base: main (55bec73)
- Head: fix/unstable-shader-generator-in-root (3f6f1bc)
- Reviewed commits:
- Prior pullfrog review: 6ae7b41 (#2745 (review))
- Submitted at: 2026-07-29T00:00:00Z
-->
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏

No description provided.