Skip to content

fix: Inter struct casts#2451

Open
iwoplaza wants to merge 22 commits into
mainfrom
fix/inter-struct-copies
Open

fix: Inter struct casts#2451
iwoplaza wants to merge 22 commits into
mainfrom
fix/inter-struct-copies

Conversation

@iwoplaza
Copy link
Copy Markdown
Collaborator

@iwoplaza iwoplaza commented May 7, 2026

No description provided.

@iwoplaza iwoplaza linked an issue May 7, 2026 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

pkg.pr.new

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

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

benchmark
view benchmark

commit
view commit

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

📊 Bundle Size Comparison

🟢 Decreased ➖ Unchanged 🔴 Increased ❔ Unknown
0 56 298 0

👀 Notable results

Static test results:

Test tsdown
dataImportOneDirect.ts 23.89 kB ($${\color{red}+3.7\%}$$)
dataImportOneStar.ts 23.89 kB ($${\color{red}+3.7\%}$$)
stdImportOneDirect.ts 47.58 kB ($${\color{red}+2.1\%}$$)
stdImportOneStar.ts 47.58 kB ($${\color{red}+2.1\%}$$)
dataImportEverything.ts 88.48 kB ($${\color{red}+1.0\%}$$)
stdImportEverything.ts 104.24 kB ($${\color{red}+0.9\%}$$)

Dynamic test results:

‼️ Click to reveal the results table (269 entries).
Test tsdown
bool from typegpudata.ts 12.25 kB ($${\color{red}+8.4\%}$$)
f16 from typegpudata.ts 12.25 kB ($${\color{red}+8.4\%}$$)
f32 from typegpudata.ts 12.25 kB ($${\color{red}+8.4\%}$$)
i32 from typegpudata.ts 12.25 kB ($${\color{red}+8.4\%}$$)
u32 from typegpudata.ts 12.25 kB ($${\color{red}+8.4\%}$$)
u16 from typegpudata.ts 12.28 kB ($${\color{red}+8.4\%}$$)
textureDepth2d from typegpudata.ts 12.70 kB ($${\color{red}+8.1\%}$$)
textureDepthCube from typegpudata.ts 12.70 kB ($${\color{red}+8.1\%}$$)
texture1d from typegpudata.ts 12.71 kB ($${\color{red}+8.1\%}$$)
texture2d from typegpudata.ts 12.71 kB ($${\color{red}+8.1\%}$$)
texture3d from typegpudata.ts 12.71 kB ($${\color{red}+8.1\%}$$)
textureCube from typegpudata.ts 12.71 kB ($${\color{red}+8.1\%}$$)
textureDepth2dArray from typegpudata.ts 12.71 kB ($${\color{red}+8.1\%}$$)
textureDepthCubeArray from typegpudata.ts 12.72 kB ($${\color{red}+8.1\%}$$)
textureDepthMultisampled2d from typegpudata.ts 12.72 kB ($${\color{red}+8.1\%}$$)
texture2dArray from typegpudata.ts 12.72 kB ($${\color{red}+8.1\%}$$)
textureCubeArray from typegpudata.ts 12.73 kB ($${\color{red}+8.1\%}$$)
textureMultisampled2d from typegpudata.ts 12.73 kB ($${\color{red}+8.1\%}$$)
discard from typegpustd.ts 13.47 kB ($${\color{red}+7.6\%}$$)
copy from typegpustd.ts 13.71 kB ($${\color{red}+7.5\%}$$)
arrayLength from typegpustd.ts 13.71 kB ($${\color{red}+7.5\%}$$)
extensionEnabled from typegpustd.ts 13.80 kB ($${\color{red}+7.4\%}$$)
range from typegpustd.ts 14.07 kB ($${\color{red}+7.3\%}$$)
disarrayOf from typegpudata.ts 14.23 kB ($${\color{red}+7.2\%}$$)
dpdx from typegpustd.ts 14.31 kB ($${\color{red}+7.1\%}$$)
dpdxCoarse from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
dpdxFine from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
dpdyCoarse from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
dpdyFine from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
dpdy from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
fwidthCoarse from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
fwidthFine from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
fwidth from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
atomicLoad from typegpustd.ts 15.07 kB ($${\color{red}+6.8\%}$$)
atomicStore from typegpustd.ts 15.07 kB ($${\color{red}+6.8\%}$$)
textureBarrier from typegpustd.ts 15.07 kB ($${\color{red}+6.8\%}$$)
atomicAdd from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
atomicAnd from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
atomicMax from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
atomicMin from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
atomicOr from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
atomicSub from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
atomicXor from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
storageBarrier from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
workgroupBarrier from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
vec2b from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec2f from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec2h from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec2i from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec2u from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec3b from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec3f from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec3h from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec3i from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec3u from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec4b from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec4f from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec4h from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec4i from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec4u from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
formatToWGSLType from typegpudata.ts 20.16 kB ($${\color{red}+5.0\%}$$)
uint8 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float16 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float16x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float16x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float32 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float32x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float32x3 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float32x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint16 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint16x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint16x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint32 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint32x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint32x3 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint32x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint8 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint8x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint8x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
snorm16 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
snorm16x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
snorm16x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
snorm8 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
snorm8x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
snorm8x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint16 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint16x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint16x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint32 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint32x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint32x3 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint32x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint8x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint8x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm10 10 10 2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm16 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm16x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm16x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm8 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm8x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm8x4 bgra from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm8x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
packedFormats from typegpudata.ts 20.19 kB ($${\color{red}+5.0\%}$$)
isPackedData from typegpudata.ts 20.23 kB ($${\color{red}+5.0\%}$$)
subgroupAdd from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupAll from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupAnd from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupAny from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupBallot from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupBroadcastFirst from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupBroadcast from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupElect from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupExclusiveAdd from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupExclusiveMul from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupInclusiveAdd from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupInclusiveMul from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupMax from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupMin from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupMul from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupOr from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupShuffleDown from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupShuffleUp from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupShuffleXor from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupShuffle from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupXor from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
alignmentOf from typegpudata.ts 21.12 kB ($${\color{red}+4.3\%}$$)
textureDimensions from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureGather from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureLoad from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSampleBaseClampToEdge from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSampleBias from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSampleCompareLevel from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSampleCompare from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSampleGrad from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSampleLevel from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSample from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureStore from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
mat4x4f from typegpudata.ts 26.20 kB ($${\color{red}+3.8\%}$$)
identity2 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
identity3 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
identity4 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
mat2x2f from typegpudata.ts 26.20 kB ($${\color{red}+3.8\%}$$)
mat3x3f from typegpudata.ts 26.20 kB ($${\color{red}+3.8\%}$$)
rotationX4 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
rotationY4 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
rotationZ4 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
scaling4 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
translation4 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
matToArray from typegpudata.ts 26.33 kB ($${\color{red}+3.8\%}$$)
isBuiltin from typegpudata.ts 23.84 kB ($${\color{red}+3.8\%}$$)
sizeOf from typegpudata.ts 23.89 kB ($${\color{red}+3.7\%}$$)
isContiguous from typegpudata.ts 23.90 kB ($${\color{red}+3.7\%}$$)
getLongestContiguousPrefix from typegpudata.ts 23.91 kB ($${\color{red}+3.7\%}$$)
arrayOf from typegpudata.ts 25.38 kB ($${\color{red}+3.5\%}$$)
size from typegpudata.ts 25.58 kB ($${\color{red}+3.5\%}$$)
align from typegpudata.ts 25.58 kB ($${\color{red}+3.5\%}$$)
location from typegpudata.ts 25.58 kB ($${\color{red}+3.5\%}$$)
interpolate from typegpudata.ts 25.58 kB ($${\color{red}+3.5\%}$$)
invariant from typegpudata.ts 25.95 kB ($${\color{red}+3.4\%}$$)
builtin from typegpudata.ts 27.76 kB ($${\color{red}+3.2\%}$$)
pack2x16float from typegpustd.ts 35.21 kB ($${\color{red}+2.8\%}$$)
pack4x8unorm from typegpustd.ts 35.21 kB ($${\color{red}+2.8\%}$$)
unpack2x16float from typegpustd.ts 35.21 kB ($${\color{red}+2.8\%}$$)
unpack4x8unorm from typegpustd.ts 35.21 kB ($${\color{red}+2.8\%}$$)
bitcastU32toF32 from typegpustd.ts 43.40 kB ($${\color{red}+2.3\%}$$)
bitcastU32toI32 from typegpustd.ts 43.41 kB ($${\color{red}+2.3\%}$$)
memoryLayoutOf from typegpudata.ts 41.21 kB ($${\color{red}+2.1\%}$$)
neg from typegpustd.ts 47.57 kB ($${\color{red}+2.1\%}$$)
add from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
bitShiftLeft from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
bitShiftRight from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
div from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
mod from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
mul from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
sub from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
rotateX4 from typegpustd.ts 48.34 kB ($${\color{red}+2.0\%}$$)
scale4 from typegpustd.ts 48.34 kB ($${\color{red}+2.0\%}$$)
translate4 from typegpustd.ts 48.34 kB ($${\color{red}+2.0\%}$$)
rotateY4 from typegpustd.ts 48.34 kB ($${\color{red}+2.0\%}$$)
rotateZ4 from typegpustd.ts 48.34 kB ($${\color{red}+2.0\%}$$)
and from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
or from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
allEq from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
all from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
eq from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
lt from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
ne from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
not from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
any from typegpustd.ts 50.53 kB ($${\color{red}+1.9\%}$$)
ge from typegpustd.ts 50.53 kB ($${\color{red}+1.9\%}$$)
gt from typegpustd.ts 50.53 kB ($${\color{red}+1.9\%}$$)
isCloseTo from typegpustd.ts 50.53 kB ($${\color{red}+1.9\%}$$)
le from typegpustd.ts 50.53 kB ($${\color{red}+1.9\%}$$)
select from typegpustd.ts 50.53 kB ($${\color{red}+1.9\%}$$)
writeToArrayBuffer from typegpu.ts 50.15 kB ($${\color{red}+1.8\%}$$)
patchArrayBuffer from typegpu.ts 50.35 kB ($${\color{red}+1.7\%}$$)
readFromArrayBuffer from typegpu.ts 50.90 kB ($${\color{red}+1.7\%}$$)
common from typegpu.ts 57.42 kB ($${\color{red}+1.5\%}$$)
dot from typegpustd.ts 65.02 kB ($${\color{red}+1.5\%}$$)
length from typegpustd.ts 65.02 kB ($${\color{red}+1.5\%}$$)
distance from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
dot4U8Packed from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
fract from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
frexp from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
mix from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
modf from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
abs from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
acos from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
acosh from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
asin from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
asinh from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
atan2 from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
atan from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
atanh from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
ceil from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
clamp from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
cos from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
cosh from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
countLeadingZeros from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
countOneBits from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
countTrailingZeros from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
cross from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
degrees from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
determinant from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
dot4I8Packed from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
exp2 from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
exp from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
extractBits from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
faceForward from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
firstLeadingBit from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
firstTrailingBit from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
floor from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
fma from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
insertBits from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
inverseSqrt from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
ldexp from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
log2 from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
log from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
max from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
min from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
normalize from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
pow from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
quantizeToF16 from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
radians from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
reflect from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
refract from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
reverseBits from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
round from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
saturate from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
sign from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
sin from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
sinh from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
smoothstep from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
sqrt from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
step from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
tan from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
tanh from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
transpose from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
trunc from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
isUsableAsUniform from typegpu.ts 62.04 kB ($${\color{red}+1.3\%}$$)
isTexture from typegpu.ts 62.06 kB ($${\color{red}+1.3\%}$$)
isSampler from typegpu.ts 62.06 kB ($${\color{red}+1.3\%}$$)
isComparisonSampler from typegpu.ts 62.07 kB ($${\color{red}+1.3\%}$$)
isVariable from typegpu.ts 63.83 kB ($${\color{red}+1.3\%}$$)
d from typegpu.ts 86.16 kB ($${\color{red}+1.0\%}$$)
std from typegpu.ts 101.46 kB ($${\color{red}+1.0\%}$$)
isUsableAsVertex from typegpu.ts 87.62 kB ($${\color{red}+0.9\%}$$)
isBuffer from typegpu.ts 87.63 kB ($${\color{red}+0.9\%}$$)
WgslGenerator from typegpu.ts 108.63 kB ($${\color{red}+0.7\%}$$)

📋 All results

Click to reveal the results table (353 entries).
Test tsdown
bool from typegpudata.ts 12.25 kB ($${\color{red}+8.4\%}$$)
f16 from typegpudata.ts 12.25 kB ($${\color{red}+8.4\%}$$)
f32 from typegpudata.ts 12.25 kB ($${\color{red}+8.4\%}$$)
i32 from typegpudata.ts 12.25 kB ($${\color{red}+8.4\%}$$)
u32 from typegpudata.ts 12.25 kB ($${\color{red}+8.4\%}$$)
u16 from typegpudata.ts 12.28 kB ($${\color{red}+8.4\%}$$)
textureDepth2d from typegpudata.ts 12.70 kB ($${\color{red}+8.1\%}$$)
textureDepthCube from typegpudata.ts 12.70 kB ($${\color{red}+8.1\%}$$)
texture1d from typegpudata.ts 12.71 kB ($${\color{red}+8.1\%}$$)
texture2d from typegpudata.ts 12.71 kB ($${\color{red}+8.1\%}$$)
texture3d from typegpudata.ts 12.71 kB ($${\color{red}+8.1\%}$$)
textureCube from typegpudata.ts 12.71 kB ($${\color{red}+8.1\%}$$)
textureDepth2dArray from typegpudata.ts 12.71 kB ($${\color{red}+8.1\%}$$)
textureDepthCubeArray from typegpudata.ts 12.72 kB ($${\color{red}+8.1\%}$$)
textureDepthMultisampled2d from typegpudata.ts 12.72 kB ($${\color{red}+8.1\%}$$)
texture2dArray from typegpudata.ts 12.72 kB ($${\color{red}+8.1\%}$$)
textureCubeArray from typegpudata.ts 12.73 kB ($${\color{red}+8.1\%}$$)
textureMultisampled2d from typegpudata.ts 12.73 kB ($${\color{red}+8.1\%}$$)
discard from typegpustd.ts 13.47 kB ($${\color{red}+7.6\%}$$)
copy from typegpustd.ts 13.71 kB ($${\color{red}+7.5\%}$$)
arrayLength from typegpustd.ts 13.71 kB ($${\color{red}+7.5\%}$$)
extensionEnabled from typegpustd.ts 13.80 kB ($${\color{red}+7.4\%}$$)
range from typegpustd.ts 14.07 kB ($${\color{red}+7.3\%}$$)
disarrayOf from typegpudata.ts 14.23 kB ($${\color{red}+7.2\%}$$)
dpdx from typegpustd.ts 14.31 kB ($${\color{red}+7.1\%}$$)
dpdxCoarse from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
dpdxFine from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
dpdyCoarse from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
dpdyFine from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
dpdy from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
fwidthCoarse from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
fwidthFine from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
fwidth from typegpustd.ts 14.32 kB ($${\color{red}+7.1\%}$$)
atomicLoad from typegpustd.ts 15.07 kB ($${\color{red}+6.8\%}$$)
atomicStore from typegpustd.ts 15.07 kB ($${\color{red}+6.8\%}$$)
textureBarrier from typegpustd.ts 15.07 kB ($${\color{red}+6.8\%}$$)
atomicAdd from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
atomicAnd from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
atomicMax from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
atomicMin from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
atomicOr from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
atomicSub from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
atomicXor from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
storageBarrier from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
workgroupBarrier from typegpustd.ts 15.08 kB ($${\color{red}+6.7\%}$$)
vec2b from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec2f from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec2h from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec2i from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec2u from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec3b from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec3f from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec3h from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec3i from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec3u from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec4b from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec4f from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec4h from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec4i from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
vec4u from typegpudata.ts 18.67 kB ($${\color{red}+5.4\%}$$)
formatToWGSLType from typegpudata.ts 20.16 kB ($${\color{red}+5.0\%}$$)
uint8 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float16 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float16x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float16x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float32 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float32x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float32x3 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
float32x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint16 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint16x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint16x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint32 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint32x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint32x3 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint32x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint8 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint8x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
sint8x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
snorm16 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
snorm16x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
snorm16x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
snorm8 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
snorm8x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
snorm8x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint16 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint16x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint16x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint32 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint32x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint32x3 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint32x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint8x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
uint8x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm10 10 10 2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm16 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm16x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm16x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm8 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm8x2 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm8x4 bgra from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
unorm8x4 from typegpudata.ts 20.17 kB ($${\color{red}+5.0\%}$$)
packedFormats from typegpudata.ts 20.19 kB ($${\color{red}+5.0\%}$$)
isPackedData from typegpudata.ts 20.23 kB ($${\color{red}+5.0\%}$$)
subgroupAdd from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupAll from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupAnd from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupAny from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupBallot from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupBroadcastFirst from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupBroadcast from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupElect from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupExclusiveAdd from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupExclusiveMul from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupInclusiveAdd from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupInclusiveMul from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupMax from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupMin from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupMul from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupOr from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupShuffleDown from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupShuffleUp from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupShuffleXor from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupShuffle from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
subgroupXor from typegpustd.ts 23.25 kB ($${\color{red}+4.3\%}$$)
alignmentOf from typegpudata.ts 21.12 kB ($${\color{red}+4.3\%}$$)
textureDimensions from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureGather from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureLoad from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSampleBaseClampToEdge from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSampleBias from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSampleCompareLevel from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSampleCompare from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSampleGrad from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSampleLevel from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureSample from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
textureStore from typegpustd.ts 25.01 kB ($${\color{red}+4.0\%}$$)
mat4x4f from typegpudata.ts 26.20 kB ($${\color{red}+3.8\%}$$)
identity2 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
identity3 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
identity4 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
mat2x2f from typegpudata.ts 26.20 kB ($${\color{red}+3.8\%}$$)
mat3x3f from typegpudata.ts 26.20 kB ($${\color{red}+3.8\%}$$)
rotationX4 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
rotationY4 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
rotationZ4 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
scaling4 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
translation4 from typegpustd.ts 26.20 kB ($${\color{red}+3.8\%}$$)
matToArray from typegpudata.ts 26.33 kB ($${\color{red}+3.8\%}$$)
isBuiltin from typegpudata.ts 23.84 kB ($${\color{red}+3.8\%}$$)
dataImportOneDirect.ts 23.89 kB ($${\color{red}+3.7\%}$$)
dataImportOneStar.ts 23.89 kB ($${\color{red}+3.7\%}$$)
sizeOf from typegpudata.ts 23.89 kB ($${\color{red}+3.7\%}$$)
isContiguous from typegpudata.ts 23.90 kB ($${\color{red}+3.7\%}$$)
getLongestContiguousPrefix from typegpudata.ts 23.91 kB ($${\color{red}+3.7\%}$$)
arrayOf from typegpudata.ts 25.38 kB ($${\color{red}+3.5\%}$$)
size from typegpudata.ts 25.58 kB ($${\color{red}+3.5\%}$$)
align from typegpudata.ts 25.58 kB ($${\color{red}+3.5\%}$$)
location from typegpudata.ts 25.58 kB ($${\color{red}+3.5\%}$$)
interpolate from typegpudata.ts 25.58 kB ($${\color{red}+3.5\%}$$)
invariant from typegpudata.ts 25.95 kB ($${\color{red}+3.4\%}$$)
builtin from typegpudata.ts 27.76 kB ($${\color{red}+3.2\%}$$)
pack2x16float from typegpustd.ts 35.21 kB ($${\color{red}+2.8\%}$$)
pack4x8unorm from typegpustd.ts 35.21 kB ($${\color{red}+2.8\%}$$)
unpack2x16float from typegpustd.ts 35.21 kB ($${\color{red}+2.8\%}$$)
unpack4x8unorm from typegpustd.ts 35.21 kB ($${\color{red}+2.8\%}$$)
bitcastU32toF32 from typegpustd.ts 43.40 kB ($${\color{red}+2.3\%}$$)
bitcastU32toI32 from typegpustd.ts 43.41 kB ($${\color{red}+2.3\%}$$)
memoryLayoutOf from typegpudata.ts 41.21 kB ($${\color{red}+2.1\%}$$)
neg from typegpustd.ts 47.57 kB ($${\color{red}+2.1\%}$$)
add from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
bitShiftLeft from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
bitShiftRight from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
div from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
mod from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
mul from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
sub from typegpustd.ts 47.58 kB ($${\color{red}+2.1\%}$$)
stdImportOneDirect.ts 47.58 kB ($${\color{red}+2.1\%}$$)
stdImportOneStar.ts 47.58 kB ($${\color{red}+2.1\%}$$)
rotateX4 from typegpustd.ts 48.34 kB ($${\color{red}+2.0\%}$$)
scale4 from typegpustd.ts 48.34 kB ($${\color{red}+2.0\%}$$)
translate4 from typegpustd.ts 48.34 kB ($${\color{red}+2.0\%}$$)
rotateY4 from typegpustd.ts 48.34 kB ($${\color{red}+2.0\%}$$)
rotateZ4 from typegpustd.ts 48.34 kB ($${\color{red}+2.0\%}$$)
and from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
or from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
allEq from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
all from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
eq from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
lt from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
ne from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
not from typegpustd.ts 50.52 kB ($${\color{red}+1.9\%}$$)
any from typegpustd.ts 50.53 kB ($${\color{red}+1.9\%}$$)
ge from typegpustd.ts 50.53 kB ($${\color{red}+1.9\%}$$)
gt from typegpustd.ts 50.53 kB ($${\color{red}+1.9\%}$$)
isCloseTo from typegpustd.ts 50.53 kB ($${\color{red}+1.9\%}$$)
le from typegpustd.ts 50.53 kB ($${\color{red}+1.9\%}$$)
select from typegpustd.ts 50.53 kB ($${\color{red}+1.9\%}$$)
writeToArrayBuffer from typegpu.ts 50.15 kB ($${\color{red}+1.8\%}$$)
patchArrayBuffer from typegpu.ts 50.35 kB ($${\color{red}+1.7\%}$$)
readFromArrayBuffer from typegpu.ts 50.90 kB ($${\color{red}+1.7\%}$$)
common from typegpu.ts 57.42 kB ($${\color{red}+1.5\%}$$)
dot from typegpustd.ts 65.02 kB ($${\color{red}+1.5\%}$$)
length from typegpustd.ts 65.02 kB ($${\color{red}+1.5\%}$$)
distance from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
dot4U8Packed from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
fract from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
frexp from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
mix from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
modf from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
abs from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
acos from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
acosh from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
asin from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
asinh from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
atan2 from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
atan from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
atanh from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
ceil from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
clamp from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
cos from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
cosh from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
countLeadingZeros from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
countOneBits from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
countTrailingZeros from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
cross from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
degrees from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
determinant from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
dot4I8Packed from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
exp2 from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
exp from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
extractBits from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
faceForward from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
firstLeadingBit from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
firstTrailingBit from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
floor from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
fma from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
insertBits from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
inverseSqrt from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
ldexp from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
log2 from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
log from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
max from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
min from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
normalize from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
pow from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
quantizeToF16 from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
radians from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
reflect from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
refract from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
reverseBits from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
round from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
saturate from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
sign from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
sin from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
sinh from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
smoothstep from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
sqrt from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
step from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
tan from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
tanh from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
transpose from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
trunc from typegpustd.ts 65.03 kB ($${\color{red}+1.5\%}$$)
isUsableAsUniform from typegpu.ts 62.04 kB ($${\color{red}+1.3\%}$$)
isTexture from typegpu.ts 62.06 kB ($${\color{red}+1.3\%}$$)
isSampler from typegpu.ts 62.06 kB ($${\color{red}+1.3\%}$$)
isComparisonSampler from typegpu.ts 62.07 kB ($${\color{red}+1.3\%}$$)
isVariable from typegpu.ts 63.83 kB ($${\color{red}+1.3\%}$$)
d from typegpu.ts 86.16 kB ($${\color{red}+1.0\%}$$)
dataImportEverything.ts 88.48 kB ($${\color{red}+1.0\%}$$)
std from typegpu.ts 101.46 kB ($${\color{red}+1.0\%}$$)
stdImportEverything.ts 104.24 kB ($${\color{red}+0.9\%}$$)
isUsableAsVertex from typegpu.ts 87.62 kB ($${\color{red}+0.9\%}$$)
isBuffer from typegpu.ts 87.63 kB ($${\color{red}+0.9\%}$$)
WgslGenerator from typegpu.ts 108.63 kB ($${\color{red}+0.7\%}$$)
tgpuImportEverything.ts 258.17 kB ($${\color{red}+0.3\%}$$)
tgpu from typegpu.ts 258.17 kB ($${\color{red}+0.3\%}$$)
tgpu.fn from typegpu.ts 258.18 kB ($${\color{red}+0.3\%}$$)
tgpu.init from typegpu.ts 258.18 kB ($${\color{red}+0.3\%}$$)
tgpu.lazy from typegpu.ts 258.18 kB ($${\color{red}+0.3\%}$$)
tgpu.slot from typegpu.ts 258.18 kB ($${\color{red}+0.3\%}$$)
tgpu.const from typegpu.ts 258.18 kB ($${\color{red}+0.3\%}$$)
tgpu.unroll from typegpu.ts 258.18 kB ($${\color{red}+0.3\%}$$)
tgpu.resolve from typegpu.ts 258.18 kB ($${\color{red}+0.3\%}$$)
tgpu.accessor from typegpu.ts 258.18 kB ($${\color{red}+0.3\%}$$)
tgpu.comptime from typegpu.ts 258.18 kB ($${\color{red}+0.3\%}$$)
tgpu.vertexFn from typegpu.ts 258.18 kB ($${\color{red}+0.3\%}$$)
tgpu.computeFn from typegpu.ts 258.18 kB ($${\color{red}+0.3\%}$$)
tgpu.fragmentFn from typegpu.ts 258.19 kB ($${\color{red}+0.3\%}$$)
tgpu.privateVar from typegpu.ts 258.19 kB ($${\color{red}+0.3\%}$$)
tgpuImportOne.ts 258.19 kB ($${\color{red}+0.3\%}$$)
tgpu.vertexLayout from typegpu.ts 258.19 kB ($${\color{red}+0.3\%}$$)
tgpu.workgroupVar from typegpu.ts 258.19 kB ($${\color{red}+0.3\%}$$)
tgpu.initFromDevice from typegpu.ts 258.19 kB ($${\color{red}+0.3\%}$$)
tgpu.bindGroupLayout from typegpu.ts 258.19 kB ($${\color{red}+0.3\%}$$)
tgpu.mutableAccessor from typegpu.ts 258.19 kB ($${\color{red}+0.3\%}$$)
tgpu.resolveWithContext from typegpu.ts 258.19 kB ($${\color{red}+0.3\%}$$)
importEntireLibrary.ts 285.70 kB ($${\color{red}+0.3\%}$$)
functionWithUseGpu.ts 282 B (➖)
functionWithoutUseGpu.ts 24 B (➖)
MissingBindGroupsError from typegpu.ts 1.35 kB (➖)
MissingSlotValueError from typegpu.ts 151 B (➖)
MissingVertexBuffersError from typegpu.ts 1.36 kB (➖)
NotUniformError from typegpu.ts 1.31 kB (➖)
ResolutionError from typegpu.ts 2.34 kB (➖)
ShaderGenerator from typegpu.ts 552 B (➖)
Void from typegpudata.ts 734 B (➖)
atomic from typegpudata.ts 779 B (➖)
comparisonSampler from typegpudata.ts 753 B (➖)
deepEqual from typegpudata.ts 2.19 kB (➖)
isAccessor from typegpu.ts 65 B (➖)
isAlignAttrib from typegpudata.ts 755 B (➖)
isAtomic from typegpudata.ts 755 B (➖)
isBufferShorthand from typegpu.ts 1.71 kB (➖)
isBuiltinAttrib from typegpudata.ts 757 B (➖)
isData from typegpudata.ts 1.81 kB (➖)
isDecorated from typegpudata.ts 758 B (➖)
isDisarray from typegpudata.ts 1.11 kB (➖)
isInterpolateAttrib from typegpudata.ts 761 B (➖)
isLazy from typegpu.ts 61 B (➖)
isLocationAttrib from typegpudata.ts 758 B (➖)
isLooseData from typegpudata.ts 1.16 kB (➖)
isLooseDecorated from typegpudata.ts 1.12 kB (➖)
isMutableAccessor from typegpu.ts 73 B (➖)
isPtr from typegpudata.ts 752 B (➖)
isSizeAttrib from typegpudata.ts 754 B (➖)
isSlot from typegpu.ts 61 B (➖)
isTgpuComputeFn from typegpu.ts 69 B (➖)
isTgpuFn from typegpu.ts 765 B (➖)
isTgpuFragmentFn from typegpu.ts 70 B (➖)
isTgpuVertexFn from typegpu.ts 68 B (➖)
isUnstruct from typegpudata.ts 1.11 kB (➖)
isUsableAsRender from typegpu.ts 55 B (➖)
isUsableAsSampled from typegpu.ts 56 B (➖)
isUsableAsStorage from typegpu.ts 56 B (➖)
isWgslArray from typegpudata.ts 754 B (➖)
isWgslData from typegpudata.ts 1.31 kB (➖)
isWgslStruct from typegpudata.ts 755 B (➖)
ptrFn from typegpudata.ts 859 B (➖)
ptrHandle from typegpudata.ts 851 B (➖)
ptrPrivate from typegpudata.ts 858 B (➖)
ptrStorage from typegpudata.ts 856 B (➖)
ptrUniform from typegpudata.ts 852 B (➖)
ptrWorkgroup from typegpudata.ts 860 B (➖)
ref from typegpudata.ts 4.73 kB (➖)
sampler from typegpudata.ts 742 B (➖)
struct from typegpudata.ts 3.42 kB (➖)
textureExternal from typegpudata.ts 873 B (➖)
textureStorage1d from typegpudata.ts 1.01 kB (➖)
textureStorage2dArray from typegpudata.ts 1.03 kB (➖)
textureStorage2d from typegpudata.ts 1.01 kB (➖)
textureStorage3d from typegpudata.ts 1.01 kB (➖)
unstruct from typegpudata.ts 1.55 kB (➖)

If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

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.85, 1.83, 4.18, 6.70, 7.60, 10.23, 21.20, 24.66]
  line [0.96, 1.93, 4.36, 6.71, 7.85, 11.50, 21.31, 23.90]
  line [1.01, 2.18, 4.31, 6.55, 8.00, 12.19, 21.60, 26.52]
Loading
---
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.35, 0.56, 0.72, 0.88, 1.33, 1.28, 1.54, 1.53]
  line [0.30, 0.56, 0.78, 0.92, 1.20, 1.29, 1.57, 1.73]
  line [0.27, 0.54, 0.72, 0.94, 1.22, 1.30, 1.56, 1.71]
Loading
---
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.79, 2.00, 4.19, 7.35, 13.04, 25.85, 56.12, 116.65]
  line [0.94, 2.05, 4.28, 8.04, 12.62, 26.15, 55.52, 116.82]
  line [1.00, 2.23, 5.17, 6.54, 13.63, 27.00, 56.53, 117.23]
Loading

@aleksanderkatan aleksanderkatan self-assigned this May 18, 2026
@aleksanderkatan aleksanderkatan force-pushed the fix/inter-struct-copies branch from 9ae8673 to ed82a37 Compare May 18, 2026 15:09
@aleksanderkatan aleksanderkatan changed the base branch from main to refactor/better-origin-tracking May 18, 2026 15:09
@iwoplaza iwoplaza force-pushed the refactor/better-origin-tracking branch 3 times, most recently from d1131a4 to 4839547 Compare May 19, 2026 13:43
@iwoplaza iwoplaza force-pushed the refactor/better-origin-tracking branch from d6b058d to 9c1810c Compare May 19, 2026 14:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for resolving struct-to-struct “casts” (i.e., copying between different d.struct(...) schemas by expanding into per-property constructor arguments) and introduces test coverage for these scenarios, addressing a failing test related to inter-struct copies.

Changes:

  • Added multiple tests covering struct casts (same-shape, coercing member types, nested structs, subtype→supertype) and expected failure modes.
  • Implemented struct→struct conversion logic in tgsl/conversion.ts to auto-expand casts into Target(prop1, prop2, ...).
  • Extracted struct/unstruct property access into a shared helper (accessStructProp) and reused it from accessProp.ts.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
packages/typegpu/tests/struct.test.ts Adds test cases validating struct cast resolution and error reporting.
packages/typegpu/src/tgsl/generationHelpers.ts Introduces accessStructProp helper for struct/unstruct property access.
packages/typegpu/src/tgsl/conversion.ts Adds struct-to-struct cast ranking + codegen/validation for per-property casting.
packages/typegpu/src/tgsl/accessProp.ts Refactors struct member access to use the shared helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/typegpu/src/tgsl/conversion.ts Outdated
Comment thread packages/typegpu/src/tgsl/conversion.ts
Comment thread packages/typegpu/src/tgsl/conversion.ts Outdated
Comment thread packages/typegpu/src/tgsl/conversion.ts
Comment thread packages/typegpu/src/tgsl/accessProp.ts
@aleksanderkatan aleksanderkatan changed the title [FAILING TEST] fix: Inter struct copies fix: Inter struct casts May 20, 2026
@iwoplaza iwoplaza force-pushed the refactor/better-origin-tracking branch from 9c1810c to 6642a24 Compare May 20, 2026 14:15
@aleksanderkatan
Copy link
Copy Markdown
Contributor

aleksanderkatan commented May 21, 2026

Can we reuse convertStructValues? (note for myself)

We could, however this would silence the error, and the code would not be any cleaner. Actually, why does convertStructValues silence casting errors?

@iwoplaza iwoplaza force-pushed the refactor/better-origin-tracking branch from 6642a24 to bcfac6f Compare May 21, 2026 16:02
Base automatically changed from refactor/better-origin-tracking to main May 21, 2026 16:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread packages/typegpu/src/tgsl/conversion.ts
Comment thread packages/typegpu/src/tgsl/conversion.ts Outdated
@aleksanderkatan aleksanderkatan marked this pull request as ready for review May 22, 2026 11:28
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.

bug: Interaction of different structs with the same fields

3 participants