Skip to content

chore: Update tree shaking tests#2612

Draft
aleksanderkatan wants to merge 34 commits into
mainfrom
chore/update-tree-shaking-tests
Draft

chore: Update tree shaking tests#2612
aleksanderkatan wants to merge 34 commits into
mainfrom
chore/update-tree-shaking-tests

Conversation

@aleksanderkatan

@aleksanderkatan aleksanderkatan commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

I rewrote the entire thing. Now, there are two comparisons:

const named = `\
import { d } from 'typegpu';
console.log(d.f32);
`

const namespace = `\
import * as d from 'typegpu/data';
console.log(d.f32);
`

I dropped the previous table setup, and now there are only two (both optional) tables:

  • measuring bundle size: compare namespace on current branch with namespace on target branch (+10% means that the current bundle is bigger),
  • measuring tree-shakability: compare named on current branch with namespace on current branch (+10% means that namespace import could theoretically be shrunken).

If there are no entries for a table, it is not displayed.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

pkg.pr.new

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

https://pkg.pr.new/software-mansion/TypeGPU/typegpu@a9fbc962c6e0a622760668b986bd30c14e6ef55f
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/cli@a9fbc962c6e0a622760668b986bd30c14e6ef55f
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@a9fbc962c6e0a622760668b986bd30c14e6ef55f
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/react@a9fbc962c6e0a622760668b986bd30c14e6ef55f
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@a9fbc962c6e0a622760668b986bd30c14e6ef55f

benchmark
view benchmark

commit
view commit

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Bundle size comparison (import * as ... in PR vs import * as ... in target):

🟢 Decreased ➖ Unchanged 🔴 Increased ❔ Unknown
0 0 0 318

import * as ... in PR vs import * as ... in target (did bundle size increase?):

Click to reveal the results table (318 entries).
Test tsdown
STATIC_allImports.ts 291.27 kB
STATIC_common.ts 58.60 kB
STATIC_d.ts 89.49 kB
STATIC_std.ts 105.73 kB
STATIC_tgpu.ts 261.40 kB
common_fullScreenTriangle.ts 41.68 kB
common_writeSoA.ts 41.20 kB
d_Void.ts 734 B
d_align.ts 26.31 kB
d_alignmentOf.ts 21.85 kB
d_arrayOf.ts 26.17 kB
d_atomic.ts 779 B
d_bool.ts 12.97 kB
d_builtin.ts 28.63 kB
d_comparisonSampler.ts 753 B
d_deepEqual.ts 2.19 kB
d_disarrayOf.ts 15.02 kB
d_f16.ts 12.97 kB
d_f32.ts 12.97 kB
d_float16.ts 20.91 kB
d_float16x2.ts 20.91 kB
d_float16x4.ts 20.91 kB
d_float32.ts 20.91 kB
d_float32x2.ts 20.91 kB
d_float32x3.ts 20.91 kB
d_float32x4.ts 20.91 kB
d_formatToWGSLType.ts 20.90 kB
d_getLongestContiguousPrefix.ts 24.64 kB
d_i32.ts 12.97 kB
d_interpolate.ts 26.32 kB
d_invariant.ts 26.69 kB
d_isAlignAttrib.ts 755 B
d_isAtomic.ts 755 B
d_isBuiltin.ts 24.57 kB
d_isBuiltinAttrib.ts 757 B
d_isContiguous.ts 24.63 kB
d_isData.ts 1.81 kB
d_isDecorated.ts 758 B
d_isDisarray.ts 1.11 kB
d_isInterpolateAttrib.ts 761 B
d_isLocationAttrib.ts 758 B
d_isLooseData.ts 1.16 kB
d_isLooseDecorated.ts 1.12 kB
d_isPackedData.ts 20.97 kB
d_isPtr.ts 752 B
d_isSizeAttrib.ts 754 B
d_isUnstruct.ts 1.11 kB
d_isWgslArray.ts 754 B
d_isWgslData.ts 1.31 kB
d_isWgslStruct.ts 755 B
d_location.ts 26.31 kB
d_mat2x2f.ts 26.99 kB
d_mat3x3f.ts 26.99 kB
d_mat4x4f.ts 26.99 kB
d_matToArray.ts 27.12 kB
d_memoryLayoutOf.ts 41.95 kB
d_packedFormats.ts 20.92 kB
d_ptrFn.ts 859 B
d_ptrHandle.ts 851 B
d_ptrPrivate.ts 858 B
d_ptrStorage.ts 856 B
d_ptrUniform.ts 852 B
d_ptrWorkgroup.ts 860 B
d_ref.ts 4.79 kB
d_sampler.ts 742 B
d_sint16.ts 20.91 kB
d_sint16x2.ts 20.91 kB
d_sint16x4.ts 20.91 kB
d_sint32.ts 20.91 kB
d_sint32x2.ts 20.91 kB
d_sint32x3.ts 20.91 kB
d_sint32x4.ts 20.91 kB
d_sint8.ts 20.91 kB
d_sint8x2.ts 20.91 kB
d_sint8x4.ts 20.91 kB
d_size.ts 26.31 kB
d_sizeOf.ts 24.62 kB
d_snorm16.ts 20.91 kB
d_snorm16x2.ts 20.91 kB
d_snorm16x4.ts 20.91 kB
d_snorm8.ts 20.91 kB
d_snorm8x2.ts 20.91 kB
d_snorm8x4.ts 20.91 kB
d_struct.ts 3.42 kB
d_texture1d.ts 13.43 kB
d_texture2d.ts 13.43 kB
d_texture2dArray.ts 13.45 kB
d_texture3d.ts 13.43 kB
d_textureCube.ts 13.43 kB
d_textureCubeArray.ts 13.45 kB
d_textureDepth2d.ts 13.42 kB
d_textureDepth2dArray.ts 13.44 kB
d_textureDepthCube.ts 13.42 kB
d_textureDepthCubeArray.ts 13.44 kB
d_textureDepthMultisampled2d.ts 13.44 kB
d_textureExternal.ts 873 B
d_textureMultisampled2d.ts 13.45 kB
d_textureStorage1d.ts 1.01 kB
d_textureStorage2d.ts 1.01 kB
d_textureStorage2dArray.ts 1.03 kB
d_textureStorage3d.ts 1.01 kB
d_u16.ts 13.00 kB
d_u32.ts 12.97 kB
d_uint16.ts 20.91 kB
d_uint16x2.ts 20.91 kB
d_uint16x4.ts 20.91 kB
d_uint32.ts 20.91 kB
d_uint32x2.ts 20.91 kB
d_uint32x3.ts 20.91 kB
d_uint32x4.ts 20.91 kB
d_uint8.ts 20.90 kB
d_uint8x2.ts 20.91 kB
d_uint8x4.ts 20.91 kB
d_unorm10_10_10_2.ts 20.91 kB
d_unorm16.ts 20.91 kB
d_unorm16x2.ts 20.91 kB
d_unorm16x4.ts 20.91 kB
d_unorm8.ts 20.91 kB
d_unorm8x2.ts 20.91 kB
d_unorm8x4.ts 20.91 kB
d_unorm8x4_bgra.ts 20.91 kB
d_unstruct.ts 1.55 kB
d_vec2b.ts 19.41 kB
d_vec2f.ts 19.41 kB
d_vec2h.ts 19.41 kB
d_vec2i.ts 19.41 kB
d_vec2u.ts 19.41 kB
d_vec3b.ts 19.41 kB
d_vec3f.ts 19.41 kB
d_vec3h.ts 19.41 kB
d_vec3i.ts 19.41 kB
d_vec3u.ts 19.41 kB
d_vec4b.ts 19.41 kB
d_vec4f.ts 19.41 kB
d_vec4h.ts 19.41 kB
d_vec4i.ts 19.41 kB
d_vec4u.ts 19.41 kB
std_abs.ts 65.82 kB
std_acos.ts 65.82 kB
std_acosh.ts 65.82 kB
std_add.ts 48.37 kB
std_all.ts 51.74 kB
std_allEq.ts 51.74 kB
std_and.ts 51.74 kB
std_any.ts 51.75 kB
std_arrayLength.ts 14.43 kB
std_asin.ts 65.82 kB
std_asinh.ts 65.82 kB
std_atan.ts 65.82 kB
std_atan2.ts 65.82 kB
std_atanh.ts 65.82 kB
std_atomicAdd.ts 15.80 kB
std_atomicAnd.ts 15.80 kB
std_atomicLoad.ts 15.79 kB
std_atomicMax.ts 15.80 kB
std_atomicMin.ts 15.80 kB
std_atomicOr.ts 15.80 kB
std_atomicStore.ts 15.79 kB
std_atomicSub.ts 15.80 kB
std_atomicXor.ts 15.80 kB
std_bitShiftLeft.ts 48.37 kB
std_bitShiftRight.ts 48.37 kB
std_bitcastU32toF32.ts 44.19 kB
std_bitcastU32toI32.ts 44.20 kB
std_ceil.ts 65.82 kB
std_clamp.ts 65.82 kB
std_copy.ts 14.43 kB
std_cos.ts 65.82 kB
std_cosh.ts 65.82 kB
std_countLeadingZeros.ts 65.82 kB
std_countOneBits.ts 65.82 kB
std_countTrailingZeros.ts 65.82 kB
std_cross.ts 65.82 kB
std_degrees.ts 65.82 kB
std_determinant.ts 65.82 kB
std_discard.ts 14.19 kB
std_distance.ts 65.82 kB
std_div.ts 48.37 kB
std_dot.ts 65.81 kB
std_dot4I8Packed.ts 65.82 kB
std_dot4U8Packed.ts 65.82 kB
std_dpdx.ts 15.03 kB
std_dpdxCoarse.ts 15.04 kB
std_dpdxFine.ts 15.04 kB
std_dpdy.ts 15.04 kB
std_dpdyCoarse.ts 15.04 kB
std_dpdyFine.ts 15.04 kB
std_eq.ts 51.74 kB
std_exp.ts 65.82 kB
std_exp2.ts 65.82 kB
std_extensionEnabled.ts 14.58 kB
std_extractBits.ts 65.82 kB
std_faceForward.ts 65.82 kB
std_firstLeadingBit.ts 65.82 kB
std_firstTrailingBit.ts 65.82 kB
std_floor.ts 65.82 kB
std_fma.ts 65.82 kB
std_fract.ts 65.82 kB
std_frexp.ts 65.82 kB
std_fwidth.ts 15.04 kB
std_fwidthCoarse.ts 15.04 kB
std_fwidthFine.ts 15.04 kB
std_ge.ts 51.75 kB
std_getTargetShaderLanguage.ts 14.53 kB
std_gt.ts 51.75 kB
std_identity2.ts 26.99 kB
std_identity3.ts 26.99 kB
std_identity4.ts 26.99 kB
std_insertBits.ts 65.82 kB
std_inverseSqrt.ts 65.82 kB
std_isBeingTranspiled.ts 14.47 kB
std_isCloseTo.ts 51.75 kB
std_ldexp.ts 65.82 kB
std_le.ts 51.75 kB
std_length.ts 65.81 kB
std_log.ts 65.82 kB
std_log2.ts 65.82 kB
std_lt.ts 51.74 kB
std_max.ts 65.82 kB
std_min.ts 65.82 kB
std_mix.ts 65.82 kB
std_mod.ts 48.37 kB
std_modf.ts 65.82 kB
std_mul.ts 48.37 kB
std_ne.ts 51.74 kB
std_neg.ts 48.36 kB
std_normalize.ts 65.82 kB
std_not.ts 51.74 kB
std_or.ts 51.74 kB
std_pack2x16float.ts 35.94 kB
std_pack4x8unorm.ts 35.94 kB
std_pow.ts 65.82 kB
std_quantizeToF16.ts 65.82 kB
std_radians.ts 65.82 kB
std_range.ts 14.85 kB
std_reflect.ts 65.82 kB
std_refract.ts 65.82 kB
std_reverseBits.ts 65.82 kB
std_rotateX4.ts 49.13 kB
std_rotateY4.ts 49.13 kB
std_rotateZ4.ts 49.13 kB
std_rotationX4.ts 26.99 kB
std_rotationY4.ts 26.99 kB
std_rotationZ4.ts 26.99 kB
std_round.ts 65.82 kB
std_saturate.ts 65.82 kB
std_scale4.ts 49.13 kB
std_scaling4.ts 26.99 kB
std_select.ts 51.74 kB
std_sign.ts 65.82 kB
std_sin.ts 65.82 kB
std_sinh.ts 65.82 kB
std_smoothstep.ts 65.82 kB
std_sqrt.ts 65.82 kB
std_step.ts 65.82 kB
std_storageBarrier.ts 15.80 kB
std_sub.ts 48.37 kB
std_subgroupAdd.ts 23.98 kB
std_subgroupAll.ts 23.99 kB
std_subgroupAnd.ts 23.99 kB
std_subgroupAny.ts 23.99 kB
std_subgroupBallot.ts 23.99 kB
std_subgroupBroadcast.ts 23.99 kB
std_subgroupBroadcastFirst.ts 23.99 kB
std_subgroupElect.ts 23.99 kB
std_subgroupExclusiveAdd.ts 23.99 kB
std_subgroupExclusiveMul.ts 23.99 kB
std_subgroupInclusiveAdd.ts 23.99 kB
std_subgroupInclusiveMul.ts 23.99 kB
std_subgroupMax.ts 23.99 kB
std_subgroupMin.ts 23.99 kB
std_subgroupMul.ts 23.99 kB
std_subgroupOr.ts 23.99 kB
std_subgroupShuffle.ts 23.99 kB
std_subgroupShuffleDown.ts 23.99 kB
std_subgroupShuffleUp.ts 23.99 kB
std_subgroupShuffleXor.ts 23.99 kB
std_subgroupXor.ts 23.99 kB
std_tan.ts 65.82 kB
std_tanh.ts 65.82 kB
std_textureBarrier.ts 15.79 kB
std_textureDimensions.ts 25.74 kB
std_textureGather.ts 25.74 kB
std_textureLoad.ts 25.75 kB
std_textureSample.ts 25.75 kB
std_textureSampleBaseClampToEdge.ts 25.75 kB
std_textureSampleBias.ts 25.75 kB
std_textureSampleCompare.ts 25.75 kB
std_textureSampleCompareLevel.ts 25.75 kB
std_textureSampleGrad.ts 25.75 kB
std_textureSampleLevel.ts 25.75 kB
std_textureStore.ts 25.75 kB
std_translate4.ts 49.13 kB
std_translation4.ts 26.99 kB
std_transpose.ts 65.82 kB
std_trunc.ts 65.82 kB
std_unpack2x16float.ts 35.94 kB
std_unpack4x8unorm.ts 35.94 kB
std_workgroupBarrier.ts 15.80 kB
tgpu_accessor.ts 261.41 kB
tgpu_bindGroupLayout.ts 261.42 kB
tgpu_comptime.ts 261.41 kB
tgpu_computeFn.ts 261.41 kB
tgpu_const.ts 261.41 kB
tgpu_fn.ts 261.41 kB
tgpu_fragmentFn.ts 261.41 kB
tgpu_init.ts 261.41 kB
tgpu_initFromDevice.ts 261.42 kB
tgpu_lazy.ts 261.41 kB
tgpu_mutableAccessor.ts 261.42 kB
tgpu_privateVar.ts 261.41 kB
tgpu_resolve.ts 261.41 kB
tgpu_resolveWithContext.ts 261.42 kB
tgpu_slot.ts 261.41 kB
tgpu_unroll.ts 261.41 kB
tgpu_vertexFn.ts 261.41 kB
tgpu_vertexLayout.ts 261.42 kB
tgpu_workgroupVar.ts 261.42 kB

import { ... } in PR vs import * as ... in PR (is the library tree-shakable?):

Click to reveal the results table (297 entries).
Test tsdown
d_Void.ts 87.17 kB ($${\color{red}+12061.0\%}$$)
d_sampler.ts 87.17 kB ($${\color{red}+11930.3\%}$$)
d_isPtr.ts 87.17 kB ($${\color{red}+11770.1\%}$$)
d_comparisonSampler.ts 87.18 kB ($${\color{red}+11755.9\%}$$)
d_isSizeAttrib.ts 87.18 kB ($${\color{red}+11739.5\%}$$)
d_isWgslArray.ts 87.18 kB ($${\color{red}+11739.4\%}$$)
d_isAlignAttrib.ts 87.18 kB ($${\color{red}+11724.0\%}$$)
d_isWgslStruct.ts 87.18 kB ($${\color{red}+11723.8\%}$$)
d_isAtomic.ts 87.17 kB ($${\color{red}+11723.3\%}$$)
d_isBuiltinAttrib.ts 87.18 kB ($${\color{red}+11693.0\%}$$)
d_isLocationAttrib.ts 87.18 kB ($${\color{red}+11677.6\%}$$)
d_isDecorated.ts 87.18 kB ($${\color{red}+11676.9\%}$$)
d_isInterpolateAttrib.ts 87.18 kB ($${\color{red}+11631.5\%}$$)
d_atomic.ts 87.17 kB ($${\color{red}+11358.8\%}$$)
d_ptrHandle.ts 87.17 kB ($${\color{red}+10389.7\%}$$)
d_ptrUniform.ts 87.18 kB ($${\color{red}+10377.5\%}$$)
d_ptrStorage.ts 87.18 kB ($${\color{red}+10328.5\%}$$)
d_ptrPrivate.ts 87.18 kB ($${\color{red}+10304.2\%}$$)
d_ptrFn.ts 87.17 kB ($${\color{red}+10291.5\%}$$)
d_ptrWorkgroup.ts 87.18 kB ($${\color{red}+10280.2\%}$$)
d_textureExternal.ts 87.18 kB ($${\color{red}+10126.0\%}$$)
d_textureStorage1d.ts 87.18 kB ($${\color{red}+8508.9\%}$$)
d_textureStorage2d.ts 87.18 kB ($${\color{red}+8508.9\%}$$)
d_textureStorage3d.ts 87.18 kB ($${\color{red}+8508.9\%}$$)
d_textureStorage2dArray.ts 87.19 kB ($${\color{red}+8362.5\%}$$)
d_isDisarray.ts 87.18 kB ($${\color{red}+7737.4\%}$$)
d_isUnstruct.ts 87.18 kB ($${\color{red}+7737.4\%}$$)
d_isLooseDecorated.ts 87.18 kB ($${\color{red}+7690.1\%}$$)
d_isLooseData.ts 87.18 kB ($${\color{red}+7426.9\%}$$)
d_isWgslData.ts 87.18 kB ($${\color{red}+6551.9\%}$$)
d_unstruct.ts 87.17 kB ($${\color{red}+5531.9\%}$$)
d_isData.ts 87.17 kB ($${\color{red}+4722.5\%}$$)
d_deepEqual.ts 87.17 kB ($${\color{red}+3876.3\%}$$)
d_struct.ts 87.17 kB ($${\color{red}+2451.9\%}$$)
d_ref.ts 87.17 kB ($${\color{red}+1720.5\%}$$)
std_discard.ts 102.90 kB ($${\color{red}+625.3\%}$$)
std_copy.ts 102.90 kB ($${\color{red}+613.1\%}$$)
std_arrayLength.ts 102.91 kB ($${\color{red}+612.9\%}$$)
std_isBeingTranspiled.ts 102.91 kB ($${\color{red}+611.4\%}$$)
std_getTargetShaderLanguage.ts 102.92 kB ($${\color{red}+608.2\%}$$)
std_extensionEnabled.ts 102.91 kB ($${\color{red}+605.7\%}$$)
std_range.ts 102.90 kB ($${\color{red}+592.9\%}$$)
std_dpdx.ts 102.90 kB ($${\color{red}+584.6\%}$$)
std_fwidthCoarse.ts 102.91 kB ($${\color{red}+584.4\%}$$)
std_dpdxCoarse.ts 102.91 kB ($${\color{red}+584.3\%}$$)
std_dpdyCoarse.ts 102.91 kB ($${\color{red}+584.3\%}$$)
std_fwidthFine.ts 102.91 kB ($${\color{red}+584.3\%}$$)
std_dpdxFine.ts 102.90 kB ($${\color{red}+584.3\%}$$)
std_dpdyFine.ts 102.90 kB ($${\color{red}+584.3\%}$$)
std_fwidth.ts 102.90 kB ($${\color{red}+584.3\%}$$)
std_dpdy.ts 102.90 kB ($${\color{red}+584.3\%}$$)
d_bool.ts 87.17 kB ($${\color{red}+571.9\%}$$)
d_f16.ts 87.17 kB ($${\color{red}+571.8\%}$$)
d_f32.ts 87.17 kB ($${\color{red}+571.8\%}$$)
d_i32.ts 87.17 kB ($${\color{red}+571.8\%}$$)
d_u32.ts 87.17 kB ($${\color{red}+571.8\%}$$)
d_u16.ts 87.17 kB ($${\color{red}+570.6\%}$$)
std_atomicLoad.ts 102.91 kB ($${\color{red}+551.8\%}$$)
std_textureBarrier.ts 102.91 kB ($${\color{red}+551.6\%}$$)
std_atomicStore.ts 102.91 kB ($${\color{red}+551.6\%}$$)
std_workgroupBarrier.ts 102.91 kB ($${\color{red}+551.3\%}$$)
std_storageBarrier.ts 102.91 kB ($${\color{red}+551.3\%}$$)
std_atomicAdd.ts 102.90 kB ($${\color{red}+551.3\%}$$)
std_atomicAnd.ts 102.90 kB ($${\color{red}+551.3\%}$$)
std_atomicMax.ts 102.90 kB ($${\color{red}+551.3\%}$$)
std_atomicMin.ts 102.90 kB ($${\color{red}+551.3\%}$$)
std_atomicSub.ts 102.90 kB ($${\color{red}+551.3\%}$$)
std_atomicXor.ts 102.90 kB ($${\color{red}+551.3\%}$$)
std_atomicOr.ts 102.90 kB ($${\color{red}+551.3\%}$$)
d_textureDepth2d.ts 87.18 kB ($${\color{red}+549.7\%}$$)
d_textureDepthCube.ts 87.18 kB ($${\color{red}+549.5\%}$$)
d_texture1d.ts 87.17 kB ($${\color{red}+549.2\%}$$)
d_texture2d.ts 87.17 kB ($${\color{red}+549.2\%}$$)
d_texture3d.ts 87.17 kB ($${\color{red}+549.2\%}$$)
d_textureDepth2dArray.ts 87.18 kB ($${\color{red}+548.9\%}$$)
d_textureCube.ts 87.18 kB ($${\color{red}+548.9\%}$$)
d_textureDepthCubeArray.ts 87.19 kB ($${\color{red}+548.6\%}$$)
d_textureDepthMultisampled2d.ts 87.19 kB ($${\color{red}+548.6\%}$$)
d_texture2dArray.ts 87.18 kB ($${\color{red}+548.4\%}$$)
d_textureCubeArray.ts 87.18 kB ($${\color{red}+548.1\%}$$)
d_textureMultisampled2d.ts 87.19 kB ($${\color{red}+548.0\%}$$)
d_disarrayOf.ts 87.18 kB ($${\color{red}+480.5\%}$$)
d_vec2b.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec2f.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec2h.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec2i.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec2u.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec3b.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec3f.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec3h.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec3i.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec3u.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec4b.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec4f.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec4h.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec4i.ts 87.17 kB ($${\color{red}+349.2\%}$$)
d_vec4u.ts 87.17 kB ($${\color{red}+349.2\%}$$)
std_subgroupAdd.ts 102.91 kB ($${\color{red}+329.1\%}$$)
std_subgroupBroadcastFirst.ts 102.92 kB ($${\color{red}+329.0\%}$$)
std_subgroupExclusiveAdd.ts 102.92 kB ($${\color{red}+329.0\%}$$)
std_subgroupExclusiveMul.ts 102.92 kB ($${\color{red}+329.0\%}$$)
std_subgroupInclusiveAdd.ts 102.92 kB ($${\color{red}+329.0\%}$$)
std_subgroupInclusiveMul.ts 102.92 kB ($${\color{red}+329.0\%}$$)
std_subgroupShuffleDown.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupShuffleXor.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupBroadcast.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupShuffleUp.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupShuffle.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupBallot.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupElect.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupAll.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupAnd.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupAny.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupMax.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupMin.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupMul.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupXor.ts 102.91 kB ($${\color{red}+329.0\%}$$)
std_subgroupOr.ts 102.91 kB ($${\color{red}+329.0\%}$$)
d_formatToWGSLType.ts 87.18 kB ($${\color{red}+317.2\%}$$)
d_uint8.ts 87.17 kB ($${\color{red}+317.1\%}$$)
d_unorm10_10_10_2.ts 87.18 kB ($${\color{red}+317.0\%}$$)
d_unorm8x4_bgra.ts 87.18 kB ($${\color{red}+317.0\%}$$)
d_float16x2.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_float16x4.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_float32x2.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_float32x3.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_float32x4.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_snorm16x2.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_snorm16x4.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_unorm16x2.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_unorm16x4.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_sint16x2.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_sint16x4.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_sint32x2.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_sint32x3.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_sint32x4.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_snorm8x2.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_snorm8x4.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_uint16x2.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_uint16x4.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_uint32x2.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_uint32x3.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_uint32x4.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_unorm8x2.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_unorm8x4.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_float16.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_float32.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_sint8x2.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_sint8x4.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_snorm16.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_uint8x2.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_uint8x4.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_unorm16.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_sint16.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_sint32.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_snorm8.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_uint16.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_uint32.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_unorm8.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_sint8.ts 87.17 kB ($${\color{red}+317.0\%}$$)
d_packedFormats.ts 87.18 kB ($${\color{red}+316.6\%}$$)
d_isPackedData.ts 87.18 kB ($${\color{red}+315.8\%}$$)
std_textureDimensions.ts 102.91 kB ($${\color{red}+299.8\%}$$)
std_textureGather.ts 102.91 kB ($${\color{red}+299.8\%}$$)
std_textureSampleBaseClampToEdge.ts 102.92 kB ($${\color{red}+299.8\%}$$)
std_textureSampleCompareLevel.ts 102.92 kB ($${\color{red}+299.8\%}$$)
std_textureSampleCompare.ts 102.92 kB ($${\color{red}+299.7\%}$$)
std_textureSampleLevel.ts 102.91 kB ($${\color{red}+299.7\%}$$)
std_textureSampleBias.ts 102.91 kB ($${\color{red}+299.7\%}$$)
std_textureSampleGrad.ts 102.91 kB ($${\color{red}+299.7\%}$$)
std_textureSample.ts 102.91 kB ($${\color{red}+299.7\%}$$)
std_textureStore.ts 102.91 kB ($${\color{red}+299.7\%}$$)
std_textureLoad.ts 102.91 kB ($${\color{red}+299.7\%}$$)
d_alignmentOf.ts 87.18 kB ($${\color{red}+298.9\%}$$)
std_translation4.ts 102.91 kB ($${\color{red}+281.3\%}$$)
std_rotationX4.ts 102.91 kB ($${\color{red}+281.3\%}$$)
std_rotationY4.ts 102.91 kB ($${\color{red}+281.3\%}$$)
std_rotationZ4.ts 102.91 kB ($${\color{red}+281.3\%}$$)
std_identity2.ts 102.90 kB ($${\color{red}+281.3\%}$$)
std_identity3.ts 102.90 kB ($${\color{red}+281.3\%}$$)
std_identity4.ts 102.90 kB ($${\color{red}+281.3\%}$$)
std_scaling4.ts 102.90 kB ($${\color{red}+281.3\%}$$)
d_isBuiltin.ts 87.17 kB ($${\color{red}+254.7\%}$$)
d_sizeOf.ts 87.17 kB ($${\color{red}+254.0\%}$$)
d_isContiguous.ts 87.18 kB ($${\color{red}+253.9\%}$$)
d_getLongestContiguousPrefix.ts 87.19 kB ($${\color{red}+253.8\%}$$)
d_arrayOf.ts 87.17 kB ($${\color{red}+233.1\%}$$)
d_size.ts 87.17 kB ($${\color{red}+231.3\%}$$)
d_align.ts 87.17 kB ($${\color{red}+231.3\%}$$)
d_location.ts 87.17 kB ($${\color{red}+231.3\%}$$)
d_interpolate.ts 87.18 kB ($${\color{red}+231.3\%}$$)
d_invariant.ts 87.17 kB ($${\color{red}+226.7\%}$$)
d_mat4x4f.ts 87.17 kB ($${\color{red}+223.0\%}$$)
d_mat2x2f.ts 87.17 kB ($${\color{red}+223.0\%}$$)
d_mat3x3f.ts 87.17 kB ($${\color{red}+223.0\%}$$)
d_matToArray.ts 87.18 kB ($${\color{red}+221.4\%}$$)
d_builtin.ts 87.17 kB ($${\color{red}+204.5\%}$$)
std_unpack2x16float.ts 102.91 kB ($${\color{red}+186.3\%}$$)
std_unpack4x8unorm.ts 102.91 kB ($${\color{red}+186.3\%}$$)
std_pack2x16float.ts 102.91 kB ($${\color{red}+186.3\%}$$)
std_pack4x8unorm.ts 102.91 kB ($${\color{red}+186.3\%}$$)
std_bitcastU32toF32.ts 102.91 kB ($${\color{red}+132.9\%}$$)
std_bitcastU32toI32.ts 102.91 kB ($${\color{red}+132.9\%}$$)
std_neg.ts 102.90 kB ($${\color{red}+112.8\%}$$)
std_bitShiftRight.ts 102.91 kB ($${\color{red}+112.8\%}$$)
std_bitShiftLeft.ts 102.91 kB ($${\color{red}+112.8\%}$$)
std_add.ts 102.90 kB ($${\color{red}+112.8\%}$$)
std_div.ts 102.90 kB ($${\color{red}+112.8\%}$$)
std_mod.ts 102.90 kB ($${\color{red}+112.8\%}$$)
std_mul.ts 102.90 kB ($${\color{red}+112.8\%}$$)
std_sub.ts 102.90 kB ($${\color{red}+112.8\%}$$)
std_translate4.ts 102.91 kB ($${\color{red}+109.5\%}$$)
std_rotateX4.ts 102.90 kB ($${\color{red}+109.5\%}$$)
std_scale4.ts 102.90 kB ($${\color{red}+109.5\%}$$)
std_rotateY4.ts 102.90 kB ($${\color{red}+109.4\%}$$)
std_rotateZ4.ts 102.90 kB ($${\color{red}+109.4\%}$$)
d_memoryLayoutOf.ts 87.18 kB ($${\color{red}+107.8\%}$$)
std_and.ts 102.90 kB ($${\color{red}+98.9\%}$$)
std_or.ts 102.90 kB ($${\color{red}+98.9\%}$$)
std_select.ts 102.90 kB ($${\color{red}+98.9\%}$$)
std_allEq.ts 102.90 kB ($${\color{red}+98.9\%}$$)
std_all.ts 102.90 kB ($${\color{red}+98.9\%}$$)
std_not.ts 102.90 kB ($${\color{red}+98.9\%}$$)
std_eq.ts 102.90 kB ($${\color{red}+98.9\%}$$)
std_lt.ts 102.90 kB ($${\color{red}+98.9\%}$$)
std_ne.ts 102.90 kB ($${\color{red}+98.9\%}$$)
std_isCloseTo.ts 102.90 kB ($${\color{red}+98.9\%}$$)
std_any.ts 102.90 kB ($${\color{red}+98.8\%}$$)
std_ge.ts 102.90 kB ($${\color{red}+98.8\%}$$)
std_gt.ts 102.90 kB ($${\color{red}+98.8\%}$$)
std_le.ts 102.90 kB ($${\color{red}+98.8\%}$$)
std_dot4U8Packed.ts 102.91 kB ($${\color{red}+56.4\%}$$)
std_length.ts 102.90 kB ($${\color{red}+56.4\%}$$)
std_countTrailingZeros.ts 102.91 kB ($${\color{red}+56.4\%}$$)
std_distance.ts 102.90 kB ($${\color{red}+56.4\%}$$)
std_dot.ts 102.90 kB ($${\color{red}+56.4\%}$$)
std_countLeadingZeros.ts 102.91 kB ($${\color{red}+56.4\%}$$)
std_firstTrailingBit.ts 102.91 kB ($${\color{red}+56.3\%}$$)
std_firstLeadingBit.ts 102.91 kB ($${\color{red}+56.3\%}$$)
std_fract.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_frexp.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_modf.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_quantizeToF16.ts 102.91 kB ($${\color{red}+56.3\%}$$)
std_mix.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_countOneBits.ts 102.91 kB ($${\color{red}+56.3\%}$$)
std_dot4I8Packed.ts 102.91 kB ($${\color{red}+56.3\%}$$)
std_determinant.ts 102.91 kB ($${\color{red}+56.3\%}$$)
std_extractBits.ts 102.91 kB ($${\color{red}+56.3\%}$$)
std_faceForward.ts 102.91 kB ($${\color{red}+56.3\%}$$)
std_inverseSqrt.ts 102.91 kB ($${\color{red}+56.3\%}$$)
std_reverseBits.ts 102.91 kB ($${\color{red}+56.3\%}$$)
std_insertBits.ts 102.91 kB ($${\color{red}+56.3\%}$$)
std_smoothstep.ts 102.91 kB ($${\color{red}+56.3\%}$$)
std_normalize.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_transpose.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_saturate.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_degrees.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_radians.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_reflect.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_refract.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_acosh.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_asinh.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_atan2.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_atanh.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_clamp.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_cross.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_floor.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_ldexp.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_round.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_trunc.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_acos.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_asin.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_atan.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_ceil.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_cosh.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_exp2.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_log2.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_sign.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_sinh.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_sqrt.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_step.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_tanh.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_abs.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_cos.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_exp.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_fma.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_log.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_max.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_min.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_pow.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_sin.ts 102.90 kB ($${\color{red}+56.3\%}$$)
std_tan.ts 102.90 kB ($${\color{red}+56.3\%}$$)
common_writeSoA.ts 58.45 kB ($${\color{red}+41.9\%}$$)
common_fullScreenTriangle.ts 58.46 kB ($${\color{red}+40.2\%}$$)
STATIC_allImports.ts 286.25 kB ($${\color{green}-1.7\%}$$)
STATIC_d.ts 87.17 kB ($${\color{green}-2.6\%}$$)
STATIC_std.ts 102.89 kB ($${\color{green}-2.7\%}$$)

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

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

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.80, 1.64, 3.34, 5.27, 6.63, 9.43, 19.22, 21.03]
  line [0.85, 1.76, 3.64, 5.49, 6.70, 10.30, 18.43, 19.21]
  line [0.90, 1.73, 3.76, 5.19, 6.70, 10.34, 19.46, 18.64]
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.33, 0.52, 0.70, 0.78, 1.02, 1.04, 1.25, 1.46]
  line [0.28, 0.48, 0.63, 0.75, 1.05, 1.06, 1.29, 1.42]
  line [0.34, 0.54, 0.66, 0.77, 1.08, 1.11, 1.31, 1.52]
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.81, 1.83, 3.66, 5.32, 10.49, 22.68, 49.18, 99.65]
  line [0.77, 1.74, 3.87, 6.03, 11.23, 22.75, 48.33, 100.47]
  line [0.77, 1.87, 3.50, 5.71, 10.58, 22.36, 49.24, 100.63]
Loading

@aleksanderkatan

Copy link
Copy Markdown
Contributor Author

@pullfrog can you review this?

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed changes — rewrites the tree-shaking test harness to compare named vs namespace import variants, adding typegpu/common coverage alongside the existing typegpu, typegpu/data, and typegpu/std namespaces.

  • Split test runs into named and namespace variants — CI runs two test suites per branch, resultsTable generates separate bundle-size and tree-shakability comparison tables
  • Auto-generate per-export named and namespace test filesgenerateTests.ts enumerates exports from all four namespaces and writes paired test files into tests/named/ and tests/namespace/
  • Remove static/dynamic test split — test files are now a flat list; filtering is per-table (bundle-size vs tree-shakability) via score thresholds
  • Add graceful target-branch fallbackcontinue-on-error: true on the target-branch test step lets the comparison run even when the target branch lacks the new infra

ℹ️ Minor suggestion inline — looks well-structured overall.

ℹ️ allTests duplicates inflate summary statistics with multiple bundlers

When more than one bundler is used, each test file appears once per bundler in prNamespaceResults, so Object.values(prNamespaceResults).map(...) produces duplicate filenames. The summary stats loop iterates over these duplicates, double- (or triple-) counting every statistic. The old code used new Set(...) to deduplicate; the rewrite lost it.

In practice this only affects the workflow_dispatch CI run that adds --webpack, not the default single-bundler PR run.

Technical details
# `allTests` lacks deduplication

## Affected sites
- `apps/treeshake-test/compareResults.ts:45``Object.values(prNamespaceResults).map((r) => r.testFilename)` omits dedup

## Required outcome
- Deduplicate `allTests` so summary counts are per-test, not per-(test × bundler)
- Drop the `Object.values` call on an array (it happens to work but is misleading)

## Suggested approach
```ts
const allTests = [...new Set(prNamespaceResults.map((r) => r.testFilename))];
```

Pullfrog  | Fix it ➔View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

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.

1 participant