fix: improve runtime ternary support by refining side-effect detection#2615
fix: improve runtime ternary support by refining side-effect detection#2615pullfrog[bot] wants to merge 9 commits into
Conversation
- Mark function arguments as side-effect-free - Mark tgpu.const reads as side-effect-free - Propagate operand side-effects in pure binary operators - Add side-effect tracking to dualImpl (matching callableSchema) - Mark buffer reads (uniform/readonly/mutable) as side-effect-free - Add comprehensive ternary runtime tests from issue #2587 - Update existing ternary test for runtime select() generation
- Mark function arguments as side-effect-free - Mark tgpu.const reads as side-effect-free - Propagate operand side-effects in pure binary operators - Add side-effect tracking to dualImpl (matching callableSchema) - Mark buffer reads (uniform/readonly/mutable) as side-effect-free - Add comprehensive ternary runtime tests from issue #2587 - Update existing ternary test for runtime select() generation
|
pkg.pr.new packages benchmark commit |
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:
Dynamic test results:
|
| Test | tsdown |
|---|---|
| std from typegpu.ts | 105.22 kB ( |
| dot from typegpustd.ts | 66.95 kB ( |
| length from typegpustd.ts | 66.95 kB ( |
| distance from typegpustd.ts | 66.95 kB ( |
| dot4U8Packed from typegpustd.ts | 66.95 kB ( |
| fract from typegpustd.ts | 66.95 kB ( |
| frexp from typegpustd.ts | 66.95 kB ( |
| mix from typegpustd.ts | 66.95 kB ( |
| modf from typegpustd.ts | 66.95 kB ( |
| abs from typegpustd.ts | 66.96 kB ( |
| acos from typegpustd.ts | 66.96 kB ( |
| acosh from typegpustd.ts | 66.96 kB ( |
| asin from typegpustd.ts | 66.96 kB ( |
| asinh from typegpustd.ts | 66.96 kB ( |
| atan2 from typegpustd.ts | 66.96 kB ( |
| atan from typegpustd.ts | 66.96 kB ( |
| atanh from typegpustd.ts | 66.96 kB ( |
| ceil from typegpustd.ts | 66.96 kB ( |
| clamp from typegpustd.ts | 66.96 kB ( |
| cos from typegpustd.ts | 66.96 kB ( |
| cosh from typegpustd.ts | 66.96 kB ( |
| countLeadingZeros from typegpustd.ts | 66.96 kB ( |
| countOneBits from typegpustd.ts | 66.96 kB ( |
| countTrailingZeros from typegpustd.ts | 66.96 kB ( |
| cross from typegpustd.ts | 66.96 kB ( |
| degrees from typegpustd.ts | 66.96 kB ( |
| determinant from typegpustd.ts | 66.96 kB ( |
| dot4I8Packed from typegpustd.ts | 66.96 kB ( |
| exp2 from typegpustd.ts | 66.96 kB ( |
| exp from typegpustd.ts | 66.96 kB ( |
| extractBits from typegpustd.ts | 66.96 kB ( |
| faceForward from typegpustd.ts | 66.96 kB ( |
| firstLeadingBit from typegpustd.ts | 66.96 kB ( |
| firstTrailingBit from typegpustd.ts | 66.96 kB ( |
| floor from typegpustd.ts | 66.96 kB ( |
| fma from typegpustd.ts | 66.96 kB ( |
| insertBits from typegpustd.ts | 66.96 kB ( |
| inverseSqrt from typegpustd.ts | 66.96 kB ( |
| ldexp from typegpustd.ts | 66.96 kB ( |
| log2 from typegpustd.ts | 66.96 kB ( |
| log from typegpustd.ts | 66.96 kB ( |
| max from typegpustd.ts | 66.96 kB ( |
| min from typegpustd.ts | 66.96 kB ( |
| normalize from typegpustd.ts | 66.96 kB ( |
| pow from typegpustd.ts | 66.96 kB ( |
| quantizeToF16 from typegpustd.ts | 66.96 kB ( |
| radians from typegpustd.ts | 66.96 kB ( |
| reflect from typegpustd.ts | 66.96 kB ( |
| refract from typegpustd.ts | 66.96 kB ( |
| reverseBits from typegpustd.ts | 66.96 kB ( |
| round from typegpustd.ts | 66.96 kB ( |
| saturate from typegpustd.ts | 66.96 kB ( |
| sign from typegpustd.ts | 66.96 kB ( |
| sin from typegpustd.ts | 66.96 kB ( |
| sinh from typegpustd.ts | 66.96 kB ( |
| smoothstep from typegpustd.ts | 66.96 kB ( |
| sqrt from typegpustd.ts | 66.96 kB ( |
| step from typegpustd.ts | 66.96 kB ( |
| tan from typegpustd.ts | 66.96 kB ( |
| tanh from typegpustd.ts | 66.96 kB ( |
| transpose from typegpustd.ts | 66.96 kB ( |
| trunc from typegpustd.ts | 66.96 kB ( |
| subgroupAdd from typegpustd.ts | 24.34 kB ( |
| subgroupAll from typegpustd.ts | 24.35 kB ( |
| subgroupAnd from typegpustd.ts | 24.35 kB ( |
| subgroupAny from typegpustd.ts | 24.35 kB ( |
| subgroupBallot from typegpustd.ts | 24.35 kB ( |
| subgroupBroadcastFirst from typegpustd.ts | 24.35 kB ( |
| subgroupBroadcast from typegpustd.ts | 24.35 kB ( |
| subgroupElect from typegpustd.ts | 24.35 kB ( |
| subgroupExclusiveAdd from typegpustd.ts | 24.35 kB ( |
| subgroupExclusiveMul from typegpustd.ts | 24.35 kB ( |
| subgroupInclusiveAdd from typegpustd.ts | 24.35 kB ( |
| subgroupInclusiveMul from typegpustd.ts | 24.35 kB ( |
| subgroupMax from typegpustd.ts | 24.35 kB ( |
| subgroupMin from typegpustd.ts | 24.35 kB ( |
| subgroupMul from typegpustd.ts | 24.35 kB ( |
| subgroupOr from typegpustd.ts | 24.35 kB ( |
| subgroupShuffleDown from typegpustd.ts | 24.35 kB ( |
| subgroupShuffleUp from typegpustd.ts | 24.35 kB ( |
| subgroupShuffleXor from typegpustd.ts | 24.35 kB ( |
| subgroupShuffle from typegpustd.ts | 24.35 kB ( |
| subgroupXor from typegpustd.ts | 24.35 kB ( |
| atomicLoad from typegpustd.ts | 16.02 kB ( |
| atomicStore from typegpustd.ts | 16.02 kB ( |
| textureBarrier from typegpustd.ts | 16.02 kB ( |
| atomicAdd from typegpustd.ts | 16.03 kB ( |
| atomicAnd from typegpustd.ts | 16.03 kB ( |
| atomicMax from typegpustd.ts | 16.03 kB ( |
| atomicMin from typegpustd.ts | 16.03 kB ( |
| atomicOr from typegpustd.ts | 16.03 kB ( |
| atomicSub from typegpustd.ts | 16.03 kB ( |
| atomicXor from typegpustd.ts | 16.03 kB ( |
| storageBarrier from typegpustd.ts | 16.03 kB ( |
| workgroupBarrier from typegpustd.ts | 16.03 kB ( |
| WgslGenerator from typegpu.ts | 115.84 kB ( |
| dpdx from typegpustd.ts | 15.22 kB ( |
| dpdxCoarse from typegpustd.ts | 15.22 kB ( |
| dpdxFine from typegpustd.ts | 15.22 kB ( |
| dpdyCoarse from typegpustd.ts | 15.22 kB ( |
| dpdyFine from typegpustd.ts | 15.22 kB ( |
| dpdy from typegpustd.ts | 15.22 kB ( |
| fwidthCoarse from typegpustd.ts | 15.22 kB ( |
| fwidthFine from typegpustd.ts | 15.22 kB ( |
| fwidth from typegpustd.ts | 15.22 kB ( |
| and from typegpustd.ts | 52.19 kB ( |
| or from typegpustd.ts | 52.19 kB ( |
| allEq from typegpustd.ts | 52.19 kB ( |
| all from typegpustd.ts | 52.19 kB ( |
| eq from typegpustd.ts | 52.19 kB ( |
| lt from typegpustd.ts | 52.19 kB ( |
| ne from typegpustd.ts | 52.19 kB ( |
| not from typegpustd.ts | 52.19 kB ( |
| select from typegpustd.ts | 52.19 kB ( |
| any from typegpustd.ts | 52.20 kB ( |
| ge from typegpustd.ts | 52.20 kB ( |
| gt from typegpustd.ts | 52.20 kB ( |
| isCloseTo from typegpustd.ts | 52.20 kB ( |
| le from typegpustd.ts | 52.20 kB ( |
| textureDimensions from typegpustd.ts | 25.96 kB ( |
| textureGather from typegpustd.ts | 25.96 kB ( |
| textureLoad from typegpustd.ts | 25.96 kB ( |
| textureSampleBaseClampToEdge from typegpustd.ts | 25.96 kB ( |
| textureSampleBias from typegpustd.ts | 25.96 kB ( |
| textureSampleCompareLevel from typegpustd.ts | 25.96 kB ( |
| textureSampleCompare from typegpustd.ts | 25.96 kB ( |
| textureSampleGrad from typegpustd.ts | 25.96 kB ( |
| textureSampleLevel from typegpustd.ts | 25.96 kB ( |
| textureSample from typegpustd.ts | 25.96 kB ( |
| textureStore from typegpustd.ts | 25.96 kB ( |
| rotateX4 from typegpustd.ts | 49.44 kB ( |
| scale4 from typegpustd.ts | 49.44 kB ( |
| translate4 from typegpustd.ts | 49.44 kB ( |
| rotateY4 from typegpustd.ts | 49.45 kB ( |
| rotateZ4 from typegpustd.ts | 49.45 kB ( |
| tgpu from typegpu.ts | 262.50 kB ( |
| tgpu.fn from typegpu.ts | 262.50 kB ( |
| tgpu.init from typegpu.ts | 262.50 kB ( |
| tgpu.lazy from typegpu.ts | 262.50 kB ( |
| tgpu.slot from typegpu.ts | 262.50 kB ( |
| tgpu.const from typegpu.ts | 262.50 kB ( |
| tgpu.unroll from typegpu.ts | 262.51 kB ( |
| tgpu.resolve from typegpu.ts | 262.51 kB ( |
| tgpu.accessor from typegpu.ts | 262.51 kB ( |
| tgpu.comptime from typegpu.ts | 262.51 kB ( |
| tgpu.vertexFn from typegpu.ts | 262.51 kB ( |
| tgpu.computeFn from typegpu.ts | 262.51 kB ( |
| tgpu.fragmentFn from typegpu.ts | 262.51 kB ( |
| tgpu.privateVar from typegpu.ts | 262.51 kB ( |
| tgpu.vertexLayout from typegpu.ts | 262.51 kB ( |
| tgpu.workgroupVar from typegpu.ts | 262.51 kB ( |
| tgpu.initFromDevice from typegpu.ts | 262.51 kB ( |
| tgpu.bindGroupLayout from typegpu.ts | 262.51 kB ( |
| tgpu.mutableAccessor from typegpu.ts | 262.51 kB ( |
| tgpu.resolveWithContext from typegpu.ts | 262.52 kB ( |
| neg from typegpustd.ts | 48.60 kB ( |
| add from typegpustd.ts | 48.61 kB ( |
| bitShiftLeft from typegpustd.ts | 48.61 kB ( |
| bitShiftRight from typegpustd.ts | 48.61 kB ( |
| div from typegpustd.ts | 48.61 kB ( |
| mod from typegpustd.ts | 48.61 kB ( |
| mul from typegpustd.ts | 48.61 kB ( |
| sub from typegpustd.ts | 48.61 kB ( |
📋 All results
Click to reveal the results table (355 entries).
| Test | tsdown |
|---|---|
| std from typegpu.ts | 105.22 kB ( |
| stdImportEverything.ts | 108.06 kB ( |
| dot from typegpustd.ts | 66.95 kB ( |
| length from typegpustd.ts | 66.95 kB ( |
| distance from typegpustd.ts | 66.95 kB ( |
| dot4U8Packed from typegpustd.ts | 66.95 kB ( |
| fract from typegpustd.ts | 66.95 kB ( |
| frexp from typegpustd.ts | 66.95 kB ( |
| mix from typegpustd.ts | 66.95 kB ( |
| modf from typegpustd.ts | 66.95 kB ( |
| abs from typegpustd.ts | 66.96 kB ( |
| acos from typegpustd.ts | 66.96 kB ( |
| acosh from typegpustd.ts | 66.96 kB ( |
| asin from typegpustd.ts | 66.96 kB ( |
| asinh from typegpustd.ts | 66.96 kB ( |
| atan2 from typegpustd.ts | 66.96 kB ( |
| atan from typegpustd.ts | 66.96 kB ( |
| atanh from typegpustd.ts | 66.96 kB ( |
| ceil from typegpustd.ts | 66.96 kB ( |
| clamp from typegpustd.ts | 66.96 kB ( |
| cos from typegpustd.ts | 66.96 kB ( |
| cosh from typegpustd.ts | 66.96 kB ( |
| countLeadingZeros from typegpustd.ts | 66.96 kB ( |
| countOneBits from typegpustd.ts | 66.96 kB ( |
| countTrailingZeros from typegpustd.ts | 66.96 kB ( |
| cross from typegpustd.ts | 66.96 kB ( |
| degrees from typegpustd.ts | 66.96 kB ( |
| determinant from typegpustd.ts | 66.96 kB ( |
| dot4I8Packed from typegpustd.ts | 66.96 kB ( |
| exp2 from typegpustd.ts | 66.96 kB ( |
| exp from typegpustd.ts | 66.96 kB ( |
| extractBits from typegpustd.ts | 66.96 kB ( |
| faceForward from typegpustd.ts | 66.96 kB ( |
| firstLeadingBit from typegpustd.ts | 66.96 kB ( |
| firstTrailingBit from typegpustd.ts | 66.96 kB ( |
| floor from typegpustd.ts | 66.96 kB ( |
| fma from typegpustd.ts | 66.96 kB ( |
| insertBits from typegpustd.ts | 66.96 kB ( |
| inverseSqrt from typegpustd.ts | 66.96 kB ( |
| ldexp from typegpustd.ts | 66.96 kB ( |
| log2 from typegpustd.ts | 66.96 kB ( |
| log from typegpustd.ts | 66.96 kB ( |
| max from typegpustd.ts | 66.96 kB ( |
| min from typegpustd.ts | 66.96 kB ( |
| normalize from typegpustd.ts | 66.96 kB ( |
| pow from typegpustd.ts | 66.96 kB ( |
| quantizeToF16 from typegpustd.ts | 66.96 kB ( |
| radians from typegpustd.ts | 66.96 kB ( |
| reflect from typegpustd.ts | 66.96 kB ( |
| refract from typegpustd.ts | 66.96 kB ( |
| reverseBits from typegpustd.ts | 66.96 kB ( |
| round from typegpustd.ts | 66.96 kB ( |
| saturate from typegpustd.ts | 66.96 kB ( |
| sign from typegpustd.ts | 66.96 kB ( |
| sin from typegpustd.ts | 66.96 kB ( |
| sinh from typegpustd.ts | 66.96 kB ( |
| smoothstep from typegpustd.ts | 66.96 kB ( |
| sqrt from typegpustd.ts | 66.96 kB ( |
| step from typegpustd.ts | 66.96 kB ( |
| tan from typegpustd.ts | 66.96 kB ( |
| tanh from typegpustd.ts | 66.96 kB ( |
| transpose from typegpustd.ts | 66.96 kB ( |
| trunc from typegpustd.ts | 66.96 kB ( |
| subgroupAdd from typegpustd.ts | 24.34 kB ( |
| subgroupAll from typegpustd.ts | 24.35 kB ( |
| subgroupAnd from typegpustd.ts | 24.35 kB ( |
| subgroupAny from typegpustd.ts | 24.35 kB ( |
| subgroupBallot from typegpustd.ts | 24.35 kB ( |
| subgroupBroadcastFirst from typegpustd.ts | 24.35 kB ( |
| subgroupBroadcast from typegpustd.ts | 24.35 kB ( |
| subgroupElect from typegpustd.ts | 24.35 kB ( |
| subgroupExclusiveAdd from typegpustd.ts | 24.35 kB ( |
| subgroupExclusiveMul from typegpustd.ts | 24.35 kB ( |
| subgroupInclusiveAdd from typegpustd.ts | 24.35 kB ( |
| subgroupInclusiveMul from typegpustd.ts | 24.35 kB ( |
| subgroupMax from typegpustd.ts | 24.35 kB ( |
| subgroupMin from typegpustd.ts | 24.35 kB ( |
| subgroupMul from typegpustd.ts | 24.35 kB ( |
| subgroupOr from typegpustd.ts | 24.35 kB ( |
| subgroupShuffleDown from typegpustd.ts | 24.35 kB ( |
| subgroupShuffleUp from typegpustd.ts | 24.35 kB ( |
| subgroupShuffleXor from typegpustd.ts | 24.35 kB ( |
| subgroupShuffle from typegpustd.ts | 24.35 kB ( |
| subgroupXor from typegpustd.ts | 24.35 kB ( |
| atomicLoad from typegpustd.ts | 16.02 kB ( |
| atomicStore from typegpustd.ts | 16.02 kB ( |
| textureBarrier from typegpustd.ts | 16.02 kB ( |
| atomicAdd from typegpustd.ts | 16.03 kB ( |
| atomicAnd from typegpustd.ts | 16.03 kB ( |
| atomicMax from typegpustd.ts | 16.03 kB ( |
| atomicMin from typegpustd.ts | 16.03 kB ( |
| atomicOr from typegpustd.ts | 16.03 kB ( |
| atomicSub from typegpustd.ts | 16.03 kB ( |
| atomicXor from typegpustd.ts | 16.03 kB ( |
| storageBarrier from typegpustd.ts | 16.03 kB ( |
| workgroupBarrier from typegpustd.ts | 16.03 kB ( |
| WgslGenerator from typegpu.ts | 115.84 kB ( |
| dpdx from typegpustd.ts | 15.22 kB ( |
| dpdxCoarse from typegpustd.ts | 15.22 kB ( |
| dpdxFine from typegpustd.ts | 15.22 kB ( |
| dpdyCoarse from typegpustd.ts | 15.22 kB ( |
| dpdyFine from typegpustd.ts | 15.22 kB ( |
| dpdy from typegpustd.ts | 15.22 kB ( |
| fwidthCoarse from typegpustd.ts | 15.22 kB ( |
| fwidthFine from typegpustd.ts | 15.22 kB ( |
| fwidth from typegpustd.ts | 15.22 kB ( |
| and from typegpustd.ts | 52.19 kB ( |
| or from typegpustd.ts | 52.19 kB ( |
| allEq from typegpustd.ts | 52.19 kB ( |
| all from typegpustd.ts | 52.19 kB ( |
| eq from typegpustd.ts | 52.19 kB ( |
| lt from typegpustd.ts | 52.19 kB ( |
| ne from typegpustd.ts | 52.19 kB ( |
| not from typegpustd.ts | 52.19 kB ( |
| select from typegpustd.ts | 52.19 kB ( |
| any from typegpustd.ts | 52.20 kB ( |
| ge from typegpustd.ts | 52.20 kB ( |
| gt from typegpustd.ts | 52.20 kB ( |
| isCloseTo from typegpustd.ts | 52.20 kB ( |
| le from typegpustd.ts | 52.20 kB ( |
| importEntireLibrary.ts | 291.24 kB ( |
| textureDimensions from typegpustd.ts | 25.96 kB ( |
| textureGather from typegpustd.ts | 25.96 kB ( |
| textureLoad from typegpustd.ts | 25.96 kB ( |
| textureSampleBaseClampToEdge from typegpustd.ts | 25.96 kB ( |
| textureSampleBias from typegpustd.ts | 25.96 kB ( |
| textureSampleCompareLevel from typegpustd.ts | 25.96 kB ( |
| textureSampleCompare from typegpustd.ts | 25.96 kB ( |
| textureSampleGrad from typegpustd.ts | 25.96 kB ( |
| textureSampleLevel from typegpustd.ts | 25.96 kB ( |
| textureSample from typegpustd.ts | 25.96 kB ( |
| textureStore from typegpustd.ts | 25.96 kB ( |
| rotateX4 from typegpustd.ts | 49.44 kB ( |
| scale4 from typegpustd.ts | 49.44 kB ( |
| translate4 from typegpustd.ts | 49.44 kB ( |
| rotateY4 from typegpustd.ts | 49.45 kB ( |
| rotateZ4 from typegpustd.ts | 49.45 kB ( |
| tgpuImportEverything.ts | 262.50 kB ( |
| tgpu from typegpu.ts | 262.50 kB ( |
| tgpu.fn from typegpu.ts | 262.50 kB ( |
| tgpu.init from typegpu.ts | 262.50 kB ( |
| tgpu.lazy from typegpu.ts | 262.50 kB ( |
| tgpu.slot from typegpu.ts | 262.50 kB ( |
| tgpu.const from typegpu.ts | 262.50 kB ( |
| tgpu.unroll from typegpu.ts | 262.51 kB ( |
| tgpu.resolve from typegpu.ts | 262.51 kB ( |
| tgpu.accessor from typegpu.ts | 262.51 kB ( |
| tgpu.comptime from typegpu.ts | 262.51 kB ( |
| tgpu.vertexFn from typegpu.ts | 262.51 kB ( |
| tgpu.computeFn from typegpu.ts | 262.51 kB ( |
| tgpu.fragmentFn from typegpu.ts | 262.51 kB ( |
| tgpu.privateVar from typegpu.ts | 262.51 kB ( |
| tgpuImportOne.ts | 262.51 kB ( |
| tgpu.vertexLayout from typegpu.ts | 262.51 kB ( |
| tgpu.workgroupVar from typegpu.ts | 262.51 kB ( |
| tgpu.initFromDevice from typegpu.ts | 262.51 kB ( |
| tgpu.bindGroupLayout from typegpu.ts | 262.51 kB ( |
| tgpu.mutableAccessor from typegpu.ts | 262.51 kB ( |
| tgpu.resolveWithContext from typegpu.ts | 262.52 kB ( |
| neg from typegpustd.ts | 48.60 kB ( |
| add from typegpustd.ts | 48.61 kB ( |
| bitShiftLeft from typegpustd.ts | 48.61 kB ( |
| bitShiftRight from typegpustd.ts | 48.61 kB ( |
| div from typegpustd.ts | 48.61 kB ( |
| mod from typegpustd.ts | 48.61 kB ( |
| mul from typegpustd.ts | 48.61 kB ( |
| sub from typegpustd.ts | 48.61 kB ( |
| stdImportOneDirect.ts | 48.62 kB ( |
| stdImportOneStar.ts | 48.62 kB ( |
| discard from typegpustd.ts | 14.26 kB ( |
| copy from typegpustd.ts | 14.50 kB ( |
| arrayLength from typegpustd.ts | 14.50 kB ( |
| mat4x4f from typegpudata.ts | 27.12 kB ( |
| identity2 from typegpustd.ts | 27.12 kB ( |
| identity3 from typegpustd.ts | 27.12 kB ( |
| identity4 from typegpustd.ts | 27.12 kB ( |
| mat2x2f from typegpudata.ts | 27.12 kB ( |
| mat3x3f from typegpudata.ts | 27.12 kB ( |
| rotationX4 from typegpustd.ts | 27.12 kB ( |
| rotationY4 from typegpustd.ts | 27.12 kB ( |
| rotationZ4 from typegpustd.ts | 27.12 kB ( |
| scaling4 from typegpustd.ts | 27.12 kB ( |
| translation4 from typegpustd.ts | 27.12 kB ( |
| matToArray from typegpudata.ts | 27.25 kB ( |
| isUsableAsUniform from typegpu.ts | 63.17 kB ( |
| isTexture from typegpu.ts | 63.18 kB ( |
| isSampler from typegpu.ts | 63.19 kB ( |
| isComparisonSampler from typegpu.ts | 63.20 kB ( |
| isVariable from typegpu.ts | 64.90 kB ( |
| bitcastU32toF32 from typegpustd.ts | 44.35 kB ( |
| bitcastU32toI32 from typegpustd.ts | 44.35 kB ( |
| pack2x16float from typegpustd.ts | 36.06 kB ( |
| pack4x8unorm from typegpustd.ts | 36.06 kB ( |
| unpack2x16float from typegpustd.ts | 36.06 kB ( |
| unpack4x8unorm from typegpustd.ts | 36.06 kB ( |
| d from typegpu.ts | 87.41 kB ( |
| isUsableAsVertex from typegpu.ts | 88.75 kB ( |
| isBuffer from typegpu.ts | 88.76 kB ( |
| dataImportEverything.ts | 89.73 kB ( |
| readFromArrayBuffer from typegpu.ts | 51.82 kB ( |
| dataImportOneDirect.ts | 24.62 kB (➖) |
| dataImportOneStar.ts | 24.62 kB (➖) |
| 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.33 kB (➖) |
| ShaderGenerator from typegpu.ts | 1.66 kB (➖) |
| Void from typegpudata.ts | 734 B (➖) |
| align from typegpudata.ts | 26.31 kB (➖) |
| alignmentOf from typegpudata.ts | 21.85 kB (➖) |
| arrayOf from typegpudata.ts | 26.17 kB (➖) |
| atomic from typegpudata.ts | 779 B (➖) |
| bool from typegpudata.ts | 12.97 kB (➖) |
| builtin from typegpudata.ts | 28.63 kB (➖) |
| common from typegpu.ts | 58.44 kB (➖) |
| comparisonSampler from typegpudata.ts | 753 B (➖) |
| deepEqual from typegpudata.ts | 2.19 kB (➖) |
| disarrayOf from typegpudata.ts | 15.02 kB (➖) |
| extensionEnabled from typegpustd.ts | 14.58 kB (➖) |
| f16 from typegpudata.ts | 12.97 kB (➖) |
| f32 from typegpudata.ts | 12.97 kB (➖) |
| float16 from typegpudata.ts | 20.91 kB (➖) |
| float16x2 from typegpudata.ts | 20.91 kB (➖) |
| float16x4 from typegpudata.ts | 20.91 kB (➖) |
| float32 from typegpudata.ts | 20.91 kB (➖) |
| float32x2 from typegpudata.ts | 20.91 kB (➖) |
| float32x3 from typegpudata.ts | 20.91 kB (➖) |
| float32x4 from typegpudata.ts | 20.91 kB (➖) |
| formatToWGSLType from typegpudata.ts | 20.90 kB (➖) |
| getLongestContiguousPrefix from typegpudata.ts | 24.64 kB (➖) |
| getTargetShaderLanguage from typegpustd.ts | 14.53 kB (➖) |
| i32 from typegpudata.ts | 12.97 kB (➖) |
| interpolate from typegpudata.ts | 26.32 kB (➖) |
| invariant from typegpudata.ts | 26.69 kB (➖) |
| isAccessor from typegpu.ts | 65 B (➖) |
| isAlignAttrib from typegpudata.ts | 755 B (➖) |
| isAtomic from typegpudata.ts | 755 B (➖) |
| isBeingTranspiled from typegpustd.ts | 14.47 kB (➖) |
| isBufferShorthand from typegpu.ts | 1.71 kB (➖) |
| isBuiltinAttrib from typegpudata.ts | 757 B (➖) |
| isBuiltin from typegpudata.ts | 24.57 kB (➖) |
| isContiguous from typegpudata.ts | 24.63 kB (➖) |
| 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 (➖) |
| isPackedData from typegpudata.ts | 20.97 kB (➖) |
| 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 (➖) |
| location from typegpudata.ts | 26.31 kB (➖) |
| memoryLayoutOf from typegpudata.ts | 41.95 kB (➖) |
| packedFormats from typegpudata.ts | 20.92 kB (➖) |
| patchArrayBuffer from typegpu.ts | 51.09 kB (➖) |
| 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 (➖) |
| range from typegpustd.ts | 14.85 kB (➖) |
| ref from typegpudata.ts | 4.79 kB (➖) |
| sampler from typegpudata.ts | 742 B (➖) |
| sint16 from typegpudata.ts | 20.91 kB (➖) |
| sint16x2 from typegpudata.ts | 20.91 kB (➖) |
| sint16x4 from typegpudata.ts | 20.91 kB (➖) |
| sint32 from typegpudata.ts | 20.91 kB (➖) |
| sint32x2 from typegpudata.ts | 20.91 kB (➖) |
| sint32x3 from typegpudata.ts | 20.91 kB (➖) |
| sint32x4 from typegpudata.ts | 20.91 kB (➖) |
| sint8 from typegpudata.ts | 20.91 kB (➖) |
| sint8x2 from typegpudata.ts | 20.91 kB (➖) |
| sint8x4 from typegpudata.ts | 20.91 kB (➖) |
| sizeOf from typegpudata.ts | 24.62 kB (➖) |
| size from typegpudata.ts | 26.31 kB (➖) |
| snorm16 from typegpudata.ts | 20.91 kB (➖) |
| snorm16x2 from typegpudata.ts | 20.91 kB (➖) |
| snorm16x4 from typegpudata.ts | 20.91 kB (➖) |
| snorm8 from typegpudata.ts | 20.91 kB (➖) |
| snorm8x2 from typegpudata.ts | 20.91 kB (➖) |
| snorm8x4 from typegpudata.ts | 20.91 kB (➖) |
| struct from typegpudata.ts | 3.42 kB (➖) |
| texture1d from typegpudata.ts | 13.43 kB (➖) |
| texture2dArray from typegpudata.ts | 13.45 kB (➖) |
| texture2d from typegpudata.ts | 13.43 kB (➖) |
| texture3d from typegpudata.ts | 13.43 kB (➖) |
| textureCubeArray from typegpudata.ts | 13.45 kB (➖) |
| textureCube from typegpudata.ts | 13.43 kB (➖) |
| textureDepth2dArray from typegpudata.ts | 13.44 kB (➖) |
| textureDepth2d from typegpudata.ts | 13.42 kB (➖) |
| textureDepthCubeArray from typegpudata.ts | 13.44 kB (➖) |
| textureDepthCube from typegpudata.ts | 13.42 kB (➖) |
| textureDepthMultisampled2d from typegpudata.ts | 13.44 kB (➖) |
| textureExternal from typegpudata.ts | 873 B (➖) |
| textureMultisampled2d from typegpudata.ts | 13.45 kB (➖) |
| 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 (➖) |
| u16 from typegpudata.ts | 13.00 kB (➖) |
| u32 from typegpudata.ts | 12.97 kB (➖) |
| uint16 from typegpudata.ts | 20.91 kB (➖) |
| uint16x2 from typegpudata.ts | 20.91 kB (➖) |
| uint16x4 from typegpudata.ts | 20.91 kB (➖) |
| uint32 from typegpudata.ts | 20.91 kB (➖) |
| uint32x2 from typegpudata.ts | 20.91 kB (➖) |
| uint32x3 from typegpudata.ts | 20.91 kB (➖) |
| uint32x4 from typegpudata.ts | 20.91 kB (➖) |
| uint8 from typegpudata.ts | 20.90 kB (➖) |
| uint8x2 from typegpudata.ts | 20.91 kB (➖) |
| uint8x4 from typegpudata.ts | 20.91 kB (➖) |
| unorm10 10 10 2 from typegpudata.ts | 20.91 kB (➖) |
| unorm16 from typegpudata.ts | 20.91 kB (➖) |
| unorm16x2 from typegpudata.ts | 20.91 kB (➖) |
| unorm16x4 from typegpudata.ts | 20.91 kB (➖) |
| unorm8 from typegpudata.ts | 20.91 kB (➖) |
| unorm8x2 from typegpudata.ts | 20.91 kB (➖) |
| unorm8x4 bgra from typegpudata.ts | 20.91 kB (➖) |
| unorm8x4 from typegpudata.ts | 20.91 kB (➖) |
| unstruct from typegpudata.ts | 1.55 kB (➖) |
| vec2b from typegpudata.ts | 19.41 kB (➖) |
| vec2f from typegpudata.ts | 19.41 kB (➖) |
| vec2h from typegpudata.ts | 19.41 kB (➖) |
| vec2i from typegpudata.ts | 19.41 kB (➖) |
| vec2u from typegpudata.ts | 19.41 kB (➖) |
| vec3b from typegpudata.ts | 19.41 kB (➖) |
| vec3f from typegpudata.ts | 19.41 kB (➖) |
| vec3h from typegpudata.ts | 19.41 kB (➖) |
| vec3i from typegpudata.ts | 19.41 kB (➖) |
| vec3u from typegpudata.ts | 19.41 kB (➖) |
| vec4b from typegpudata.ts | 19.41 kB (➖) |
| vec4f from typegpudata.ts | 19.41 kB (➖) |
| vec4h from typegpudata.ts | 19.41 kB (➖) |
| vec4i from typegpudata.ts | 19.41 kB (➖) |
| vec4u from typegpudata.ts | 19.41 kB (➖) |
| writeToArrayBuffer from typegpu.ts | 50.89 kB (➖) |
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
|
CI failure was caused by formatting issues in Task list (7/7 completed)
|
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.88, 1.86, 4.34, 6.79, 7.57, 10.88, 23.47, 25.43]
line [1.00, 1.85, 4.09, 6.86, 8.44, 10.26, 21.93, 27.11]
line [0.97, 1.99, 4.76, 7.20, 8.33, 10.94, 23.27, 25.11]
---
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.55, 0.70, 0.84, 1.18, 1.28, 1.56, 1.82]
line [0.30, 0.55, 0.69, 0.85, 1.18, 1.23, 1.52, 1.67]
line [0.30, 0.56, 0.75, 0.89, 1.26, 1.31, 1.59, 1.66]
---
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.94, 2.08, 4.51, 6.54, 12.68, 26.50, 57.52, 117.06]
line [0.89, 2.36, 3.97, 6.36, 12.54, 27.69, 57.07, 117.81]
line [1.06, 2.25, 4.43, 6.86, 13.78, 28.48, 57.96, 121.18]
|
iwoplaza
left a comment
There was a problem hiding this comment.
I don't think all dualImpls are side-effect free. Take for example a textureStore function, or atomicStore. I think there should be a "sideEffects" prop that is required whenever a dualImpl is defined. If true, then the result always has possible side effects. If false, then the result has side effects if any of the arguments have side effects.
|
Addressed the reviewer's feedback: added a Task list (5/6 completed)
|
|
Addressed the review feedback:
All 2018 tests pass, typecheck is clean.
|
iwoplaza
left a comment
There was a problem hiding this comment.
I'd prefer if the sideEffects prop of DualImplOptions was required, so that it will be harder to miss and reason about on a case-by-case basis, even if it produces a lot of code changes.
|
Made Task list (5/5 completed)
|
|
Addressed both review findings:
All 2017 tests pass, typecheck passes. Both threads resolved. Task list (5/5 completed)
|
… discard sideEffects
|
Addressed both review comments: changed Task list (8/8 completed)
|

Summary
Fixes runtime ternary operator support by correcting side-effect detection across multiple code paths. Addresses all failing cases from #2587.
Changes
Bug fixes (source)
resolutionCtx.ts: Function arguments (snip(name, type, origin)) now correctly setpossibleSideEffects: false— reading a function parameter is always side-effect-freetgpuConstant.ts:tgpu.const().$proxy snippet now correctly setpossibleSideEffects: false— reading a compile-time constant is side-effect-freewgslGenerator.ts: Pure binary operators (comparisons, bit shifts, bitwise, modulo) now propagate operand side-effects instead of always defaulting totruedualImpl.ts: Added missing side-effect tracking —dualImplcallable functions now returnnoSideEffects(result)when all arguments are side-effect-free, matching the behavior already present incallableSchemabufferUsage.ts: Buffer read accesses (uniform,readonly,mutable) now correctly setpossibleSideEffects: falseTests
ternaryRuntime.test.ts(new): 8 tests covering all failing cases from the issue, including:tgpu.constarray indexing in branchesternaryOperator.test.ts: Updated the "should throw" test to "should generateselect()" sincen > 0 ? n : -nnow correctly produces aselect()callVerification
tsc --noEmit)Closes #2587
DeepSeek Pro(free via Pullfrog for OSS) | 𝕏