Skip to content

Conversation

@cieplypolar
Copy link
Collaborator

@cieplypolar cieplypolar commented Jan 8, 2026

Before:

  • Array expression was resolved immediately when the NODE.arrayExpr was encountered in the wgsl generator. Since the resulting snippet's value was a string, we couldn't really access array values.

Now:

  • The NODE.arrayExpr returns an intermediate representation (ArrayExpression). Thereby, we delayed its resolution.

Additional changes:

  • separated logic for calling struct and array schemas in NODE.call
  • moved validation if elements of array are references to ArrayExpression
  • aligned cloning logic for arrays in NODE.call
    -added/modified appropriate tests

Closes #2017.

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

pkg.pr.new

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

https://pkg.pr.new/software-mansion/TypeGPU/typegpu@babc64167a729b39ffe6e40e38b3a5c7d06312dd
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@babc64167a729b39ffe6e40e38b3a5c7d06312dd
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@babc64167a729b39ffe6e40e38b3a5c7d06312dd

benchmark
view benchmark

commit
view commit

@github-actions
Copy link

github-actions bot commented Jan 13, 2026

📊 Bundle Size Comparison

📈 Summary

  • 📈 Increased: 9 bundles

  • 📉 Decreased: 0 bundles

  • Unchanged: 15 bundles

  • Unknown: 0 bundles

📋 Bundle Size Comparison

Test tsdown webpack
dataImportEverything.ts 80.03 kB (➖) 85.34 kB (➖)
dataImportOneDirect.ts 40.28 kB (➖) 40.75 kB (➖)
dataImportOneStar.ts 40.28 kB (➖) 40.75 kB (➖)
functionWithUseGpu.ts 268 B (➖) 276 B (➖)
functionWithoutUseGpu.ts 24 B (➖) 59 B (➖)
importEntireLibrary.ts 257.30 kB ($${\color{red}+0.2\%}$$) 284.38 kB ($${\color{red}+0.2\%}$$)
importEntireLibraryUnused.ts 0 B (➖) 0 B (➖)
stdImportEverything.ts 113.10 kB (➖) 117.60 kB ($${\color{red}+0.0\%}$$)
stdImportOneDirect.ts 61.97 kB (➖) 62.93 kB ($${\color{red}+0.0\%}$$)
stdImportOneStar.ts 61.97 kB (➖) 62.93 kB ($${\color{red}+0.0\%}$$)
tgpuImportEverything.ts 238.31 kB ($${\color{red}+0.2\%}$$) 265.01 kB ($${\color{red}+0.2\%}$$)
tgpuImportOne.ts 238.32 kB ($${\color{red}+0.2\%}$$) 265.02 kB ($${\color{red}+0.2\%}$$)

@cieplypolar cieplypolar marked this pull request as ready for review January 13, 2026 18:56
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.

fix: arrayExpr is resolved too early

2 participants