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.95, 1.87, 4.13, 7.04, 7.42, 11.29, 20.72, 24.25]
line [0.94, 1.85, 3.98, 6.10, 7.19, 10.83, 19.77, 22.49]
line [0.93, 1.92, 4.23, 6.19, 7.21, 10.92, 22.28, 21.49]
---
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.57, 0.70, 0.85, 1.11, 1.24, 1.46, 1.57]
line [0.30, 0.54, 0.69, 0.82, 1.09, 1.20, 1.45, 1.57]
line [0.31, 0.56, 0.68, 0.83, 1.14, 1.21, 1.46, 1.51]
---
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.93, 1.96, 3.84, 6.13, 12.72, 28.33, 53.98, 108.37]
line [0.72, 2.00, 3.42, 5.82, 12.09, 26.03, 53.24, 110.56]
line [0.81, 2.09, 4.15, 5.91, 11.87, 25.11, 51.09, 107.36]
|
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: