test: Split tests into internal and not-internal tests#2638
Conversation
|
pkg.pr.new packages benchmark commit |
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased | ❔ Unknown |
|---|---|---|---|
| 0 | 320 | 0 | 0 |
import { ... } in PR vs import * as ... in PR (is the library tree-Shakeable?):
Click to reveal the results table (297 entries).
| Test | tsdown |
|---|---|
| d_Void.ts | 87.36 kB ( |
| d_sampler.ts | 87.36 kB ( |
| d_isPtr.ts | 87.36 kB ( |
| d_comparisonSampler.ts | 87.37 kB ( |
| d_isSizeAttrib.ts | 87.37 kB ( |
| d_isWgslArray.ts | 87.37 kB ( |
| d_isAlignAttrib.ts | 87.37 kB ( |
| d_isWgslStruct.ts | 87.37 kB ( |
| d_isAtomic.ts | 87.36 kB ( |
| d_isBuiltinAttrib.ts | 87.37 kB ( |
| d_isLocationAttrib.ts | 87.37 kB ( |
| d_isDecorated.ts | 87.37 kB ( |
| d_isInterpolateAttrib.ts | 87.38 kB ( |
| d_atomic.ts | 87.36 kB ( |
| d_ptrHandle.ts | 87.37 kB ( |
| d_ptrUniform.ts | 87.37 kB ( |
| d_ptrStorage.ts | 87.37 kB ( |
| d_ptrPrivate.ts | 87.37 kB ( |
| d_ptrFn.ts | 87.36 kB ( |
| d_ptrWorkgroup.ts | 87.37 kB ( |
| d_textureExternal.ts | 87.37 kB ( |
| d_textureStorage1d.ts | 87.37 kB ( |
| d_textureStorage2d.ts | 87.37 kB ( |
| d_textureStorage3d.ts | 87.37 kB ( |
| d_textureStorage2dArray.ts | 87.38 kB ( |
| d_isDisarray.ts | 87.37 kB ( |
| d_isUnstruct.ts | 87.37 kB ( |
| d_isLooseDecorated.ts | 87.37 kB ( |
| d_isLooseData.ts | 87.37 kB ( |
| d_isWgslData.ts | 87.37 kB ( |
| d_unstruct.ts | 87.36 kB ( |
| d_isData.ts | 87.36 kB ( |
| d_deepEqual.ts | 87.37 kB ( |
| d_struct.ts | 87.36 kB ( |
| d_ref.ts | 87.36 kB ( |
| std_discard.ts | 103.09 kB ( |
| std_copy.ts | 103.09 kB ( |
| std_arrayLength.ts | 103.10 kB ( |
| std_isBeingTranspiled.ts | 103.10 kB ( |
| std_getTargetShaderLanguage.ts | 103.11 kB ( |
| std_extensionEnabled.ts | 103.10 kB ( |
| std_range.ts | 103.09 kB ( |
| std_dpdx.ts | 103.09 kB ( |
| std_fwidthCoarse.ts | 103.10 kB ( |
| std_dpdxCoarse.ts | 103.10 kB ( |
| std_dpdyCoarse.ts | 103.10 kB ( |
| std_fwidthFine.ts | 103.10 kB ( |
| std_dpdxFine.ts | 103.09 kB ( |
| std_dpdyFine.ts | 103.09 kB ( |
| std_fwidth.ts | 103.09 kB ( |
| std_dpdy.ts | 103.09 kB ( |
| d_bool.ts | 87.36 kB ( |
| d_f16.ts | 87.36 kB ( |
| d_f32.ts | 87.36 kB ( |
| d_i32.ts | 87.36 kB ( |
| d_u32.ts | 87.36 kB ( |
| d_u16.ts | 87.36 kB ( |
| std_atomicLoad.ts | 103.10 kB ( |
| std_textureBarrier.ts | 103.10 kB ( |
| std_atomicStore.ts | 103.10 kB ( |
| std_workgroupBarrier.ts | 103.10 kB ( |
| std_storageBarrier.ts | 103.10 kB ( |
| std_atomicAdd.ts | 103.09 kB ( |
| std_atomicAnd.ts | 103.09 kB ( |
| std_atomicMax.ts | 103.09 kB ( |
| std_atomicMin.ts | 103.09 kB ( |
| std_atomicSub.ts | 103.09 kB ( |
| std_atomicXor.ts | 103.09 kB ( |
| std_atomicOr.ts | 103.09 kB ( |
| d_textureDepth2d.ts | 87.37 kB ( |
| d_textureDepthCube.ts | 87.37 kB ( |
| d_texture1d.ts | 87.37 kB ( |
| d_texture2d.ts | 87.37 kB ( |
| d_texture3d.ts | 87.37 kB ( |
| d_textureDepth2dArray.ts | 87.38 kB ( |
| d_textureCube.ts | 87.37 kB ( |
| d_textureDepthCubeArray.ts | 87.38 kB ( |
| d_textureDepthMultisampled2d.ts | 87.38 kB ( |
| d_texture2dArray.ts | 87.37 kB ( |
| d_textureCubeArray.ts | 87.37 kB ( |
| d_textureMultisampled2d.ts | 87.38 kB ( |
| d_disarrayOf.ts | 87.37 kB ( |
| d_vec2b.ts | 87.36 kB ( |
| d_vec2f.ts | 87.36 kB ( |
| d_vec2h.ts | 87.36 kB ( |
| d_vec2i.ts | 87.36 kB ( |
| d_vec2u.ts | 87.36 kB ( |
| d_vec3b.ts | 87.36 kB ( |
| d_vec3f.ts | 87.36 kB ( |
| d_vec3h.ts | 87.36 kB ( |
| d_vec3i.ts | 87.36 kB ( |
| d_vec3u.ts | 87.36 kB ( |
| d_vec4b.ts | 87.36 kB ( |
| d_vec4f.ts | 87.36 kB ( |
| d_vec4h.ts | 87.36 kB ( |
| d_vec4i.ts | 87.36 kB ( |
| d_vec4u.ts | 87.36 kB ( |
| std_subgroupAdd.ts | 103.10 kB ( |
| std_subgroupBroadcastFirst.ts | 103.11 kB ( |
| std_subgroupExclusiveAdd.ts | 103.11 kB ( |
| std_subgroupExclusiveMul.ts | 103.11 kB ( |
| std_subgroupInclusiveAdd.ts | 103.11 kB ( |
| std_subgroupInclusiveMul.ts | 103.11 kB ( |
| std_subgroupShuffleDown.ts | 103.10 kB ( |
| std_subgroupShuffleXor.ts | 103.10 kB ( |
| std_subgroupBroadcast.ts | 103.10 kB ( |
| std_subgroupShuffleUp.ts | 103.10 kB ( |
| std_subgroupShuffle.ts | 103.10 kB ( |
| std_subgroupBallot.ts | 103.10 kB ( |
| std_subgroupElect.ts | 103.10 kB ( |
| std_subgroupAll.ts | 103.10 kB ( |
| std_subgroupAnd.ts | 103.10 kB ( |
| std_subgroupAny.ts | 103.10 kB ( |
| std_subgroupMax.ts | 103.10 kB ( |
| std_subgroupMin.ts | 103.10 kB ( |
| std_subgroupMul.ts | 103.10 kB ( |
| std_subgroupXor.ts | 103.10 kB ( |
| std_subgroupOr.ts | 103.10 kB ( |
| d_formatToWGSLType.ts | 87.37 kB ( |
| d_uint8.ts | 87.36 kB ( |
| d_unorm10_10_10_2.ts | 87.37 kB ( |
| d_unorm8x4_bgra.ts | 87.37 kB ( |
| d_float16x2.ts | 87.37 kB ( |
| d_float16x4.ts | 87.37 kB ( |
| d_float32x2.ts | 87.37 kB ( |
| d_float32x3.ts | 87.37 kB ( |
| d_float32x4.ts | 87.37 kB ( |
| d_snorm16x2.ts | 87.37 kB ( |
| d_snorm16x4.ts | 87.37 kB ( |
| d_unorm16x2.ts | 87.37 kB ( |
| d_unorm16x4.ts | 87.37 kB ( |
| d_sint16x2.ts | 87.36 kB ( |
| d_sint16x4.ts | 87.36 kB ( |
| d_sint32x2.ts | 87.36 kB ( |
| d_sint32x3.ts | 87.36 kB ( |
| d_sint32x4.ts | 87.36 kB ( |
| d_snorm8x2.ts | 87.36 kB ( |
| d_snorm8x4.ts | 87.36 kB ( |
| d_uint16x2.ts | 87.36 kB ( |
| d_uint16x4.ts | 87.36 kB ( |
| d_uint32x2.ts | 87.36 kB ( |
| d_uint32x3.ts | 87.36 kB ( |
| d_uint32x4.ts | 87.36 kB ( |
| d_unorm8x2.ts | 87.36 kB ( |
| d_unorm8x4.ts | 87.36 kB ( |
| d_float16.ts | 87.36 kB ( |
| d_float32.ts | 87.36 kB ( |
| d_sint8x2.ts | 87.36 kB ( |
| d_sint8x4.ts | 87.36 kB ( |
| d_snorm16.ts | 87.36 kB ( |
| d_uint8x2.ts | 87.36 kB ( |
| d_uint8x4.ts | 87.36 kB ( |
| d_unorm16.ts | 87.36 kB ( |
| d_sint16.ts | 87.36 kB ( |
| d_sint32.ts | 87.36 kB ( |
| d_snorm8.ts | 87.36 kB ( |
| d_uint16.ts | 87.36 kB ( |
| d_uint32.ts | 87.36 kB ( |
| d_unorm8.ts | 87.36 kB ( |
| d_sint8.ts | 87.36 kB ( |
| d_packedFormats.ts | 87.37 kB ( |
| d_isPackedData.ts | 87.37 kB ( |
| std_textureDimensions.ts | 103.10 kB ( |
| std_textureGather.ts | 103.10 kB ( |
| std_textureSampleBaseClampToEdge.ts | 103.11 kB ( |
| std_textureSampleCompareLevel.ts | 103.11 kB ( |
| std_textureSampleCompare.ts | 103.11 kB ( |
| std_textureSampleLevel.ts | 103.10 kB ( |
| std_textureSampleBias.ts | 103.10 kB ( |
| std_textureSampleGrad.ts | 103.10 kB ( |
| std_textureSample.ts | 103.10 kB ( |
| std_textureStore.ts | 103.10 kB ( |
| std_textureLoad.ts | 103.10 kB ( |
| d_alignmentOf.ts | 87.37 kB ( |
| std_translation4.ts | 103.10 kB ( |
| std_rotationX4.ts | 103.10 kB ( |
| std_rotationY4.ts | 103.10 kB ( |
| std_rotationZ4.ts | 103.10 kB ( |
| std_identity2.ts | 103.09 kB ( |
| std_identity3.ts | 103.09 kB ( |
| std_identity4.ts | 103.09 kB ( |
| std_scaling4.ts | 103.09 kB ( |
| d_isBuiltin.ts | 87.37 kB ( |
| d_sizeOf.ts | 87.36 kB ( |
| d_isContiguous.ts | 87.37 kB ( |
| d_getLongestContiguousPrefix.ts | 87.38 kB ( |
| d_arrayOf.ts | 87.36 kB ( |
| d_size.ts | 87.36 kB ( |
| d_align.ts | 87.36 kB ( |
| d_location.ts | 87.36 kB ( |
| d_interpolate.ts | 87.37 kB ( |
| d_invariant.ts | 87.37 kB ( |
| d_mat4x4f.ts | 87.36 kB ( |
| d_mat2x2f.ts | 87.36 kB ( |
| d_mat3x3f.ts | 87.36 kB ( |
| d_matToArray.ts | 87.37 kB ( |
| d_builtin.ts | 87.36 kB ( |
| std_unpack2x16float.ts | 103.10 kB ( |
| std_unpack4x8unorm.ts | 103.10 kB ( |
| std_pack2x16float.ts | 103.10 kB ( |
| std_pack4x8unorm.ts | 103.10 kB ( |
| std_bitcastU32toF32.ts | 103.10 kB ( |
| std_bitcastU32toI32.ts | 103.10 kB ( |
| std_neg.ts | 103.09 kB ( |
| std_bitShiftRight.ts | 103.10 kB ( |
| std_bitShiftLeft.ts | 103.10 kB ( |
| std_add.ts | 103.09 kB ( |
| std_div.ts | 103.09 kB ( |
| std_mod.ts | 103.09 kB ( |
| std_mul.ts | 103.09 kB ( |
| std_sub.ts | 103.09 kB ( |
| std_translate4.ts | 103.10 kB ( |
| std_rotateX4.ts | 103.09 kB ( |
| std_scale4.ts | 103.09 kB ( |
| std_rotateY4.ts | 103.09 kB ( |
| std_rotateZ4.ts | 103.09 kB ( |
| d_memoryLayoutOf.ts | 87.37 kB ( |
| std_and.ts | 103.09 kB ( |
| std_or.ts | 103.09 kB ( |
| std_select.ts | 103.09 kB ( |
| std_allEq.ts | 103.09 kB ( |
| std_all.ts | 103.09 kB ( |
| std_not.ts | 103.09 kB ( |
| std_eq.ts | 103.09 kB ( |
| std_lt.ts | 103.09 kB ( |
| std_ne.ts | 103.09 kB ( |
| std_isCloseTo.ts | 103.09 kB ( |
| std_any.ts | 103.09 kB ( |
| std_ge.ts | 103.09 kB ( |
| std_gt.ts | 103.09 kB ( |
| std_le.ts | 103.09 kB ( |
| std_dot4U8Packed.ts | 103.10 kB ( |
| std_length.ts | 103.09 kB ( |
| std_countTrailingZeros.ts | 103.10 kB ( |
| std_distance.ts | 103.09 kB ( |
| std_dot.ts | 103.09 kB ( |
| std_countLeadingZeros.ts | 103.10 kB ( |
| std_firstTrailingBit.ts | 103.10 kB ( |
| std_firstLeadingBit.ts | 103.10 kB ( |
| std_fract.ts | 103.09 kB ( |
| std_frexp.ts | 103.09 kB ( |
| std_modf.ts | 103.09 kB ( |
| std_quantizeToF16.ts | 103.10 kB ( |
| std_mix.ts | 103.09 kB ( |
| std_countOneBits.ts | 103.10 kB ( |
| std_dot4I8Packed.ts | 103.10 kB ( |
| std_determinant.ts | 103.10 kB ( |
| std_extractBits.ts | 103.10 kB ( |
| std_faceForward.ts | 103.10 kB ( |
| std_inverseSqrt.ts | 103.10 kB ( |
| std_reverseBits.ts | 103.10 kB ( |
| std_insertBits.ts | 103.10 kB ( |
| std_smoothstep.ts | 103.10 kB ( |
| std_normalize.ts | 103.09 kB ( |
| std_transpose.ts | 103.09 kB ( |
| std_saturate.ts | 103.09 kB ( |
| std_degrees.ts | 103.09 kB ( |
| std_radians.ts | 103.09 kB ( |
| std_reflect.ts | 103.09 kB ( |
| std_refract.ts | 103.09 kB ( |
| std_acosh.ts | 103.09 kB ( |
| std_asinh.ts | 103.09 kB ( |
| std_atan2.ts | 103.09 kB ( |
| std_atanh.ts | 103.09 kB ( |
| std_clamp.ts | 103.09 kB ( |
| std_cross.ts | 103.09 kB ( |
| std_floor.ts | 103.09 kB ( |
| std_ldexp.ts | 103.09 kB ( |
| std_round.ts | 103.09 kB ( |
| std_trunc.ts | 103.09 kB ( |
| std_acos.ts | 103.09 kB ( |
| std_asin.ts | 103.09 kB ( |
| std_atan.ts | 103.09 kB ( |
| std_ceil.ts | 103.09 kB ( |
| std_cosh.ts | 103.09 kB ( |
| std_exp2.ts | 103.09 kB ( |
| std_log2.ts | 103.09 kB ( |
| std_sign.ts | 103.09 kB ( |
| std_sinh.ts | 103.09 kB ( |
| std_sqrt.ts | 103.09 kB ( |
| std_step.ts | 103.09 kB ( |
| std_tanh.ts | 103.09 kB ( |
| std_abs.ts | 103.09 kB ( |
| std_cos.ts | 103.09 kB ( |
| std_exp.ts | 103.09 kB ( |
| std_fma.ts | 103.09 kB ( |
| std_log.ts | 103.09 kB ( |
| std_max.ts | 103.09 kB ( |
| std_min.ts | 103.09 kB ( |
| std_pow.ts | 103.09 kB ( |
| std_sin.ts | 103.09 kB ( |
| std_tan.ts | 103.09 kB ( |
| common_fullScreenTriangle.ts | 56.66 kB ( |
| common_writeSoA.ts | 56.65 kB ( |
| STATIC_allImports.ts | 286.46 kB ( |
| STATIC_d.ts | 87.36 kB ( |
| STATIC_std.ts | 103.08 kB ( |
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
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.87, 1.97, 3.51, 5.54, 6.66, 9.05, 19.20, 21.88]
line [0.87, 1.80, 3.60, 5.73, 6.28, 10.51, 20.08, 20.86]
line [0.81, 1.67, 3.58, 5.57, 6.26, 9.60, 19.02, 21.19]
---
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.32, 0.63, 0.89, 0.82, 1.06, 1.14, 1.37, 1.45]
line [0.33, 0.51, 0.70, 0.76, 1.03, 1.07, 1.28, 1.48]
line [0.32, 0.51, 0.63, 0.77, 0.97, 1.00, 1.26, 1.34]
---
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.72, 1.84, 3.39, 5.58, 10.75, 22.81, 50.12, 98.88]
line [0.85, 1.93, 3.80, 5.76, 10.98, 22.95, 48.41, 99.54]
line [0.76, 1.70, 2.92, 5.42, 10.29, 21.90, 47.50, 97.10]
|
2f0da2f to
ea6bc46
Compare
1ef6b9a to
82d6c38
Compare
There was a problem hiding this comment.
Pull request overview
This PR reorganizes the typegpu test suite by separating “internal” tests (which import from src/** internals) from public API tests (which import from typegpu, typegpu/data, typegpu/std, etc.), while also aligning compiled writer behavior with the non-compiled path (fail early on runtime-sized array schemas).
Changes:
- Updated most tests to import exclusively from the public entrypoints (
typegpu,typegpu/data,typegpu/std,typegpu/common). - Moved a set of internal/whitebox tests (e.g.
connectAttributesToShader, query set internals, vertex attribute utility types, render pipeline internals) intopackages/typegpu/tests/internal/**. - Added an early error in
buildWriter()for runtime-sized array/disarray schemas (matching the non-compiled writer behavior).
Reviewed changes
Copilot reviewed 159 out of 160 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/typegpu/tests/wgpuMatrixIntegration.test.ts | Switches data imports to the public typegpu/data entrypoint. |
| packages/typegpu/tests/vertexLayout.test.ts | Keeps public vertexLayout behavior tests; moves type-level/internal tests out. |
| packages/typegpu/tests/vector.test.ts | Migrates IO/helpers to public typegpu APIs (readFromArrayBuffer/writeToArrayBuffer). |
| packages/typegpu/tests/variable.test.ts | Uses public exports for TgpuVar / VariableScope. |
| packages/typegpu/tests/unstruct.test.ts | Migrates IO to public ArrayBuffer IO helpers and public data entrypoint. |
| packages/typegpu/tests/unroll.test.ts | Updates imports to public entrypoints. |
| packages/typegpu/tests/unplugin/autoname.test.ts | Refactors autoname assertions away from internal getName to public observable behavior. |
| packages/typegpu/tests/tgslFn.test.ts | Uses public entrypoints; asserts names via resolved WGSL output. |
| packages/typegpu/tests/tgsl/wgslGenerator.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/typeInference.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/ternaryOperator.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/shellless.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/rawCodeSnippet.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/operatorOverloads.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/nameClashes.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/multiplication.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/memberAccess.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/infixOperators.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/extensionEnabled.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/entryFnParamPruning.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/conversion.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/consoleLog.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/comptime.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/codeGen.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/assignment.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgsl/argumentOrigin.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/tgpuGenericFn.test.ts | Updates imports to public entrypoints. |
| packages/typegpu/tests/texture.test.ts | Updates to public types/entrypoints; switches name assertions to runtime labels. |
| packages/typegpu/tests/swizzleMixedValidation.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/struct.test.ts | Migrates IO to ArrayBuffer helpers and public typegpu/std imports. |
| packages/typegpu/tests/std/texture/textureSample.test.ts | Uses public typegpu/std + public tgpu.fn/layout helpers. |
| packages/typegpu/tests/std/texture/textureLoad.test.ts | Uses public typegpu/std and tgpu.resolve. |
| packages/typegpu/tests/std/texture/textureGather.test.ts | Uses public typegpu/std and tgpu.resolve. |
| packages/typegpu/tests/std/range.test.ts | Collapses imports to typegpu public exports. |
| packages/typegpu/tests/std/packing.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/sub.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/smoothstep.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/sign.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/round.test.ts | Uses public typegpu. |
| packages/typegpu/tests/std/numeric/reflect.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/pow.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/normalize.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/mul.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/modf.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/mod.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/mix.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/min.test.ts | Uses public typegpu. |
| packages/typegpu/tests/std/numeric/max.test.ts | Uses public typegpu. |
| packages/typegpu/tests/std/numeric/log2.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/log.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/length.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/frexp.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/fract.test.ts | Uses public typegpu/std. |
| packages/typegpu/tests/std/numeric/exp2.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/dot.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/div.test.ts | Uses public typegpu and typegpu/std. |
| packages/typegpu/tests/std/numeric/distance.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/cross.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/cosh.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/bitShift.test.ts | Uses public entrypoints and adjusts test scaffolding. |
| packages/typegpu/tests/std/numeric/atan2.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/asin.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/add.test.ts | Uses public typegpu/data and typegpu/std; updates type inference assertions. |
| packages/typegpu/tests/std/numeric/acosh.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/numeric/acos.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/matrix/translate.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/matrix/scale.test.ts | Uses public typegpu/data and typegpu/std. |
| packages/typegpu/tests/std/matrix/rotate.test.ts | Uses public typegpu/std matrix exports. |
| packages/typegpu/tests/std/copy.test.ts | Uses public typegpu. |
| packages/typegpu/tests/std/boolean/select.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/boolean/or.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/boolean/not.test.ts | Uses public typegpu/std + typegpu. |
| packages/typegpu/tests/std/boolean/ne.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/boolean/lt.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/boolean/le.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/boolean/isCloseTo.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/boolean/gt.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/boolean/ge.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/boolean/eq.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/boolean/any.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/boolean/and.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/boolean/allEq.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/boolean/all.test.ts | Uses public typegpu/std + typegpu/data. |
| packages/typegpu/tests/std/bitcast.test.ts | Uses public typegpu/data + typegpu. |
| packages/typegpu/tests/slot.test.ts | Migrates naming assertions to toString()/tgpu.resolve. |
| packages/typegpu/tests/size.test.ts | Uses tgpu.resolve instead of internal resolution context. |
| packages/typegpu/tests/simulate.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/root.test.ts | Updates imports to typegpu/typegpu/data. |
| packages/typegpu/tests/renderPipeline.test.ts | Removes internal-only assertions; keeps public-facing behavior tests. |
| packages/typegpu/tests/ref.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/rawFn.test.ts | Migrates naming assertion to resolved WGSL output. |
| packages/typegpu/tests/querySet.test.ts | Switches naming assertion to underlying WebGPU label; moves internals to internal tests. |
| packages/typegpu/tests/primitiveCast.test.ts | Updates import to typegpu/data. |
| packages/typegpu/tests/pipeline-resolution.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/offsetUtils.test.ts | Uses public entrypoints for size/layout helpers. |
| packages/typegpu/tests/numeric.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/namespace.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/mutabilityTracking.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/matrix.test.ts | Migrates IO to ArrayBuffer helpers and public std imports. |
| packages/typegpu/tests/location.test.ts | Uses tgpu.resolve instead of internal resolution context. |
| packages/typegpu/tests/lazy.test.ts | Updates imports to public entrypoints. |
| packages/typegpu/tests/jsMath.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/isContiguous.test.ts | Updates import to typegpu/data. |
| packages/typegpu/tests/invariant.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/interpolate.test.ts | Uses tgpu.resolve instead of internal resolution context. |
| packages/typegpu/tests/internal/vertexAttribute.test.ts | New internal type-level tests for ArrayToContainedAttribs. |
| packages/typegpu/tests/internal/utilityTypes.test.ts | Fixes internal import path after test split. |
| packages/typegpu/tests/internal/textureFormats.test.ts | Fixes internal import paths after test split. |
| packages/typegpu/tests/internal/schemaCallWrapper.test.ts | New internal tests for schema call wrapper behavior. |
| packages/typegpu/tests/internal/resolve.test.ts | Adjusts internal imports for resolve/name meta tests. |
| packages/typegpu/tests/internal/renderPipeline.test.ts | New internal tests for render pipeline internals and matchUpVaryingLocations. |
| packages/typegpu/tests/internal/querySet.test.ts | New internal tests covering query set internal buffer lifecycle. |
| packages/typegpu/tests/internal/partialIo.test.ts | Uses public typegpu/data for schemas; keeps internal impl import for patch logic. |
| packages/typegpu/tests/internal/partialIo.noEval.test.ts | Updates mock pathing + public data imports. |
| packages/typegpu/tests/internal/mathUtils.test.ts | Fixes internal import path. |
| packages/typegpu/tests/internal/limitsOverflow.test.ts | Uses public typegpu and internal warnIfOverflow. |
| packages/typegpu/tests/internal/ioSchema.test.ts | Uses public typegpu/data schemas with internal IO schema helpers. |
| packages/typegpu/tests/internal/indentController.test.ts | Fixes internal import path. |
| packages/typegpu/tests/internal/gpuValueOf.test.ts | Uses public typegpu/typegpu/data with internal type import. |
| packages/typegpu/tests/internal/function.test.ts | New internal tests for InferIO and InheritArgNames. |
| packages/typegpu/tests/internal/extractArgs.test.ts | Fixes internal import path. |
| packages/typegpu/tests/internal/externals.test.ts | Uses public typegpu/data schemas with internal externals helpers. |
| packages/typegpu/tests/internal/connectAttributesToShader.test.ts | New internal tests for connectAttributesToShader. |
| packages/typegpu/tests/internal/computePipeline.test.ts | New internal tests for compute pipeline internals (timestamp writes/perf callbacks). |
| packages/typegpu/tests/internal/compiledIO.test.ts | Uses public data/sizeOf while testing internal compiled IO helpers. |
| packages/typegpu/tests/internal/builtin.test.ts | New internal test for OmitBuiltins type behavior. |
| packages/typegpu/tests/internal/buffer.test.ts | New internal tests for type-level buffer/uniform schema validation and patch typing. |
| packages/typegpu/tests/internal/bindGroupLayout.test.ts | New internal tests for UnwrapRuntimeConstructor type. |
| packages/typegpu/tests/internal/autoname.test.ts | New internal test that still asserts internal getName behavior for query sets. |
| packages/typegpu/tests/infixOperators.test.ts | Uses public typegpu/std boolean helpers. |
| packages/typegpu/tests/indent.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/guardedComputePipeline.test.ts | Uses public tgpu.bindGroupLayout and asserts naming via underlying label. |
| packages/typegpu/tests/getLongestContiguousPrefix.test.ts | Updates import to typegpu/data. |
| packages/typegpu/tests/functionTagged.test.ts | Updates imports to public entrypoints. |
| packages/typegpu/tests/function.test.ts | Uses public entrypoints; moves internal type-level tests out. |
| packages/typegpu/tests/entryFnHeaderGen.test.ts | Updates imports to public entrypoints. |
| packages/typegpu/tests/entryFnBuiltinArgs.test.ts | Updates imports to public entrypoints. |
| packages/typegpu/tests/disarray.test.ts | Migrates IO to ArrayBuffer helpers and public data entrypoint. |
| packages/typegpu/tests/declare.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/data/ptr.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/data/deepEqual.test.ts | Uses public exports for ptr helpers. |
| packages/typegpu/tests/data/atomic.test.ts | Updates import to typegpu/data. |
| packages/typegpu/tests/constant.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/computePipeline.test.ts | Keeps public behavior tests; moves internal/perf callback coverage out. |
| packages/typegpu/tests/builtin.test.ts | Keeps public builtin behavior test using tgpu.resolve. |
| packages/typegpu/tests/bufferUsage.test.ts | Uses public Infer from typegpu/data. |
| packages/typegpu/tests/bufferShorthands.test.ts | Uses public entrypoints. |
| packages/typegpu/tests/buffer.test.ts | Uses public entrypoints; removes internal-only type-level tests moved to internal suite. |
| packages/typegpu/tests/bindGroupLayout.test.ts | Uses public entrypoints; adjusts expectations to match updated mocks/error formatting. |
| packages/typegpu/tests/attributes.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/arrayBufferIO.test.ts | Simplifies test to public ArrayBuffer IO APIs. |
| packages/typegpu/tests/array.test.ts | Migrates IO to ArrayBuffer helpers and uses tgpu.resolve for runtime-sized array codegen check. |
| packages/typegpu/tests/align.test.ts | Updates import to typegpu. |
| packages/typegpu/tests/accessor.test.ts | Updates import to typegpu. |
| packages/typegpu/src/data/compiledIO.ts | Adds early throw when compiling a writer for runtime-sized array/disarray schemas. |
| packages/typegpu/src/core/texture/texture.ts | Adds toString() to the TgpuTextureView interface (aligning with tests using stringification). |
| packages/typegpu/src/core/slot/slotTypes.ts | Adds toString() to TgpuAccessor interface. |
| packages/typegpu/src/core/sampler/sampler.ts | Adds toString() to sampler interfaces. |
| packages/typegpu-testing-utility/src/extendedIt.ts | Updates texture view mock + compute pipeline mock behavior for the new/updated tests. |
| apps/typegpu-docs/tests/individual-example-tests/utils/commonMocks.ts | Provides non-empty mock model attribute buffers for docs example tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — 160 files, splitting the test suite into public (import from 'typegpu' built package) and internal (import from source '../../src/...') layers. Internal tests that access $internal, private types, or unexported utilities were moved to packages/typegpu/tests/internal/.
- Imports flipped to
'typegpu'— all public tests now import from the built package ('typegpu','typegpu/data','typegpu/std','typegpu/common') instead of relative source paths, consuming only the public API. - Internal tests extracted — suites relying on
$internal,UnwrapRuntimeConstructor,IsValidBufferSchema,InferPatch,matchUpVaryingLocations,OmitBuiltins, and performance-callback/timestamp internals moved into newinternal/files with source imports. - Mock layer updated —
createTextureMock.createViewreturns{ label }instead of'view';createComputePipelinemock inlined. - API surface tightened —
readData/writeDatareplaced withreadFromArrayBuffer/writeToArrayBuffer;TypedArray→ArrayBufferView;ExperimentalTgpuRoot→TgpuRoot. toString()added toTgpuSampler,TgpuComparisonSampler,TgpuAccessor,TgpuTextureView.- Early error in
compiledIO.tsfor runtime-sized array writers.
All deleted test suites were verified as present in their new internal locations — no coverage gaps.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
7db90a4 to
7f4fed2
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — force-pushed branch with two commits: an early-error guard in compiledIO.ts for runtime-sized array writers, and the full test suite restructure splitting tests into public ('typegpu' imports) and internal ('../../src/...' imports) layers.
toString()interface additions — added toTgpuSampler,TgpuComparisonSampler,TgpuAccessor,TgpuTextureView; all already implemented by concrete classes, so this is purely type-level documentation.- Mock fidelity improvements —
createTextureMock: renamedwithtowidth(the former was a typo),createViewreturns{ label }instead of'view'.createQuerySetrewritten fromObject.createprototype sharing to independentGPUQuerySetfactory objects. Label defaults aligned with WebGPU spec (''instead of'<unnamed>'). compiledIO.tsearly error —buildWriterthrows'Cannot write using a runtime-sized schema.'whenelementCount === 0, matching the guard already present in the non-compileddataIO.tspath.- Import path modernization — all public tests now import from package entry points (
'typegpu','typegpu/data','typegpu/std','typegpu/common'); internal tests import source paths via'../../src/...'. - Assertion strategy —
getName()(internal) replaced across public tests withtgpu.resolve(),root.unwrap().label,toString(), or error-based assertions, removing all internal API consumption from the public test suite. - Test relocation — internal-type tests moved to
tests/internal/*.ts(performance callbacks, timestamp writes,matchUpVaryingLocations,connectAttributesToShader,UnwrapRuntimeConstructor,IsValidBufferSchema/IsValidUniformSchema,InferPatch,InferIO). All moved tests have equivalent assertions with no coverage loss. - Autoname test rewrite —
unplugin/autoname.test.tsno longer importsgetName; naming verified through WGSL resolution, WebGPU labels,toString(), and error messages. - Docs mock fix —
commonMocks.tsprovides non-empty geometry data so model-loading tests don't pass vacuously.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
7f4fed2 to
fe70f18
Compare
fe70f18 to
ae00d29
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — Rebased branch: the compiledIO.ts early-error guard and testing-utility mock changes were merged to main via #2642 and #2644 and are no longer carried here; the remaining diff tightens a few public interfaces and completes the public/internal test split.
- Rebased onto current
main— the previously carried runtime-sized-array writer guard and mock label/texture-view changes moved out as separate merged PRs. - Added
toString()to public GPU-object interfaces —TgpuSampler,TgpuComparisonSampler,TgpuAccessor, andTgpuTextureViewnow declare the method, matching their existing concrete implementations. - Split tests into public and internal suites — public tests import from
'typegpu'/'typegpu/data'/'typegpu/std'/'typegpu/common'; internal tests live underpackages/typegpu/tests/internal/and import from source paths.
Verified pnpm --filter typegpu test:types and pnpm vitest run --project=!browser packages/typegpu/tests/ both pass.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
aleksanderkatan
left a comment
There was a problem hiding this comment.
Great work! Those aren't yet run on the built package, right?
| @@ -1,5 +1,5 @@ | |||
| import { describe, expect, expectTypeOf, it } from 'vitest'; | |||
| import * as d from '../../src/data/index.ts'; | |||
| import * as d from 'typegpu/data'; | |||
There was a problem hiding this comment.
Is this import intentionally like this instead of import { d } from 'typegpu';? Will we refactor this in an upcoming PR?
There was a problem hiding this comment.
Many of these tests could be run on the built package
There was a problem hiding this comment.
I'm not sure if I like what happened to this test. We plan on making getName public, right? Can we revert to its original state and put it in internals, with TODO to move it back here?
|
|
||
| writeData(new BufferWriter(buffer), d.vec2f, vec); | ||
| expect(readData(new BufferReader(buffer), d.vec2f)).toStrictEqual(vec); | ||
| writeToArrayBuffer(buffer, d.vec2f, vec); |
There was a problem hiding this comment.
All these tests now use compiled writers instead of writeData, though I guess it's alright

Blocked by #2642