impr: Depreacte the partialWrite API and add patch API that better matches the write features#2355
impr: Depreacte the partialWrite API and add patch API that better matches the write features#2355
partialWrite API and add patch API that better matches the write features#2355Conversation
|
pkg.pr.new packages benchmark commit |
0f7e47b to
1ca7e21
Compare
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:
|
| Test | tsdown |
|---|---|
| Void from typegpudata.ts | 734 B ( |
| sampler from typegpudata.ts | 742 B ( |
| isPtr from typegpudata.ts | 752 B ( |
| comparisonSampler from typegpudata.ts | 753 B ( |
| isSizeAttrib from typegpudata.ts | 754 B ( |
| isWgslArray from typegpudata.ts | 754 B ( |
| isAlignAttrib from typegpudata.ts | 755 B ( |
| isAtomic from typegpudata.ts | 755 B ( |
| isWgslStruct from typegpudata.ts | 755 B ( |
| isBuiltinAttrib from typegpudata.ts | 757 B ( |
| isDecorated from typegpudata.ts | 758 B ( |
| isLocationAttrib from typegpudata.ts | 758 B ( |
| isInterpolateAttrib from typegpudata.ts | 761 B ( |
| isTgpuFn from typegpu.ts | 765 B ( |
| atomic from typegpudata.ts | 779 B ( |
| ptrHandle from typegpudata.ts | 851 B ( |
| ptrUniform from typegpudata.ts | 852 B ( |
| ptrStorage from typegpudata.ts | 856 B ( |
| ptrPrivate from typegpudata.ts | 858 B ( |
| ptrFn from typegpudata.ts | 859 B ( |
| ptrWorkgroup from typegpudata.ts | 860 B ( |
| textureExternal from typegpudata.ts | 873 B ( |
| isBufferShorthand from typegpu.ts | 1.81 kB ( |
| textureStorage1d from typegpudata.ts | 1.01 kB ( |
| textureStorage2d from typegpudata.ts | 1.01 kB ( |
| textureStorage3d from typegpudata.ts | 1.01 kB ( |
| textureStorage2dArray from typegpudata.ts | 1.03 kB ( |
| NotUniformError from typegpu.ts | 1.30 kB ( |
| isWgslData from typegpudata.ts | 1.31 kB ( |
| MissingBindGroupsError from typegpu.ts | 1.34 kB ( |
| MissingVertexBuffersError from typegpu.ts | 1.35 kB ( |
| ResolutionError from typegpu.ts | 1.55 kB ( |
| unstruct from typegpudata.ts | 1.65 kB ( |
| isDisarray from typegpudata.ts | 1.69 kB ( |
| isUnstruct from typegpudata.ts | 1.69 kB ( |
| isLooseDecorated from typegpudata.ts | 1.70 kB ( |
| isLooseData from typegpudata.ts | 1.74 kB ( |
| ShaderGenerator from typegpu.ts | 1.84 kB ( |
| isData from typegpudata.ts | 2.39 kB ( |
| deepEqual from typegpudata.ts | 2.77 kB ( |
| struct from typegpudata.ts | 3.37 kB ( |
| ref from typegpudata.ts | 4.18 kB ( |
📋 All results
Click to reveal the results table (349 entries).
| Test | tsdown |
|---|---|
| Void from typegpudata.ts | 734 B ( |
| sampler from typegpudata.ts | 742 B ( |
| isPtr from typegpudata.ts | 752 B ( |
| comparisonSampler from typegpudata.ts | 753 B ( |
| isSizeAttrib from typegpudata.ts | 754 B ( |
| isWgslArray from typegpudata.ts | 754 B ( |
| isAlignAttrib from typegpudata.ts | 755 B ( |
| isAtomic from typegpudata.ts | 755 B ( |
| isWgslStruct from typegpudata.ts | 755 B ( |
| isBuiltinAttrib from typegpudata.ts | 757 B ( |
| isDecorated from typegpudata.ts | 758 B ( |
| isLocationAttrib from typegpudata.ts | 758 B ( |
| isInterpolateAttrib from typegpudata.ts | 761 B ( |
| isTgpuFn from typegpu.ts | 765 B ( |
| atomic from typegpudata.ts | 779 B ( |
| ptrHandle from typegpudata.ts | 851 B ( |
| ptrUniform from typegpudata.ts | 852 B ( |
| ptrStorage from typegpudata.ts | 856 B ( |
| ptrPrivate from typegpudata.ts | 858 B ( |
| ptrFn from typegpudata.ts | 859 B ( |
| ptrWorkgroup from typegpudata.ts | 860 B ( |
| textureExternal from typegpudata.ts | 873 B ( |
| isBufferShorthand from typegpu.ts | 1.81 kB ( |
| textureStorage1d from typegpudata.ts | 1.01 kB ( |
| textureStorage2d from typegpudata.ts | 1.01 kB ( |
| textureStorage3d from typegpudata.ts | 1.01 kB ( |
| textureStorage2dArray from typegpudata.ts | 1.03 kB ( |
| NotUniformError from typegpu.ts | 1.30 kB ( |
| isWgslData from typegpudata.ts | 1.31 kB ( |
| MissingBindGroupsError from typegpu.ts | 1.34 kB ( |
| MissingVertexBuffersError from typegpu.ts | 1.35 kB ( |
| ResolutionError from typegpu.ts | 1.55 kB ( |
| unstruct from typegpudata.ts | 1.65 kB ( |
| isDisarray from typegpudata.ts | 1.69 kB ( |
| isUnstruct from typegpudata.ts | 1.69 kB ( |
| isLooseDecorated from typegpudata.ts | 1.70 kB ( |
| isLooseData from typegpudata.ts | 1.74 kB ( |
| ShaderGenerator from typegpu.ts | 1.84 kB ( |
| isData from typegpudata.ts | 2.39 kB ( |
| deepEqual from typegpudata.ts | 2.77 kB ( |
| struct from typegpudata.ts | 3.37 kB ( |
| ref from typegpudata.ts | 4.18 kB ( |
| isUsableAsVertex from typegpu.ts | 85.83 kB ( |
| isBuffer from typegpu.ts | 85.84 kB ( |
| bool from typegpudata.ts | 10.63 kB ( |
| f16 from typegpudata.ts | 10.63 kB ( |
| f32 from typegpudata.ts | 10.63 kB ( |
| i32 from typegpudata.ts | 10.63 kB ( |
| u32 from typegpudata.ts | 10.63 kB ( |
| u16 from typegpudata.ts | 10.65 kB ( |
| textureDepth2d from typegpudata.ts | 11.07 kB ( |
| textureDepthCube from typegpudata.ts | 11.08 kB ( |
| texture1d from typegpudata.ts | 11.08 kB ( |
| texture2d from typegpudata.ts | 11.08 kB ( |
| texture3d from typegpudata.ts | 11.08 kB ( |
| textureCube from typegpudata.ts | 11.09 kB ( |
| textureDepth2dArray from typegpudata.ts | 11.09 kB ( |
| textureDepthCubeArray from typegpudata.ts | 11.09 kB ( |
| textureDepthMultisampled2d from typegpudata.ts | 11.09 kB ( |
| texture2dArray from typegpudata.ts | 11.10 kB ( |
| textureCubeArray from typegpudata.ts | 11.10 kB ( |
| textureMultisampled2d from typegpudata.ts | 11.11 kB ( |
| discard from typegpustd.ts | 11.83 kB ( |
| arrayLength from typegpustd.ts | 12.06 kB ( |
| extensionEnabled from typegpustd.ts | 12.14 kB ( |
| range from typegpustd.ts | 12.41 kB ( |
| disarrayOf from typegpudata.ts | 12.58 kB ( |
| dpdx from typegpustd.ts | 12.67 kB ( |
| dpdxCoarse from typegpustd.ts | 12.68 kB ( |
| dpdxFine from typegpustd.ts | 12.68 kB ( |
| dpdyCoarse from typegpustd.ts | 12.68 kB ( |
| dpdyFine from typegpustd.ts | 12.68 kB ( |
| dpdy from typegpustd.ts | 12.68 kB ( |
| fwidthCoarse from typegpustd.ts | 12.68 kB ( |
| fwidthFine from typegpustd.ts | 12.68 kB ( |
| fwidth from typegpustd.ts | 12.68 kB ( |
| atomicLoad from typegpustd.ts | 13.43 kB ( |
| atomicStore from typegpustd.ts | 13.44 kB ( |
| textureBarrier from typegpustd.ts | 13.44 kB ( |
| atomicAdd from typegpustd.ts | 13.44 kB ( |
| atomicAnd from typegpustd.ts | 13.44 kB ( |
| atomicMax from typegpustd.ts | 13.44 kB ( |
| atomicMin from typegpustd.ts | 13.44 kB ( |
| atomicOr from typegpustd.ts | 13.44 kB ( |
| atomicSub from typegpustd.ts | 13.44 kB ( |
| atomicXor from typegpustd.ts | 13.44 kB ( |
| storageBarrier from typegpustd.ts | 13.44 kB ( |
| workgroupBarrier from typegpustd.ts | 13.44 kB ( |
| tgpuImportEverything.ts | 250.85 kB ( |
| tgpu from typegpu.ts | 250.85 kB ( |
| tgpu.fn from typegpu.ts | 250.85 kB ( |
| tgpu.init from typegpu.ts | 250.85 kB ( |
| tgpu.lazy from typegpu.ts | 250.85 kB ( |
| tgpu.slot from typegpu.ts | 250.85 kB ( |
| tgpu.const from typegpu.ts | 250.85 kB ( |
| tgpu.unroll from typegpu.ts | 250.86 kB ( |
| tgpu.resolve from typegpu.ts | 250.86 kB ( |
| tgpu.accessor from typegpu.ts | 250.86 kB ( |
| tgpu.comptime from typegpu.ts | 250.86 kB ( |
| tgpu.vertexFn from typegpu.ts | 250.86 kB ( |
| tgpu.computeFn from typegpu.ts | 250.86 kB ( |
| tgpu.fragmentFn from typegpu.ts | 250.86 kB ( |
| tgpu.privateVar from typegpu.ts | 250.86 kB ( |
| tgpuImportOne.ts | 250.86 kB ( |
| tgpu.vertexLayout from typegpu.ts | 250.86 kB ( |
| tgpu.workgroupVar from typegpu.ts | 250.86 kB ( |
| tgpu.initFromDevice from typegpu.ts | 250.86 kB ( |
| tgpu.bindGroupLayout from typegpu.ts | 250.86 kB ( |
| tgpu.mutableAccessor from typegpu.ts | 250.86 kB ( |
| tgpu.resolveWithContext from typegpu.ts | 250.87 kB ( |
| importEntireLibrary.ts | 277.76 kB ( |
| vec2b from typegpudata.ts | 17.01 kB ( |
| vec2f from typegpudata.ts | 17.01 kB ( |
| vec2h from typegpudata.ts | 17.01 kB ( |
| vec2i from typegpudata.ts | 17.01 kB ( |
| vec2u from typegpudata.ts | 17.01 kB ( |
| vec3b from typegpudata.ts | 17.01 kB ( |
| vec3f from typegpudata.ts | 17.01 kB ( |
| vec3h from typegpudata.ts | 17.01 kB ( |
| vec3i from typegpudata.ts | 17.01 kB ( |
| vec3u from typegpudata.ts | 17.01 kB ( |
| vec4b from typegpudata.ts | 17.01 kB ( |
| vec4f from typegpudata.ts | 17.01 kB ( |
| vec4h from typegpudata.ts | 17.01 kB ( |
| vec4i from typegpudata.ts | 17.01 kB ( |
| vec4u from typegpudata.ts | 17.01 kB ( |
| formatToWGSLType from typegpudata.ts | 18.50 kB ( |
| uint8 from typegpudata.ts | 18.50 kB ( |
| float16 from typegpudata.ts | 18.51 kB ( |
| float16x2 from typegpudata.ts | 18.51 kB ( |
| float16x4 from typegpudata.ts | 18.51 kB ( |
| float32 from typegpudata.ts | 18.51 kB ( |
| float32x2 from typegpudata.ts | 18.51 kB ( |
| float32x3 from typegpudata.ts | 18.51 kB ( |
| float32x4 from typegpudata.ts | 18.51 kB ( |
| sint16 from typegpudata.ts | 18.51 kB ( |
| sint16x2 from typegpudata.ts | 18.51 kB ( |
| sint16x4 from typegpudata.ts | 18.51 kB ( |
| sint32 from typegpudata.ts | 18.51 kB ( |
| sint32x2 from typegpudata.ts | 18.51 kB ( |
| sint32x3 from typegpudata.ts | 18.51 kB ( |
| sint32x4 from typegpudata.ts | 18.51 kB ( |
| sint8 from typegpudata.ts | 18.51 kB ( |
| sint8x2 from typegpudata.ts | 18.51 kB ( |
| sint8x4 from typegpudata.ts | 18.51 kB ( |
| snorm16 from typegpudata.ts | 18.51 kB ( |
| snorm16x2 from typegpudata.ts | 18.51 kB ( |
| snorm16x4 from typegpudata.ts | 18.51 kB ( |
| snorm8 from typegpudata.ts | 18.51 kB ( |
| snorm8x2 from typegpudata.ts | 18.51 kB ( |
| snorm8x4 from typegpudata.ts | 18.51 kB ( |
| uint16 from typegpudata.ts | 18.51 kB ( |
| uint16x2 from typegpudata.ts | 18.51 kB ( |
| uint16x4 from typegpudata.ts | 18.51 kB ( |
| uint32 from typegpudata.ts | 18.51 kB ( |
| uint32x2 from typegpudata.ts | 18.51 kB ( |
| uint32x3 from typegpudata.ts | 18.51 kB ( |
| uint32x4 from typegpudata.ts | 18.51 kB ( |
| uint8x2 from typegpudata.ts | 18.51 kB ( |
| uint8x4 from typegpudata.ts | 18.51 kB ( |
| unorm10 10 10 2 from typegpudata.ts | 18.51 kB ( |
| unorm16 from typegpudata.ts | 18.51 kB ( |
| unorm16x2 from typegpudata.ts | 18.51 kB ( |
| unorm16x4 from typegpudata.ts | 18.51 kB ( |
| unorm8 from typegpudata.ts | 18.51 kB ( |
| unorm8x2 from typegpudata.ts | 18.51 kB ( |
| unorm8x4 bgra from typegpudata.ts | 18.51 kB ( |
| unorm8x4 from typegpudata.ts | 18.51 kB ( |
| packedFormats from typegpudata.ts | 18.53 kB ( |
| isPackedData from typegpudata.ts | 18.57 kB ( |
| alignmentOf from typegpudata.ts | 19.55 kB ( |
| subgroupAdd from typegpustd.ts | 21.58 kB ( |
| subgroupAll from typegpustd.ts | 21.58 kB ( |
| subgroupAnd from typegpustd.ts | 21.58 kB ( |
| subgroupAny from typegpustd.ts | 21.58 kB ( |
| subgroupBallot from typegpustd.ts | 21.58 kB ( |
| subgroupBroadcastFirst from typegpustd.ts | 21.58 kB ( |
| subgroupBroadcast from typegpustd.ts | 21.58 kB ( |
| subgroupElect from typegpustd.ts | 21.58 kB ( |
| subgroupExclusiveAdd from typegpustd.ts | 21.58 kB ( |
| subgroupExclusiveMul from typegpustd.ts | 21.58 kB ( |
| subgroupInclusiveAdd from typegpustd.ts | 21.58 kB ( |
| subgroupInclusiveMul from typegpustd.ts | 21.58 kB ( |
| subgroupMax from typegpustd.ts | 21.58 kB ( |
| subgroupMin from typegpustd.ts | 21.58 kB ( |
| subgroupMul from typegpustd.ts | 21.58 kB ( |
| subgroupOr from typegpustd.ts | 21.58 kB ( |
| subgroupShuffleDown from typegpustd.ts | 21.58 kB ( |
| subgroupShuffleUp from typegpustd.ts | 21.58 kB ( |
| subgroupShuffleXor from typegpustd.ts | 21.58 kB ( |
| subgroupShuffle from typegpustd.ts | 21.58 kB ( |
| subgroupXor from typegpustd.ts | 21.58 kB ( |
| isBuiltin from typegpudata.ts | 22.27 kB ( |
| dataImportOneDirect.ts | 22.32 kB ( |
| dataImportOneStar.ts | 22.32 kB ( |
| sizeOf from typegpudata.ts | 22.32 kB ( |
| isContiguous from typegpudata.ts | 22.33 kB ( |
| getLongestContiguousPrefix from typegpudata.ts | 22.34 kB ( |
| textureDimensions from typegpustd.ts | 23.06 kB ( |
| textureGather from typegpustd.ts | 23.06 kB ( |
| textureLoad from typegpustd.ts | 23.07 kB ( |
| textureSampleBaseClampToEdge from typegpustd.ts | 23.07 kB ( |
| textureSampleBias from typegpustd.ts | 23.07 kB ( |
| textureSampleCompareLevel from typegpustd.ts | 23.07 kB ( |
| textureSampleCompare from typegpustd.ts | 23.07 kB ( |
| textureSampleLevel from typegpustd.ts | 23.07 kB ( |
| textureSample from typegpustd.ts | 23.07 kB ( |
| textureStore from typegpustd.ts | 23.07 kB ( |
| arrayOf from typegpudata.ts | 23.82 kB ( |
| size from typegpudata.ts | 24.01 kB ( |
| align from typegpudata.ts | 24.01 kB ( |
| location from typegpudata.ts | 24.01 kB ( |
| interpolate from typegpudata.ts | 24.02 kB ( |
| invariant from typegpudata.ts | 24.39 kB ( |
| mat4x4f from typegpudata.ts | 24.53 kB ( |
| identity2 from typegpustd.ts | 24.53 kB ( |
| identity3 from typegpustd.ts | 24.53 kB ( |
| identity4 from typegpustd.ts | 24.53 kB ( |
| mat2x2f from typegpudata.ts | 24.53 kB ( |
| mat3x3f from typegpudata.ts | 24.53 kB ( |
| rotationX4 from typegpustd.ts | 24.53 kB ( |
| rotationY4 from typegpustd.ts | 24.53 kB ( |
| rotationZ4 from typegpustd.ts | 24.53 kB ( |
| scaling4 from typegpustd.ts | 24.53 kB ( |
| translation4 from typegpustd.ts | 24.53 kB ( |
| matToArray from typegpudata.ts | 24.67 kB ( |
| builtin from typegpudata.ts | 26.19 kB ( |
| pack2x16float from typegpustd.ts | 33.52 kB ( |
| pack4x8unorm from typegpustd.ts | 33.52 kB ( |
| unpack2x16float from typegpustd.ts | 33.52 kB ( |
| unpack4x8unorm from typegpustd.ts | 33.52 kB ( |
| memoryLayoutOf from typegpudata.ts | 39.62 kB ( |
| bitcastU32toF32 from typegpustd.ts | 41.73 kB ( |
| bitcastU32toI32 from typegpustd.ts | 41.73 kB ( |
| neg from typegpustd.ts | 45.90 kB ( |
| add from typegpustd.ts | 45.90 kB ( |
| bitShiftLeft from typegpustd.ts | 45.90 kB ( |
| bitShiftRight from typegpustd.ts | 45.90 kB ( |
| div from typegpustd.ts | 45.90 kB ( |
| mod from typegpustd.ts | 45.90 kB ( |
| mul from typegpustd.ts | 45.90 kB ( |
| sub from typegpustd.ts | 45.90 kB ( |
| stdImportOneDirect.ts | 45.91 kB ( |
| stdImportOneStar.ts | 45.91 kB ( |
| rotateX4 from typegpustd.ts | 46.66 kB ( |
| scale4 from typegpustd.ts | 46.66 kB ( |
| translate4 from typegpustd.ts | 46.66 kB ( |
| rotateY4 from typegpustd.ts | 46.67 kB ( |
| rotateZ4 from typegpustd.ts | 46.67 kB ( |
| and from typegpustd.ts | 48.42 kB ( |
| not from typegpustd.ts | 48.42 kB ( |
| or from typegpustd.ts | 48.42 kB ( |
| allEq from typegpustd.ts | 48.43 kB ( |
| all from typegpustd.ts | 48.43 kB ( |
| eq from typegpustd.ts | 48.43 kB ( |
| ge from typegpustd.ts | 48.43 kB ( |
| lt from typegpustd.ts | 48.43 kB ( |
| ne from typegpustd.ts | 48.43 kB ( |
| any from typegpustd.ts | 48.43 kB ( |
| gt from typegpustd.ts | 48.43 kB ( |
| isCloseTo from typegpustd.ts | 48.43 kB ( |
| le from typegpustd.ts | 48.43 kB ( |
| select from typegpustd.ts | 48.43 kB ( |
| common from typegpu.ts | 53.31 kB ( |
| isUsableAsUniform from typegpu.ts | 60.28 kB ( |
| isTexture from typegpu.ts | 60.29 kB ( |
| isSampler from typegpu.ts | 60.30 kB ( |
| isComparisonSampler from typegpu.ts | 60.31 kB ( |
| isVariable from typegpu.ts | 62.08 kB ( |
| dot from typegpustd.ts | 63.20 kB ( |
| length from typegpustd.ts | 63.20 kB ( |
| distance from typegpustd.ts | 63.21 kB ( |
| dot4U8Packed from typegpustd.ts | 63.21 kB ( |
| fract from typegpustd.ts | 63.21 kB ( |
| frexp from typegpustd.ts | 63.21 kB ( |
| mix from typegpustd.ts | 63.21 kB ( |
| modf from typegpustd.ts | 63.21 kB ( |
| abs from typegpustd.ts | 63.21 kB ( |
| acos from typegpustd.ts | 63.21 kB ( |
| acosh from typegpustd.ts | 63.21 kB ( |
| asin from typegpustd.ts | 63.21 kB ( |
| asinh from typegpustd.ts | 63.21 kB ( |
| atan2 from typegpustd.ts | 63.21 kB ( |
| atan from typegpustd.ts | 63.21 kB ( |
| atanh from typegpustd.ts | 63.21 kB ( |
| ceil from typegpustd.ts | 63.21 kB ( |
| clamp from typegpustd.ts | 63.21 kB ( |
| cos from typegpustd.ts | 63.21 kB ( |
| cosh from typegpustd.ts | 63.21 kB ( |
| countLeadingZeros from typegpustd.ts | 63.21 kB ( |
| countOneBits from typegpustd.ts | 63.21 kB ( |
| countTrailingZeros from typegpustd.ts | 63.21 kB ( |
| cross from typegpustd.ts | 63.21 kB ( |
| degrees from typegpustd.ts | 63.21 kB ( |
| determinant from typegpustd.ts | 63.21 kB ( |
| dot4I8Packed from typegpustd.ts | 63.21 kB ( |
| exp2 from typegpustd.ts | 63.21 kB ( |
| exp from typegpustd.ts | 63.21 kB ( |
| extractBits from typegpustd.ts | 63.21 kB ( |
| faceForward from typegpustd.ts | 63.21 kB ( |
| firstLeadingBit from typegpustd.ts | 63.21 kB ( |
| firstTrailingBit from typegpustd.ts | 63.21 kB ( |
| floor from typegpustd.ts | 63.21 kB ( |
| fma from typegpustd.ts | 63.21 kB ( |
| insertBits from typegpustd.ts | 63.21 kB ( |
| inverseSqrt from typegpustd.ts | 63.21 kB ( |
| ldexp from typegpustd.ts | 63.21 kB ( |
| log2 from typegpustd.ts | 63.21 kB ( |
| log from typegpustd.ts | 63.21 kB ( |
| max from typegpustd.ts | 63.21 kB ( |
| min from typegpustd.ts | 63.21 kB ( |
| normalize from typegpustd.ts | 63.21 kB ( |
| pow from typegpustd.ts | 63.21 kB ( |
| quantizeToF16 from typegpustd.ts | 63.21 kB ( |
| radians from typegpustd.ts | 63.21 kB ( |
| reflect from typegpustd.ts | 63.21 kB ( |
| refract from typegpustd.ts | 63.21 kB ( |
| reverseBits from typegpustd.ts | 63.21 kB ( |
| round from typegpustd.ts | 63.21 kB ( |
| saturate from typegpustd.ts | 63.21 kB ( |
| sign from typegpustd.ts | 63.21 kB ( |
| sin from typegpustd.ts | 63.21 kB ( |
| sinh from typegpustd.ts | 63.21 kB ( |
| smoothstep from typegpustd.ts | 63.21 kB ( |
| sqrt from typegpustd.ts | 63.21 kB ( |
| step from typegpustd.ts | 63.21 kB ( |
| tan from typegpustd.ts | 63.21 kB ( |
| tanh from typegpustd.ts | 63.21 kB ( |
| transpose from typegpustd.ts | 63.21 kB ( |
| trunc from typegpustd.ts | 63.21 kB ( |
| d from typegpu.ts | 84.48 kB ( |
| dataImportEverything.ts | 86.78 kB ( |
| std from typegpu.ts | 98.66 kB ( |
| WgslGenerator from typegpu.ts | 100.82 kB ( |
| stdImportEverything.ts | 101.41 kB ( |
| functionWithUseGpu.ts | 282 B (➖) |
| functionWithoutUseGpu.ts | 24 B (➖) |
| MissingLinksError from typegpu.ts | 201 B (➖) |
| MissingSlotValueError from typegpu.ts | 151 B (➖) |
| isAccessor from typegpu.ts | 65 B (➖) |
| isLazy from typegpu.ts | 61 B (➖) |
| isMutableAccessor from typegpu.ts | 73 B (➖) |
| isSlot from typegpu.ts | 61 B (➖) |
| isTgpuComputeFn from typegpu.ts | 69 B (➖) |
| isTgpuFragmentFn from typegpu.ts | 70 B (➖) |
| isTgpuVertexFn from typegpu.ts | 68 B (➖) |
| isUsableAsRender from typegpu.ts | 55 B (➖) |
| isUsableAsSampled from typegpu.ts | 56 B (➖) |
| isUsableAsStorage from typegpu.ts | 56 B (➖) |
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
1ca7e21 to
d9a6d19
Compare
| expect(rawBuffer).toBeDefined(); | ||
|
|
||
| expect(device.mock.queue.writeBuffer.mock.calls).toStrictEqual([ | ||
| [rawBuffer, 8, new Uint8Array([255, 127, 255, 127]), 0, 4], |
There was a problem hiding this comment.
This is the difference between floor (typed binary) and round (compiled writer) (1)
There was a problem hiding this comment.
0.5 * 65535 = 32767.5 -> round (what the compiled writer serializers use) gives 32768 (encoded as unorm16 [0, 128]) -> The old implementation must've truncated and give 32767 (encoded as unorm16 [255 127])
Introduces `.patch()` with `Record<number, T>` sparse updates to avoid false
positives from `{idx, value}[]` payloads while keeping `writePartial()` backward
compatible. Routes both APIs through the optimized patch pipeline and cleans up
the partial I/O implementation, docs, and tests.
47cefe8 to
2259483
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 46 out of 46 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| expect(rawBuffer).toBeDefined(); | ||
|
|
||
| expect(device.mock.queue.writeBuffer.mock.calls).toStrictEqual([ | ||
| [rawBuffer, 8, new Uint8Array([255, 127, 255, 127]), 0, 4], |
partialWrite API to better match write featurespartialWrite API and add patch API that better matches the write features
cieplypolar
left a comment
There was a problem hiding this comment.
Very nice, very cool ![]()
Co-authored-by: Szymon Szulc <103948576+cieplypolar@users.noreply.github.com>
This PR:
partialWritein favor of the newpatchAPI with extended capabilitiesThe main API differences are:
patchhas similar permissiveness as the newwriteAPI (accepts tuples and typed arrays)We could now move the entire
patchAPI to use compiled writers everywhere (due to compiled writers handling start/end offsets) but I want to get this into the 0.11 release so for now let's say out of scope - I left most internals untouched. Now we use them for leaf values (since they handle padding better) - this is to be discussed since this means creating a writer per primitive data typeHere are benchmark results (for what they're worth):

Important to mention that they use the old API so we are paying conversion costs for each call