Conversation
|
pkg.pr.new packages benchmark commit |
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:No major changes. 📋 All resultsClick to reveal the results table (350 entries).
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
Adds a new typegpu/no-unsupported-syntax ESLint rule to flag JavaScript constructs that can’t be translated into valid WGSL inside 'use gpu' functions, and wires it into the plugin’s shipped configs.
Changes:
- Introduce
no-unsupported-syntaxrule with targeted reports for a set of unsupported ESTree node types when inside'use gpu'. - Add a comprehensive RuleTester suite for the new rule.
- Register the rule in
recommendedandallconfigs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/eslint-plugin/src/rules/noUnsupportedSyntax.ts | New rule implementation using directiveTracking to conditionally report unsupported syntax inside 'use gpu'. |
| packages/eslint-plugin/tests/noUnsupportedSyntax.test.ts | New unit tests covering valid/invalid syntax cases and expected diagnostics. |
| packages/eslint-plugin/src/configs.ts | Registers the new rule and enables it in recommended (warn) and all (error). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
== |
There was a problem hiding this comment.
Pull request overview
Adds a new ESLint rule to help TypeGPU users avoid JavaScript syntax that can’t be reliably translated into WGSL, integrating it into the plugin’s configs and documentation.
Changes:
- Introduce
typegpu/no-unsupported-syntaxrule that reports various unsupported/conditionally-supported AST node types inside'use gpu'functions. - Extend the
directiveTrackingenhancer API to expose the current directive stack for nested-function detection. - Add comprehensive rule tests and user-facing documentation, and wire the rule into
recommended/allconfigs + README rule list.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/eslint-plugin/src/rules/noUnsupportedSyntax.ts | New rule implementation using directive tracking to scope reports to TypeGPU functions (and nested functions within them). |
| packages/eslint-plugin/src/enhancers/directiveTracking.ts | Exposes directive stack to consumers (used for nested-function detection). |
| packages/eslint-plugin/tests/rules/noUnsupportedSyntax.test.ts | New RuleTester suite covering valid/invalid syntax cases. |
| packages/eslint-plugin/src/configs.ts | Registers the new rule and enables it in recommended (warn) and all (error). |
| packages/eslint-plugin/README.md | Adds the new rule to the auto-generated rules list table. |
| packages/eslint-plugin/docs/rules/no-unsupported-syntax.md | New documentation page with examples and config note. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.94, 1.93, 4.44, 6.06, 7.64, 10.15, 21.06, 23.56]
line [0.95, 1.83, 4.12, 6.41, 7.31, 10.64, 21.63, 20.89]
line [0.82, 1.78, 3.85, 6.28, 6.36, 10.65, 19.03, 19.00]
---
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.51, 0.72, 0.84, 1.11, 1.24, 1.46, 1.71]
line [0.30, 0.55, 0.66, 0.83, 1.13, 1.22, 1.36, 1.56]
line [0.29, 0.47, 0.67, 0.77, 1.02, 1.11, 1.27, 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.82, 1.96, 3.85, 6.33, 12.34, 25.34, 56.03, 111.99]
line [0.75, 2.14, 3.79, 6.31, 12.14, 24.72, 54.17, 109.68]
line [0.86, 2.18, 3.77, 6.14, 11.46, 22.45, 50.59, 104.57]
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Blocked by #2235 since both PRs need to update directive tracking enhancer.I tried to be thorough because this may be beneficial for agents writing typegpu functions.
I went through all possible node types, here is the current state of things.
Valid:
Reported:
Conditionally reported:
!=or other unsupported)==or other unsupported)??)var)const [a] = ...,const { a } = ...)Skipped because there is no need to report:
Skipped because I don't think we care: