Repository navigation
[RFC] feat: Generate requires directives - #3207
Draft
aleksanderkatan wants to merge 1 commit into
Draft
aleksanderkatan wants to merge 1 commit into
aleksanderkatan wants to merge 1 commit into
Conversation
aleksanderkatan
added this pull request to stack #3206
October 16, 2026 08:22
|
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.96, 1.97, 4.31, 6.30, 7.29, 12.72, 23.51, 25.41]
line [0.92, 1.89, 3.95, 6.21, 7.64, 12.67, 23.68, 26.64]
line [0.93, 1.79, 4.02, 5.81, 6.68, 11.33, 23.29, 25.36]
---
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.29, 0.49, 0.69, 0.87, 1.11, 1.21, 1.42, 1.58]
line [0.29, 0.49, 0.65, 0.83, 1.09, 1.16, 1.36, 1.49]
line [0.34, 0.50, 0.65, 0.75, 1.03, 1.10, 1.29, 1.45]
---
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.81, 2.04, 3.82, 6.76, 12.39, 25.75, 54.71, 114.64]
line [0.83, 2.01, 3.36, 6.67, 11.92, 27.96, 54.71, 106.89]
line [0.86, 2.04, 4.37, 6.51, 11.77, 24.83, 52.69, 106.18]
|
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased (max 1.36%) | ❔ Unknown |
|---|---|---|---|
| 0 | 84 | 265 | 0 |
import * as ... in PR vs import * as ... in target (did bundle size increase?):
| Test | tsdown |
|---|---|
| tgpu_lazy.ts | 63.56 kB ( |
| tgpu_const.ts | 63.76 kB ( |
| tgpu_workgroupVar.ts | 64.34 kB ( |
| tgpu_privateVar.ts | 64.34 kB ( |
| tgpu_accessor.ts | 68.72 kB ( |
| tgpu_mutableAccessor.ts | 68.72 kB ( |
| tgpu_bindGroupLayout.ts | 70.95 kB ( |
| tgpu_resolveWithContext.ts | 174.10 kB ( |
| tgpu_resolve.ts | 174.17 kB ( |
| tgpu_initFromDevice.ts | 283.96 kB ( |
| tgpu_init.ts | 284.50 kB ( |
| STATIC_tgpu.ts | 296.66 kB ( |
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
aleksanderkatan
force-pushed
the
feat/requires
branch
2 times, most recently
from
October 19, 2026 09:04
8b4cb2a to
d953332
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aleksanderkatan
force-pushed
the
feat/requires
branch
from
October 19, 2026 09:16
d953332 to
e3086a1
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See https://www.w3.org/TR/WGSL/#language-extensions-sec
Requires directive must be located before any declarations in the WGSL code.
This breaks when concatenating multiple resolves, even with a namespace enabled.
A possible solution:
Or we can just don't generate the 'requires' directive at all, it is not necessary.
Or we could check the navigator (if available), and warn if features are unavailable on the resolving host instead of emitting 'requires'.