Skip to content

feat: bitcastF32toU32#2517

Open
cieplypolar wants to merge 22 commits into
mainfrom
feat/bitcastF32ToU32
Open

feat: bitcastF32toU32#2517
cieplypolar wants to merge 22 commits into
mainfrom
feat/bitcastF32ToU32

Conversation

@cieplypolar

@cieplypolar cieplypolar commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Let's wait for #2615.

TODO:

  • remember to add sideEffect: false

Copilot AI review requested due to automatic review settings May 19, 2026 14:56
@github-actions

github-actions Bot commented May 19, 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@3db6b33badf40ed1ebe91c6f4592057a74a43f71
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/cli@3db6b33badf40ed1ebe91c6f4592057a74a43f71
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@3db6b33badf40ed1ebe91c6f4592057a74a43f71
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/react@3db6b33badf40ed1ebe91c6f4592057a74a43f71
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@3db6b33badf40ed1ebe91c6f4592057a74a43f71

benchmark
view benchmark

commit
view commit

@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown

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

🟢 Decreased ➖ Unchanged 🔴 Increased ❔ Unknown
0 207 113 1

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

Test tsdown
std_bitcastU32toF32.ts 45.09 kB ($${\color{red}+2.0\%}$$)
std_bitcastU32toI32.ts 45.09 kB ($${\color{red}+2.0\%}$$)
STATIC_std.ts 106.77 kB ($${\color{red}+0.8\%}$$)
std_bitcastF32toU32.ts 45.09 kB

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

Click to reveal the results table (298 entries).
Test tsdown
d_Void.ts 87.49 kB ($${\color{red}+12105.3\%}$$)
d_sampler.ts 87.49 kB ($${\color{red}+11974.1\%}$$)
d_isPtr.ts 87.49 kB ($${\color{red}+11813.3\%}$$)
d_comparisonSampler.ts 87.50 kB ($${\color{red}+11799.1\%}$$)
d_isSizeAttrib.ts 87.50 kB ($${\color{red}+11782.6\%}$$)
d_isWgslArray.ts 87.49 kB ($${\color{red}+11782.5\%}$$)
d_isAlignAttrib.ts 87.50 kB ($${\color{red}+11767.0\%}$$)
d_isWgslStruct.ts 87.50 kB ($${\color{red}+11766.9\%}$$)
d_isAtomic.ts 87.49 kB ($${\color{red}+11766.4\%}$$)
d_isBuiltinAttrib.ts 87.50 kB ($${\color{red}+11735.9\%}$$)
d_isLocationAttrib.ts 87.50 kB ($${\color{red}+11720.4\%}$$)
d_isDecorated.ts 87.49 kB ($${\color{red}+11719.8\%}$$)
d_isInterpolateAttrib.ts 87.50 kB ($${\color{red}+11674.2\%}$$)
d_atomic.ts 87.49 kB ($${\color{red}+11400.5\%}$$)
d_ptrHandle.ts 87.49 kB ($${\color{red}+10427.8\%}$$)
d_ptrUniform.ts 87.49 kB ($${\color{red}+10415.6\%}$$)
d_ptrStorage.ts 87.49 kB ($${\color{red}+10366.5\%}$$)
d_ptrPrivate.ts 87.49 kB ($${\color{red}+10342.1\%}$$)
d_ptrFn.ts 87.49 kB ($${\color{red}+10329.3\%}$$)
d_ptrWorkgroup.ts 87.50 kB ($${\color{red}+10318.0\%}$$)
d_textureExternal.ts 87.50 kB ($${\color{red}+10163.2\%}$$)
d_textureStorage1d.ts 87.50 kB ($${\color{red}+8540.2\%}$$)
d_textureStorage2d.ts 87.50 kB ($${\color{red}+8540.2\%}$$)
d_textureStorage3d.ts 87.50 kB ($${\color{red}+8540.2\%}$$)
d_textureStorage2dArray.ts 87.50 kB ($${\color{red}+8393.3\%}$$)
d_isDisarray.ts 87.49 kB ($${\color{red}+7765.9\%}$$)
d_isUnstruct.ts 87.49 kB ($${\color{red}+7765.9\%}$$)
d_isLooseDecorated.ts 87.50 kB ($${\color{red}+7718.4\%}$$)
d_isLooseData.ts 87.49 kB ($${\color{red}+7454.3\%}$$)
d_isWgslData.ts 87.49 kB ($${\color{red}+6576.1\%}$$)
d_unstruct.ts 87.49 kB ($${\color{red}+5552.4\%}$$)
d_isData.ts 87.49 kB ($${\color{red}+4740.0\%}$$)
d_deepEqual.ts 87.49 kB ($${\color{red}+3890.7\%}$$)
d_struct.ts 87.49 kB ($${\color{red}+2327.2\%}$$)
d_ref.ts 87.49 kB ($${\color{red}+1727.2\%}$$)
std_discard.ts 103.92 kB ($${\color{red}+632.5\%}$$)
std_copy.ts 103.92 kB ($${\color{red}+620.2\%}$$)
std_arrayLength.ts 103.92 kB ($${\color{red}+620.0\%}$$)
std_isBeingTranspiled.ts 103.93 kB ($${\color{red}+618.4\%}$$)
std_getTargetShaderLanguage.ts 103.94 kB ($${\color{red}+615.2\%}$$)
std_extensionEnabled.ts 103.93 kB ($${\color{red}+612.7\%}$$)
std_range.ts 103.92 kB ($${\color{red}+599.8\%}$$)
std_dpdx.ts 103.92 kB ($${\color{red}+591.3\%}$$)
std_fwidthCoarse.ts 103.92 kB ($${\color{red}+591.1\%}$$)
std_dpdxCoarse.ts 103.92 kB ($${\color{red}+591.1\%}$$)
std_dpdyCoarse.ts 103.92 kB ($${\color{red}+591.1\%}$$)
std_fwidthFine.ts 103.92 kB ($${\color{red}+591.1\%}$$)
std_dpdxFine.ts 103.92 kB ($${\color{red}+591.1\%}$$)
std_dpdyFine.ts 103.92 kB ($${\color{red}+591.1\%}$$)
std_fwidth.ts 103.92 kB ($${\color{red}+591.1\%}$$)
std_dpdy.ts 103.92 kB ($${\color{red}+591.1\%}$$)
d_bool.ts 87.49 kB ($${\color{red}+574.3\%}$$)
d_f16.ts 87.49 kB ($${\color{red}+574.3\%}$$)
d_f32.ts 87.49 kB ($${\color{red}+574.3\%}$$)
d_i32.ts 87.49 kB ($${\color{red}+574.3\%}$$)
d_u32.ts 87.49 kB ($${\color{red}+574.3\%}$$)
d_u16.ts 87.49 kB ($${\color{red}+573.1\%}$$)
std_atomicLoad.ts 103.92 kB ($${\color{red}+558.2\%}$$)
std_textureBarrier.ts 103.93 kB ($${\color{red}+558.0\%}$$)
std_atomicStore.ts 103.92 kB ($${\color{red}+558.0\%}$$)
std_workgroupBarrier.ts 103.93 kB ($${\color{red}+557.8\%}$$)
std_storageBarrier.ts 103.93 kB ($${\color{red}+557.8\%}$$)
std_atomicAdd.ts 103.92 kB ($${\color{red}+557.7\%}$$)
std_atomicAnd.ts 103.92 kB ($${\color{red}+557.7\%}$$)
std_atomicMax.ts 103.92 kB ($${\color{red}+557.7\%}$$)
std_atomicMin.ts 103.92 kB ($${\color{red}+557.7\%}$$)
std_atomicSub.ts 103.92 kB ($${\color{red}+557.7\%}$$)
std_atomicXor.ts 103.92 kB ($${\color{red}+557.7\%}$$)
std_atomicOr.ts 103.92 kB ($${\color{red}+557.7\%}$$)
d_textureDepth2d.ts 87.50 kB ($${\color{red}+552.1\%}$$)
d_textureDepthCube.ts 87.50 kB ($${\color{red}+551.8\%}$$)
d_texture1d.ts 87.49 kB ($${\color{red}+551.5\%}$$)
d_texture2d.ts 87.49 kB ($${\color{red}+551.5\%}$$)
d_texture3d.ts 87.49 kB ($${\color{red}+551.5\%}$$)
d_textureDepth2dArray.ts 87.50 kB ($${\color{red}+551.3\%}$$)
d_textureCube.ts 87.49 kB ($${\color{red}+551.3\%}$$)
d_textureDepthCubeArray.ts 87.50 kB ($${\color{red}+551.0\%}$$)
d_textureDepthMultisampled2d.ts 87.51 kB ($${\color{red}+550.9\%}$$)
d_texture2dArray.ts 87.50 kB ($${\color{red}+550.7\%}$$)
d_textureCubeArray.ts 87.50 kB ($${\color{red}+550.4\%}$$)
d_textureMultisampled2d.ts 87.50 kB ($${\color{red}+550.4\%}$$)
d_disarrayOf.ts 87.49 kB ($${\color{red}+482.6\%}$$)
d_vec2b.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec2f.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec2h.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec2i.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec2u.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec3b.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec3f.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec3h.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec3i.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec3u.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec4b.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec4f.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec4h.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec4i.ts 87.49 kB ($${\color{red}+350.8\%}$$)
d_vec4u.ts 87.49 kB ($${\color{red}+350.8\%}$$)
std_subgroupAdd.ts 103.92 kB ($${\color{red}+333.4\%}$$)
std_subgroupBroadcastFirst.ts 103.93 kB ($${\color{red}+333.3\%}$$)
std_subgroupExclusiveAdd.ts 103.93 kB ($${\color{red}+333.3\%}$$)
std_subgroupExclusiveMul.ts 103.93 kB ($${\color{red}+333.3\%}$$)
std_subgroupInclusiveAdd.ts 103.93 kB ($${\color{red}+333.3\%}$$)
std_subgroupInclusiveMul.ts 103.93 kB ($${\color{red}+333.3\%}$$)
std_subgroupShuffleDown.ts 103.93 kB ($${\color{red}+333.3\%}$$)
std_subgroupShuffleXor.ts 103.93 kB ($${\color{red}+333.3\%}$$)
std_subgroupBroadcast.ts 103.93 kB ($${\color{red}+333.3\%}$$)
std_subgroupShuffleUp.ts 103.93 kB ($${\color{red}+333.3\%}$$)
std_subgroupShuffle.ts 103.93 kB ($${\color{red}+333.3\%}$$)
std_subgroupBallot.ts 103.93 kB ($${\color{red}+333.3\%}$$)
std_subgroupElect.ts 103.93 kB ($${\color{red}+333.3\%}$$)
std_subgroupAll.ts 103.92 kB ($${\color{red}+333.2\%}$$)
std_subgroupAnd.ts 103.92 kB ($${\color{red}+333.2\%}$$)
std_subgroupAny.ts 103.92 kB ($${\color{red}+333.2\%}$$)
std_subgroupMax.ts 103.92 kB ($${\color{red}+333.2\%}$$)
std_subgroupMin.ts 103.92 kB ($${\color{red}+333.2\%}$$)
std_subgroupMul.ts 103.92 kB ($${\color{red}+333.2\%}$$)
std_subgroupXor.ts 103.92 kB ($${\color{red}+333.2\%}$$)
std_subgroupOr.ts 103.92 kB ($${\color{red}+333.2\%}$$)
d_formatToWGSLType.ts 87.50 kB ($${\color{red}+318.7\%}$$)
d_uint8.ts 87.49 kB ($${\color{red}+318.6\%}$$)
d_unorm10_10_10_2.ts 87.50 kB ($${\color{red}+318.5\%}$$)
d_unorm8x4_bgra.ts 87.50 kB ($${\color{red}+318.5\%}$$)
d_float16x2.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_float16x4.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_float32x2.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_float32x3.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_float32x4.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_snorm16x2.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_snorm16x4.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_unorm16x2.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_unorm16x4.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_sint16x2.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_sint16x4.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_sint32x2.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_sint32x3.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_sint32x4.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_snorm8x2.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_snorm8x4.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_uint16x2.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_uint16x4.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_uint32x2.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_uint32x3.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_uint32x4.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_unorm8x2.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_unorm8x4.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_float16.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_float32.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_sint8x2.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_sint8x4.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_snorm16.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_uint8x2.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_uint8x4.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_unorm16.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_sint16.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_sint32.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_snorm8.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_uint16.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_uint32.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_unorm8.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_sint8.ts 87.49 kB ($${\color{red}+318.5\%}$$)
d_packedFormats.ts 87.50 kB ($${\color{red}+318.1\%}$$)
d_isPackedData.ts 87.50 kB ($${\color{red}+317.3\%}$$)
std_textureDimensions.ts 103.93 kB ($${\color{red}+303.8\%}$$)
std_textureGather.ts 103.93 kB ($${\color{red}+303.8\%}$$)
std_textureSampleBaseClampToEdge.ts 103.94 kB ($${\color{red}+303.7\%}$$)
std_textureSampleCompareLevel.ts 103.94 kB ($${\color{red}+303.7\%}$$)
std_textureSampleCompare.ts 103.93 kB ($${\color{red}+303.7\%}$$)
std_textureSampleLevel.ts 103.93 kB ($${\color{red}+303.7\%}$$)
std_textureSampleBias.ts 103.93 kB ($${\color{red}+303.7\%}$$)
std_textureSampleGrad.ts 103.93 kB ($${\color{red}+303.7\%}$$)
std_textureSample.ts 103.93 kB ($${\color{red}+303.7\%}$$)
std_textureStore.ts 103.92 kB ($${\color{red}+303.7\%}$$)
std_textureLoad.ts 103.92 kB ($${\color{red}+303.7\%}$$)
d_alignmentOf.ts 87.49 kB ($${\color{red}+300.4\%}$$)
std_translation4.ts 103.92 kB ($${\color{red}+285.1\%}$$)
std_rotationX4.ts 103.92 kB ($${\color{red}+285.1\%}$$)
std_rotationY4.ts 103.92 kB ($${\color{red}+285.1\%}$$)
std_rotationZ4.ts 103.92 kB ($${\color{red}+285.1\%}$$)
std_identity2.ts 103.92 kB ($${\color{red}+285.0\%}$$)
std_identity3.ts 103.92 kB ($${\color{red}+285.0\%}$$)
std_identity4.ts 103.92 kB ($${\color{red}+285.0\%}$$)
std_scaling4.ts 103.92 kB ($${\color{red}+285.0\%}$$)
d_isBuiltin.ts 87.49 kB ($${\color{red}+256.0\%}$$)
d_sizeOf.ts 87.49 kB ($${\color{red}+255.3\%}$$)
d_isContiguous.ts 87.50 kB ($${\color{red}+255.2\%}$$)
d_getLongestContiguousPrefix.ts 87.51 kB ($${\color{red}+255.1\%}$$)
d_arrayOf.ts 87.49 kB ($${\color{red}+234.3\%}$$)
d_size.ts 87.49 kB ($${\color{red}+232.5\%}$$)
d_align.ts 87.49 kB ($${\color{red}+232.5\%}$$)
d_location.ts 87.49 kB ($${\color{red}+232.5\%}$$)
d_interpolate.ts 87.49 kB ($${\color{red}+232.5\%}$$)
d_invariant.ts 87.49 kB ($${\color{red}+227.9\%}$$)
d_mat4x4f.ts 87.49 kB ($${\color{red}+224.2\%}$$)
d_mat2x2f.ts 87.49 kB ($${\color{red}+224.2\%}$$)
d_mat3x3f.ts 87.49 kB ($${\color{red}+224.2\%}$$)
d_matToArray.ts 87.49 kB ($${\color{red}+222.6\%}$$)
d_builtin.ts 87.49 kB ($${\color{red}+205.6\%}$$)
std_unpack2x16float.ts 103.93 kB ($${\color{red}+189.1\%}$$)
std_unpack4x8unorm.ts 103.93 kB ($${\color{red}+189.1\%}$$)
std_pack2x16float.ts 103.93 kB ($${\color{red}+189.1\%}$$)
std_pack4x8unorm.ts 103.92 kB ($${\color{red}+189.1\%}$$)
std_bitcastF32toU32.ts 103.93 kB ($${\color{red}+130.5\%}$$)
std_bitcastU32toF32.ts 103.93 kB ($${\color{red}+130.5\%}$$)
std_bitcastU32toI32.ts 103.93 kB ($${\color{red}+130.5\%}$$)
std_neg.ts 103.92 kB ($${\color{red}+114.3\%}$$)
std_bitShiftRight.ts 103.93 kB ($${\color{red}+114.3\%}$$)
std_bitShiftLeft.ts 103.92 kB ($${\color{red}+114.3\%}$$)
std_add.ts 103.92 kB ($${\color{red}+114.3\%}$$)
std_div.ts 103.92 kB ($${\color{red}+114.3\%}$$)
std_mod.ts 103.92 kB ($${\color{red}+114.3\%}$$)
std_mul.ts 103.92 kB ($${\color{red}+114.3\%}$$)
std_sub.ts 103.92 kB ($${\color{red}+114.3\%}$$)
std_translate4.ts 103.92 kB ($${\color{red}+111.0\%}$$)
std_rotateX4.ts 103.92 kB ($${\color{red}+111.0\%}$$)
std_scale4.ts 103.92 kB ($${\color{red}+111.0\%}$$)
std_rotateY4.ts 103.92 kB ($${\color{red}+111.0\%}$$)
std_rotateZ4.ts 103.92 kB ($${\color{red}+111.0\%}$$)
d_memoryLayoutOf.ts 87.50 kB ($${\color{red}+108.6\%}$$)
std_and.ts 103.92 kB ($${\color{red}+100.4\%}$$)
std_or.ts 103.92 kB ($${\color{red}+100.4\%}$$)
std_select.ts 103.92 kB ($${\color{red}+100.4\%}$$)
std_allEq.ts 103.92 kB ($${\color{red}+100.4\%}$$)
std_all.ts 103.92 kB ($${\color{red}+100.4\%}$$)
std_not.ts 103.92 kB ($${\color{red}+100.4\%}$$)
std_eq.ts 103.92 kB ($${\color{red}+100.4\%}$$)
std_lt.ts 103.92 kB ($${\color{red}+100.4\%}$$)
std_ne.ts 103.92 kB ($${\color{red}+100.4\%}$$)
std_isCloseTo.ts 103.92 kB ($${\color{red}+100.3\%}$$)
std_any.ts 103.92 kB ($${\color{red}+100.3\%}$$)
std_ge.ts 103.92 kB ($${\color{red}+100.3\%}$$)
std_gt.ts 103.92 kB ($${\color{red}+100.3\%}$$)
std_le.ts 103.92 kB ($${\color{red}+100.3\%}$$)
std_dot4U8Packed.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_length.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_countTrailingZeros.ts 103.93 kB ($${\color{red}+57.1\%}$$)
std_distance.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_dot.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_countLeadingZeros.ts 103.93 kB ($${\color{red}+57.1\%}$$)
std_firstTrailingBit.ts 103.93 kB ($${\color{red}+57.1\%}$$)
std_firstLeadingBit.ts 103.93 kB ($${\color{red}+57.1\%}$$)
std_fract.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_frexp.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_modf.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_quantizeToF16.ts 103.93 kB ($${\color{red}+57.1\%}$$)
std_mix.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_countOneBits.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_dot4I8Packed.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_determinant.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_extractBits.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_faceForward.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_inverseSqrt.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_reverseBits.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_insertBits.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_smoothstep.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_normalize.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_transpose.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_saturate.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_degrees.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_radians.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_reflect.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_refract.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_acosh.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_asinh.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_atan2.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_atanh.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_clamp.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_cross.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_floor.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_ldexp.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_round.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_trunc.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_acos.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_asin.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_atan.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_ceil.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_cosh.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_exp2.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_log2.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_sign.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_sinh.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_sqrt.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_step.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_tanh.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_abs.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_cos.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_exp.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_fma.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_log.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_max.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_min.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_pow.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_sin.ts 103.92 kB ($${\color{red}+57.1\%}$$)
std_tan.ts 103.92 kB ($${\color{red}+57.1\%}$$)
common_fullScreenTriangle.ts 56.66 kB ($${\color{red}+42.1\%}$$)
common_writeSoA.ts 56.65 kB ($${\color{red}+37.5\%}$$)
STATIC_allImports.ts 287.20 kB ($${\color{green}-1.7\%}$$)
STATIC_d.ts 87.48 kB ($${\color{green}-2.6\%}$$)
STATIC_std.ts 103.91 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 May 19, 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 [1.00, 1.98, 4.47, 6.60, 7.30, 11.64, 22.60, 24.74]
  line [0.95, 1.99, 4.34, 6.32, 8.32, 11.65, 22.86, 25.14]
  line [0.92, 1.93, 4.40, 5.90, 7.22, 10.44, 21.05, 23.99]
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.29, 0.50, 0.69, 0.89, 1.16, 1.28, 1.44, 1.69]
  line [0.27, 0.52, 0.70, 0.84, 1.16, 1.23, 1.47, 1.58]
  line [0.27, 0.52, 0.73, 0.84, 1.13, 1.23, 1.49, 1.59]
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.86, 2.19, 4.44, 6.50, 12.91, 26.10, 57.02, 114.79]
  line [0.86, 2.10, 4.22, 6.73, 13.10, 27.44, 55.22, 115.99]
  line [0.91, 2.06, 3.74, 6.33, 11.92, 25.10, 54.73, 111.06]
Loading

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new std helper bitcastF32toU32 (CPU + WGSL codegen) to reinterpret f32 bit patterns as u32, including vector support, and extends the test suite to cover the new behavior.

Changes:

  • Implement std.bitcastF32toU32 with dualImpl support for scalars and vec2f/vec3f/vec4f.
  • Add CPU bitcast implementation (bitcastF32toU32Impl) and vector-component CPU helpers.
  • Extend bitcast tests to cover scalar/vector behavior and shader codegen snapshots.

Reviewed changes

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

Show a summary per file
File Description
packages/typegpu/tests/std/bitcast.test.ts Adds scalar/vector tests and shader snapshots for bitcastF32toU32 (currently introduces a Node Buffer typing issue).
packages/typegpu/src/std/index.ts Exports bitcastF32toU32 from the std barrel.
packages/typegpu/src/std/bitcast.ts Adds the new dualImpl wrapper for bitcastF32toU32 (signature currently doesn’t reject unsupported input types).
packages/typegpu/src/data/vectorOps.ts Adds CPU vector implementations for bitcastF32toU32.
packages/typegpu/src/data/numberOps.ts Adds the scalar CPU bitcast implementation for f32 -> u32.

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

Comment thread packages/typegpu/src/std/bitcast.ts
Comment thread packages/typegpu/tests/std/bitcast.test.ts

@iwoplaza iwoplaza left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would add a few more dataType checks like the AI said, but other than that, you have my stamp of approval :shipit:

@cieplypolar cieplypolar requested a review from iwoplaza May 21, 2026 19:26

@aleksanderkatan aleksanderkatan 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.

Nice! 🫦🩹

Comment thread packages/typegpu/src/data/numberOps.ts Outdated
Comment thread packages/typegpu/src/std/bitcast.ts Outdated
@cieplypolar

Copy link
Copy Markdown
Collaborator Author

@pullfrog review this PR

Comment thread packages/typegpu/src/std/bitcast.ts

@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.

ℹ️ Minor suggestions inline.

Reviewed changes — adds bitcastF32toU32, refactors the existing bitcast functions to use stricter type unification, and optimizes the shared ArrayBuffer in the CPU implementations.

  • Add bitcastF32toU32 — new dualImpl function mirroring bitcastU32toF32 and bitcastU32toI32, with runtime impl, shader codegen, and VectorOps support for all float→uint combinations.
  • Add unifyStrict to conversion.ts — stricter unify that rejects unknown types (via findBestType with recast: false) instead of silently passing them through.
  • Refactor existing bitcast functionsbitcastU32toF32 and bitcastU32toI32 now use unifyStrict + SignatureNotSupportedError instead of the lenient unify fallback pattern. Overload types converted from intersection types to conditional generics.
  • Optimize CPU bitcast impls — shared module-level ArrayBuffer with typed array views replaces per-call new DataView(new ArrayBuffer(4)).
  • Tests — scalar, vector, edge-case (NaN/infinities/subnormals/±0), shader codegen, and error-path coverage for the new function.

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

Comment thread packages/typegpu/src/std/bitcast.ts
Comment thread packages/typegpu/src/tgsl/conversion.ts

@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.

ℹ️ No critical issues — minor suggestion inline.

Reviewed changes — addresses the prior review's codegen concern and adds union-type tests.

  • Fix bitcastU32toF32 and bitcastU32toI32 shader codegencodegenImpl now emits bitcast<vecNf> / bitcast<vecNi> for vector arguments, matching the pattern already used in bitcastF32toU32.
  • Add union-type and type-error testsexpectTypeOf verifies correct return-type narrowing for union arguments; error-path tests cover SignatureNotSupportedError rejection of invalid types.

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

Comment thread packages/typegpu/tests/std/bitcast.test.ts
Comment thread packages/typegpu/src/tgsl/conversion.ts
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.

4 participants