Skip to content

feat: Early return pruning#2711

Draft
iwoplaza wants to merge 1 commit into
mainfrom
feat/early-return-pruning
Draft

feat: Early return pruning#2711
iwoplaza wants to merge 1 commit into
mainfrom
feat/early-return-pruning

Conversation

@iwoplaza

@iwoplaza iwoplaza commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Improvements:

  • Early return in comptime

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/tgpu-gen@fad5b4d86b815fab49297d8eac83f68377299048
https://pkg.pr.new/software-mansion/TypeGPU/tinyest-for-wgsl@fad5b4d86b815fab49297d8eac83f68377299048
https://pkg.pr.new/software-mansion/TypeGPU/typegpu@fad5b4d86b815fab49297d8eac83f68377299048
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/cli@fad5b4d86b815fab49297d8eac83f68377299048
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/color@fad5b4d86b815fab49297d8eac83f68377299048
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/gl@fad5b4d86b815fab49297d8eac83f68377299048
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@fad5b4d86b815fab49297d8eac83f68377299048
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/radiance-cascades@fad5b4d86b815fab49297d8eac83f68377299048
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/react@fad5b4d86b815fab49297d8eac83f68377299048
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/sdf@fad5b4d86b815fab49297d8eac83f68377299048
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/three@fad5b4d86b815fab49297d8eac83f68377299048
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@fad5b4d86b815fab49297d8eac83f68377299048

benchmark
view benchmark

commit
view commit

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown

Bundle size comparison (import * as ... in PR vs import * as ... in target):

🟢 Decreased ➖ Unchanged 🔴 Increased (max 0.42%) ❔ Unknown
0 300 21 0

import { ... } in PR vs import * as ... in PR (is the library tree-Shakeable?):

Test tsdown
tgpu_init.ts 257.00 kB ($${\color{green}-3.2\%}$$)
tgpu_initFromDevice.ts 256.49 kB ($${\color{green}-3.4\%}$$)
tgpu_resolve.ts 162.46 kB ($${\color{green}-38.8\%}$$)
tgpu_resolveWithContext.ts 162.40 kB ($${\color{green}-38.8\%}$$)
tgpu_bindGroupLayout.ts 68.92 kB ($${\color{green}-74.0\%}$$)
tgpu_mutableAccessor.ts 65.91 kB ($${\color{green}-75.2\%}$$)
tgpu_accessor.ts 65.90 kB ($${\color{green}-75.2\%}$$)
tgpu_privateVar.ts 65.27 kB ($${\color{green}-75.4\%}$$)
tgpu_workgroupVar.ts 65.27 kB ($${\color{green}-75.4\%}$$)
tgpu_const.ts 64.52 kB ($${\color{green}-75.7\%}$$)
tgpu_fn.ts 37.98 kB ($${\color{green}-85.7\%}$$)
tgpu_fragmentFn.ts 37.88 kB ($${\color{green}-85.7\%}$$)
tgpu_vertexFn.ts 37.70 kB ($${\color{green}-85.8\%}$$)
tgpu_computeFn.ts 37.40 kB ($${\color{green}-85.9\%}$$)
tgpu_vertexLayout.ts 26.63 kB ($${\color{green}-90.0\%}$$)
tgpu_comptime.ts 14.43 kB ($${\color{green}-94.6\%}$$)
tgpu_unroll.ts 2.60 kB ($${\color{green}-99.0\%}$$)
tgpu_slot.ts 1.54 kB ($${\color{green}-99.4\%}$$)
tgpu_lazy.ts 1.19 kB ($${\color{green}-99.6\%}$$)

If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown

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 [1.00, 2.03, 4.73, 7.31, 8.20, 12.13, 23.69, 24.59]
  line [0.95, 1.99, 4.29, 6.60, 8.34, 13.19, 23.09, 26.29]
  line [0.89, 1.79, 4.10, 6.44, 8.18, 11.40, 21.68, 21.88]
Loading
---
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.31, 0.53, 0.71, 0.84, 1.18, 1.25, 1.46, 1.57]
  line [0.31, 0.56, 0.69, 0.85, 1.21, 1.22, 1.50, 1.59]
  line [0.30, 0.55, 0.68, 0.79, 1.03, 1.17, 1.33, 1.52]
Loading
---
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.89, 2.36, 3.79, 7.11, 13.18, 27.95, 57.12, 118.55]
  line [1.03, 2.09, 4.11, 6.56, 12.40, 26.31, 55.48, 114.76]
  line [1.05, 2.12, 4.48, 6.53, 13.80, 27.43, 57.21, 112.41]
Loading

@iwoplaza iwoplaza force-pushed the feat/early-return-pruning branch 8 times, most recently from 2ea1f14 to 8e0e8e2 Compare July 13, 2026 14:36
@iwoplaza iwoplaza force-pushed the feat/early-return-pruning branch from 8e0e8e2 to fad5b4d Compare July 13, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant