impr: Warn when property source order differs from schema declaration order - #2954
Open
cieplypolar wants to merge 5 commits into
Open
impr: Warn when property source order differs from schema declaration order#2954cieplypolar wants to merge 5 commits into
cieplypolar wants to merge 5 commits into
Conversation
|
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.93, 1.93, 4.08, 6.92, 8.50, 10.90, 24.05, 28.96]
line [0.97, 1.96, 4.36, 6.91, 8.09, 12.47, 24.22, 25.95]
line [0.96, 1.90, 4.44, 6.96, 8.14, 11.74, 23.79, 24.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.28, 0.47, 0.67, 0.80, 1.12, 1.15, 1.33, 1.53]
line [0.30, 0.49, 0.68, 0.82, 1.05, 1.14, 1.32, 1.55]
line [0.26, 0.47, 0.67, 0.80, 1.08, 1.13, 1.32, 1.54]
---
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.97, 2.29, 3.51, 7.58, 12.85, 26.22, 57.09, 113.60]
line [0.90, 2.11, 3.50, 7.12, 12.67, 26.83, 56.79, 114.82]
line [0.72, 2.23, 3.39, 7.29, 12.51, 27.45, 55.83, 113.58]
|
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased (max 1.04%) | ❔ Unknown |
|---|---|---|---|
| 0 | 319 | 6 | 0 |
import * as ... in PR vs import * as ... in target (did bundle size increase?):
| Test | tsdown |
|---|---|
| tgpu_resolveWithContext.ts | 163.59 kB ( |
| tgpu_resolve.ts | 163.65 kB ( |
| tgpu_initFromDevice.ts | 264.49 kB ( |
| tgpu_init.ts | 265.04 kB ( |
| STATIC_tgpu.ts | 274.56 kB ( |
| STATIC_allImports.ts | 300.82 kB ( |
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
cieplypolar
force-pushed
the
impr/warn-schema-order
branch
from
September 1, 2026 13:37
8735add to
f5e02ed
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds diagnostics to help developers catch situations where object-literal evaluation order and struct schema order diverge, potentially changing observable side effects (or omitting them entirely) during shader generation.
Changes:
- Added warnings in
WgslGeneratorwhen (a) side-effectful extra struct fields are omitted and (b) side-effectful fields are reordered relative to struct declaration order. - Added WGSL and GLSL test coverage for the new warning scenarios (including a “no warn when pure” case).
- Added a GLSL entry-point warning when an extra return-field is not part of the expected output struct.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/typegpu/tests/tgsl/wgslGenerator.test.ts | Adds WGSL tests verifying warnings for omitted/reordered side-effectful struct fields and no warning for pure reordering. |
| packages/typegpu/src/tgsl/wgslGenerator.ts | Implements side-effect-aware warnings for extra struct fields and for schema-vs-source reordering. |
| packages/typegpu-gl/tests/glslGenerator.test.ts | Adds GLSL tests mirroring WGSL warnings plus entry-point return warning coverage. |
| packages/typegpu-gl/src/glslGenerator.ts | Emits a warning when entry-point return contains an extra property not in the expected output struct. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
cieplypolar
force-pushed
the
impr/warn-schema-order
branch
2 times, most recently
from
September 2, 2026 10:44
e210e51 to
c91116f
Compare
cieplypolar
requested review from
aleksanderkatan,
iwoplaza,
reczkok and
vende11s
September 2, 2026 11:57
cieplypolar
force-pushed
the
impr/warn-schema-order
branch
from
September 2, 2026 12:00
4a05e2a to
1437dea
Compare
cieplypolar
force-pushed
the
impr/warn-schema-order
branch
from
September 4, 2026 15:37
1437dea to
78a5223
Compare
cieplypolar
force-pushed
the
impr/warn-schema-order
branch
from
September 4, 2026 15:41
78a5223 to
3d4ea98
Compare
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.
No description provided.