typegpu 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/chunk-3K53YJSU.cjs +10 -0
  2. package/chunk-3K53YJSU.cjs.map +1 -0
  3. package/chunk-BF35NEOX.cjs +43 -0
  4. package/chunk-BF35NEOX.cjs.map +1 -0
  5. package/chunk-IH2QU6TV.js +43 -0
  6. package/chunk-IH2QU6TV.js.map +1 -0
  7. package/chunk-S27MYQ6U.js +10 -0
  8. package/chunk-S27MYQ6U.js.map +1 -0
  9. package/data/index.cjs +1 -1
  10. package/data/index.cjs.map +1 -1
  11. package/data/index.d.cts +3 -3
  12. package/data/index.d.ts +3 -3
  13. package/data/index.js +1 -1
  14. package/index.cjs +18 -29
  15. package/index.cjs.map +1 -1
  16. package/index.d.cts +38 -3
  17. package/index.d.ts +38 -3
  18. package/index.js +18 -29
  19. package/index.js.map +1 -1
  20. package/{matrix-S8W4dk8I.d.ts → matrix-BXuR-7-A.d.ts} +1 -1
  21. package/{matrix-BN6ObiMv.d.cts → matrix-DzXuhOr3.d.cts} +1 -1
  22. package/package.json +1 -1
  23. package/std/index.cjs +1 -1
  24. package/std/index.cjs.map +1 -1
  25. package/std/index.d.cts +22 -9
  26. package/std/index.d.ts +22 -9
  27. package/std/index.js +1 -1
  28. package/std/index.js.map +1 -1
  29. package/{tgpuComputeFn-DOUjhQua.d.ts → tgpuConstant-BAmV6caN.d.cts} +3171 -2970
  30. package/{tgpuComputeFn-DOUjhQua.d.cts → tgpuConstant-BAmV6caN.d.ts} +3171 -2970
  31. package/chunk-APTRHY5Y.js +0 -41
  32. package/chunk-APTRHY5Y.js.map +0 -1
  33. package/chunk-RC26P3MP.cjs +0 -2
  34. package/chunk-RC26P3MP.cjs.map +0 -1
  35. package/chunk-RK6TMFVW.js +0 -2
  36. package/chunk-RK6TMFVW.js.map +0 -1
  37. package/chunk-S62QJDM6.js +0 -2
  38. package/chunk-S62QJDM6.js.map +0 -1
  39. package/chunk-TG4A6AM3.cjs +0 -2
  40. package/chunk-TG4A6AM3.cjs.map +0 -1
  41. package/chunk-UMHCZDPA.cjs +0 -41
  42. package/chunk-UMHCZDPA.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../package.json","../src/shared/symbols.ts","../src/shared/env.ts","../src/shared/meta.ts","../src/errors.ts","../src/core/slot/slotTypes.ts","../src/data/wgslTypes.ts","../src/types.ts","../src/execMode.ts","../src/core/function/dualImpl.ts","../src/data/decorateUtils.ts","../src/data/snippet.ts","../src/data/numeric.ts","../src/data/vectorImpl.ts","../src/data/vector.ts","../src/data/matrix.ts","../src/data/numberOps.ts","../src/data/vectorOps.ts","../src/std/numeric.ts","../src/data/ptr.ts"],"sourcesContent":["{\n \"name\": \"typegpu\",\n \"private\": true,\n \"version\": \"0.7.0\",\n \"description\": \"A thin layer between JS and WebGPU/WGSL that improves development experience and allows for faster iteration.\",\n \"license\": \"MIT\",\n \"type\": \"module\",\n \"exports\": {\n \"./package.json\": \"./package.json\",\n \".\": \"./src/index.ts\",\n \"./data\": \"./src/data/index.ts\",\n \"./std\": \"./src/std/index.ts\"\n },\n \"publishConfig\": {\n \"directory\": \"dist\",\n \"linkDirectory\": false,\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \"./package.json\": \"./dist/package.json\",\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"module\": \"./dist/index.js\",\n \"import\": \"./dist/index.js\",\n \"default\": \"./dist/index.cjs\"\n },\n \"./data\": {\n \"types\": \"./dist/data/index.d.ts\",\n \"module\": \"./dist/data/index.js\",\n \"import\": \"./dist/data/index.js\",\n \"default\": \"./dist/data/index.cjs\"\n },\n \"./std\": {\n \"types\": \"./dist/std/index.d.ts\",\n \"module\": \"./dist/std/index.js\",\n \"import\": \"./dist/std/index.js\",\n \"default\": \"./dist/std/index.cjs\"\n }\n }\n },\n \"sideEffects\": false,\n \"scripts\": {\n \"build\": \"tsup\",\n \"test:types\": \"pnpm tsc --p ./tsconfig.test.json --noEmit\",\n \"prepublishOnly\": \"tgpu-dev-cli prepack\"\n },\n \"engines\": {\n \"node\": \">=12.20.0\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/software-mansion/TypeGPU.git\"\n },\n \"keywords\": [\n \"webgpu\",\n \"wgpu\",\n \"wgsl\",\n \"typescript\",\n \"compute\",\n \"shader\",\n \"shaders\",\n \"gpgpu\"\n ],\n \"bugs\": {\n \"url\": \"https://github.com/software-mansion/TypeGPU/issues\"\n },\n \"homepage\": \"https://typegpu.com\",\n \"devDependencies\": {\n \"@ark/attest\": \"^0.46.0\",\n \"@typegpu/tgpu-dev-cli\": \"workspace:*\",\n \"@webgpu/types\": \"catalog:types\",\n \"arktype\": \"catalog:\",\n \"jiti\": \"catalog:build\",\n \"tsup\": \"catalog:build\",\n \"typescript\": \"catalog:types\",\n \"unplugin-typegpu\": \"workspace:*\",\n \"wesl\": \"0.6.7\",\n \"wgpu-matrix\": \"catalog:example\"\n },\n \"packageManager\": \"pnpm@10.4.1+sha512.c753b6c3ad7afa13af388fa6d808035a008e30ea9993f58c6663e2bc5ff21679aa834db094987129aa4d488b86df57f7b634981b2f827cdcacc698cc0cfb88af\",\n \"dependencies\": {\n \"tinyest\": \"workspace:~0.1.1\",\n \"typed-binary\": \"^4.3.1\"\n }\n}\n","// The version is inlined during build-time 🎉\n// It helps us identify problems when two versions of\n// TypeGPU are used at the same time.\nimport { version } from '../../package.json';\n\nexport const $internal = Symbol(`typegpu:${version}:$internal`);\n/**\n * A value's data type as seen by the WGSL generator\n */\nexport const $wgslDataType = Symbol(`typegpu:${version}:$wgslDataType`);\n/**\n * The getter to the value of this resource, accessible on the GPU\n */\nexport const $gpuValueOf = Symbol(`typegpu:${version}:$gpuValueOf`);\nexport const $getNameForward = Symbol(`typegpu:${version}:$getNameForward`);\n/**\n * Marks an object with slot-value bindings\n */\nexport const $providing = Symbol(`typegpu:${version}:$providing`);\n\n//\n// Type tokens\n//\n\n/**\n * Type token for the inferred (CPU & GPU) representation of a resource\n */\nexport const $repr = Symbol(`typegpu:${version}:$repr`);\n/**\n * Type token for the inferred (GPU-side) representation of a resource\n * If present, it shadows the value of `$repr` for GPU-side inference.\n */\nexport const $gpuRepr = Symbol(`typegpu:${version}:$gpuRepr`);\n/**\n * Type token for the inferred partial representation of a resource.\n * If present, it shadows the value of `$repr` for use in partial IO.\n */\nexport const $reprPartial = Symbol(`typegpu:${version}:$reprPartial`);\n/**\n * Type token holding schemas that are identical in memory layout.\n */\nexport const $memIdent = Symbol(`typegpu:${version}:$memIdent`);\n\n/**\n * Type token, signaling that a schema can be used in a storage buffer.\n */\nexport const $validStorageSchema = Symbol(\n `typegpu:${version}:$invalidStorageSchema`,\n);\n/**\n * Type token, signaling that a schema can be used in a uniform buffer.\n */\nexport const $validUniformSchema = Symbol(\n `typegpu:${version}:$validUniformSchema`,\n);\n/**\n * Type token, signaling that a schema can be used in a vertex buffer.\n */\nexport const $validVertexSchema = Symbol(\n `typegpu:${version}:$validVertexSchema`,\n);\n/**\n * Type token, containing a reason for why the schema is invalid (if it is).\n */\nexport const $invalidSchemaReason = Symbol(\n `typegpu:${version}:$invalidSchemaReason`,\n);\n","/**\n * This can be used to branch functionality between \"dev\" and \"prod\" modes, so that our\n * library can omit doing unnecessary work once it's out in the wild\n *\n * Even though the value of this constant uses Node.js specific APIs, pretty much every\n * bundler replaces the expression below with either `development` or `production`\n */\nexport const DEV = globalThis.process.env.NODE_ENV === 'development';\n\nexport const TEST = globalThis.process.env.NODE_ENV === 'test';\n","import type { Block, FuncParameter } from 'tinyest';\nimport { $getNameForward, $internal } from './symbols.ts';\nimport { DEV, TEST } from './env.ts';\n\nexport interface MetaData {\n name?: string | undefined;\n ast?: {\n v: number;\n params: FuncParameter[];\n body: Block;\n externalNames: string[];\n } | undefined;\n externals?: Record<string, unknown> | undefined;\n}\n\n/**\n * Don't use or you WILL get fired from your job.\n *\n * The information that this type describes is additional\n * properties that we add onto `globalThis`, used by tools\n * like `unplugin-typegpu` or our test suite.\n *\n * @internal\n */\nexport type INTERNAL_GlobalExt = typeof globalThis & {\n __TYPEGPU_META__: WeakMap<object, MetaData>;\n __TYPEGPU_AUTONAME__: <T>(exp: T, label: string) => T;\n __TYPEGPU_MEASURE_PERF__?: boolean | undefined;\n __TYPEGPU_PERF_RECORDS__?: Map<string, unknown[]> | undefined;\n};\n\nObject.assign(globalThis, {\n '__TYPEGPU_AUTONAME__': <T>(exp: T, label: string): T =>\n isNamable(exp) &&\n (exp as unknown as { [$internal]: unknown })?.[$internal] && !getName(exp)\n ? exp.$name(label)\n : exp,\n});\n\nconst globalWithMeta = globalThis as INTERNAL_GlobalExt;\n\n/**\n * Performance measurements are only enabled in dev & test environments for now\n */\nexport const PERF = (DEV || TEST) && ({\n get enabled() {\n return !!globalWithMeta.__TYPEGPU_MEASURE_PERF__;\n },\n record(name: string, data: unknown) {\n // biome-ignore lint/suspicious/noAssignInExpressions: it's fine\n const records = (globalWithMeta.__TYPEGPU_PERF_RECORDS__ ??= new Map());\n let entries = records.get(name);\n if (!entries) {\n entries = [];\n records.set(name, entries);\n }\n entries.push(data);\n },\n }) || undefined;\n\nfunction isForwarded(value: unknown): value is { [$getNameForward]: unknown } {\n return !!(value as { [$getNameForward]?: unknown })?.[$getNameForward];\n}\n\nexport function getName(definition: unknown): string | undefined {\n if (isForwarded(definition)) {\n return getName(definition[$getNameForward]);\n }\n return getMetaData(definition)?.name;\n}\n\nexport function setName(definition: object, name: string): void {\n setMetaData(definition, { name });\n}\n\n/**\n * Can be assigned a name. Not to be confused with\n * being able to HAVE a name.\n * The `$name` function should use `setName` to rename the object itself,\n * or rename the object `$getNameForward` symbol points to instead if applicable.\n */\nexport interface TgpuNamable {\n $name(label: string): this;\n}\n\nexport function isNamable(value: unknown): value is TgpuNamable {\n return !!(value as TgpuNamable)?.$name;\n}\n\nexport function getMetaData(\n definition: unknown,\n): MetaData | undefined {\n return globalWithMeta.__TYPEGPU_META__.get(\n // it's fine, if it's not an object, the get will return undefined\n definition as object,\n );\n}\n\nexport function setMetaData(definition: object, metaData: object) {\n globalWithMeta.__TYPEGPU_META__ ??= new WeakMap();\n const map = globalWithMeta.__TYPEGPU_META__;\n map.set(definition, { ...map.get(definition), ...metaData });\n}\n","import type { TgpuBuffer } from './core/buffer/buffer.ts';\nimport type { TgpuSlot } from './core/slot/slotTypes.ts';\nimport type { TgpuVertexLayout } from './core/vertexLayout/vertexLayout.ts';\nimport type { AnyData, Disarray } from './data/dataTypes.ts';\nimport type { WgslArray } from './data/wgslTypes.ts';\nimport { getName } from './shared/meta.ts';\nimport { DEV } from './shared/env.ts';\nimport type { TgpuBindGroupLayout } from './tgpuBindGroupLayout.ts';\n\nconst prefix = 'Invariant failed';\n\n/**\n * Inspired by: https://github.com/alexreardon/tiny-invariant/blob/master/src/tiny-invariant.ts\n */\nexport function invariant(\n condition: unknown,\n message?: string | (() => string),\n): asserts condition {\n if (condition) {\n // Condition passed\n return;\n }\n\n // In production we strip the message but still throw\n if (!DEV) {\n throw new Error(prefix);\n }\n\n // When not in production we allow the message to pass through\n // *This block will be removed in production builds*\n\n const provided = typeof message === 'function' ? message() : message;\n\n // Options:\n // 1. message provided: `${prefix}: ${provided}`\n // 2. message not provided: prefix\n const value = provided ? `${prefix}: ${provided}` : prefix;\n throw new Error(value);\n}\n\n/**\n * An error that happens during resolution of WGSL code.\n * Contains a trace of all ancestor resolvables in\n * which this error originated.\n *\n * @category Errors\n */\nexport class ResolutionError extends Error {\n constructor(\n public readonly cause: unknown,\n public readonly trace: unknown[],\n ) {\n let entries = trace.map((ancestor) => `- ${ancestor}`);\n\n // Showing only the root and leaf nodes.\n if (entries.length > 20) {\n entries = [...entries.slice(0, 11), '...', ...entries.slice(-10)];\n }\n\n super(\n `Resolution of the following tree failed:\\n${entries.join('\\n')}: ${\n cause && typeof cause === 'object' && 'message' in cause\n ? cause.message\n : cause\n }`,\n );\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ResolutionError.prototype);\n }\n\n appendToTrace(ancestor: unknown): ResolutionError {\n const newTrace = [ancestor, ...this.trace];\n\n return new ResolutionError(this.cause, newTrace);\n }\n}\n\n/**\n * An error that happens during execution of TypeGPU functions.\n * Contains a trace of all TypeGPU functions called along the way.\n *\n * @category Errors\n */\nexport class ExecutionError extends Error {\n constructor(\n public readonly cause: unknown,\n public readonly trace: unknown[],\n ) {\n let entries = trace.map((ancestor) => `- ${ancestor}`);\n\n // Showing only the root and leaf nodes.\n if (entries.length > 20) {\n entries = [...entries.slice(0, 11), '...', ...entries.slice(-10)];\n }\n\n super(\n `Execution of the following tree failed:\\n${entries.join('\\n')}: ${\n cause && typeof cause === 'object' && 'message' in cause\n ? cause.message\n : cause\n }`,\n );\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ExecutionError.prototype);\n }\n\n appendToTrace(ancestor: unknown): ExecutionError {\n const newTrace = [ancestor, ...this.trace];\n\n return new ExecutionError(this.cause, newTrace);\n }\n}\n\n/**\n * @category Errors\n */\nexport class MissingSlotValueError extends Error {\n constructor(public readonly slot: TgpuSlot<unknown>) {\n super(`Missing value for '${slot}'`);\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, MissingSlotValueError.prototype);\n }\n}\n\n/**\n * @category Errors\n */\nexport class NotUniformError extends Error {\n constructor(value: TgpuBuffer<AnyData>) {\n super(\n `Buffer '${\n getName(value) ?? '<unnamed>'\n }' is not bindable as a uniform. Use .$usage('uniform') to allow it.`,\n );\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, NotUniformError.prototype);\n }\n}\n\nexport class MissingLinksError extends Error {\n constructor(fnLabel: string | undefined, externalNames: string[]) {\n super(\n `The function '${\n fnLabel ?? '<unnamed>'\n }' is missing links to the following external values: ${externalNames}.`,\n );\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, MissingLinksError.prototype);\n }\n}\n\nexport class MissingBindGroupsError extends Error {\n constructor(layouts: Iterable<TgpuBindGroupLayout>) {\n super(\n `Missing bind groups for layouts: '${\n [...layouts].map((layout) => getName(layout) ?? '<unnamed>').join(', ')\n }'. Please provide it using pipeline.with(layout, bindGroup).(...)`,\n );\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, MissingBindGroupsError.prototype);\n }\n}\n\nexport class MissingVertexBuffersError extends Error {\n constructor(layouts: Iterable<TgpuVertexLayout<WgslArray | Disarray>>) {\n super(\n `Missing vertex buffers for layouts: '${\n [...layouts].map((layout) => getName(layout) ?? '<unnamed>').join(', ')\n }'. Please provide it using pipeline.with(layout, buffer).(...)`,\n );\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, MissingVertexBuffersError.prototype);\n }\n}\n\nexport class IllegalVarAccessError extends Error {\n constructor(msg: string) {\n super(msg);\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, IllegalVarAccessError.prototype);\n }\n}\n\nexport class IllegalBufferAccessError extends Error {\n constructor(msg: string) {\n super(msg);\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, IllegalBufferAccessError.prototype);\n }\n}\n\nexport class WgslTypeError extends Error {\n constructor(msg: string) {\n super(msg);\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, WgslTypeError.prototype);\n }\n}\n","import type { AnyData } from '../../data/dataTypes.ts';\nimport type { TgpuNamable } from '../../shared/meta.ts';\nimport type { Infer, InferGPU } from '../../shared/repr.ts';\nimport {\n $gpuRepr,\n $internal,\n $providing,\n $repr,\n} from '../../shared/symbols.ts';\nimport type { TgpuFn } from '../function/tgpuFn.ts';\nimport type { TgpuBufferUsage } from './../buffer/bufferUsage.ts';\n\nexport interface TgpuSlot<T> extends TgpuNamable {\n readonly [$internal]: true;\n readonly resourceType: 'slot';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: Infer<T>;\n readonly [$gpuRepr]: InferGPU<T>;\n // ---\n\n readonly defaultValue: T | undefined;\n\n /**\n * Used to determine if code generated using either value `a` or `b` in place\n * of the slot will be equivalent. Defaults to `Object.is`.\n */\n areEqual(a: T, b: T): boolean;\n\n readonly value: InferGPU<T>;\n readonly $: InferGPU<T>;\n}\n\nexport interface TgpuDerived<T> {\n readonly resourceType: 'derived';\n readonly value: InferGPU<T>;\n readonly $: InferGPU<T>;\n\n // Type-tokens, not available at runtime\n readonly [$repr]: Infer<T>;\n readonly [$gpuRepr]: InferGPU<T>;\n readonly [$providing]?: Providing | undefined;\n // ---\n\n with<TValue>(slot: TgpuSlot<TValue>, value: Eventual<TValue>): TgpuDerived<T>;\n\n /**\n * @internal\n */\n '~compute'(): T;\n}\n\nexport interface TgpuAccessor<T extends AnyData = AnyData> extends TgpuNamable {\n readonly [$internal]: true;\n readonly resourceType: 'accessor';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: Infer<T>;\n readonly [$gpuRepr]: InferGPU<T>;\n // ---\n\n readonly schema: T;\n readonly defaultValue:\n | TgpuFn<() => T>\n | TgpuBufferUsage<T>\n | Infer<T>\n | undefined;\n readonly slot: TgpuSlot<TgpuFn<() => T> | TgpuBufferUsage<T> | Infer<T>>;\n\n readonly value: InferGPU<T>;\n readonly $: InferGPU<T>;\n}\n\n/**\n * Represents a value that is available at resolution time.\n */\nexport type Eventual<T> = T | TgpuSlot<T> | TgpuDerived<T>;\n\nexport type SlotValuePair<T = unknown> = [TgpuSlot<T>, T];\n\nexport type Providing = {\n inner: unknown;\n pairs: SlotValuePair[];\n};\n\nexport function isSlot<T>(value: unknown | TgpuSlot<T>): value is TgpuSlot<T> {\n return (value as TgpuSlot<T>)?.resourceType === 'slot';\n}\n\nexport function isDerived<T extends TgpuDerived<unknown>>(\n value: T | unknown,\n): value is T {\n return (value as T)?.resourceType === 'derived';\n}\n\nexport function isProviding(\n value: unknown,\n): value is { [$providing]: Providing } {\n return (value as { [$providing]: Providing })?.[$providing] !== undefined;\n}\n\nexport function isAccessor<T extends AnyData>(\n value: unknown | TgpuAccessor<T>,\n): value is TgpuAccessor<T> {\n return (value as TgpuAccessor<T>)?.resourceType === 'accessor';\n}\n","import type { TgpuNamable } from '../shared/meta.ts';\nimport type {\n ExtractInvalidSchemaError,\n Infer,\n InferGPU,\n InferGPURecord,\n InferPartial,\n InferPartialRecord,\n InferRecord,\n IsValidStorageSchema,\n IsValidUniformSchema,\n IsValidVertexSchema,\n MemIdentity,\n MemIdentityRecord,\n} from '../shared/repr.ts';\nimport type {\n $gpuRepr,\n $invalidSchemaReason,\n $memIdent,\n $repr,\n $reprPartial,\n $validStorageSchema,\n $validUniformSchema,\n $validVertexSchema,\n} from '../shared/symbols.ts';\nimport { $internal, $wgslDataType } from '../shared/symbols.ts';\nimport type { Prettify, SwapNever } from '../shared/utilityTypes.ts';\n\ntype DecoratedLocation<T extends BaseData> = Decorated<T, Location[]>;\n\nexport interface BaseData {\n readonly [$internal]: true;\n readonly type: string;\n readonly [$repr]: unknown;\n}\n\nexport interface NumberArrayView {\n readonly length: number;\n [n: number]: number;\n [Symbol.iterator]: () => Iterator<number>;\n}\n\n/**\n * Vector infix notation.\n *\n * @privateRemarks\n * These functions are not defined on vectors,\n * but are instead assigned to `VecBase` after both `data` and `std` are initialized.\n */\nexport interface vecInfixNotation<T extends AnyNumericVecInstance> {\n add(other: number): T;\n add(other: T): T;\n\n sub(other: number): T;\n sub(other: T): T;\n\n mul(other: number): T;\n mul(other: T): T;\n mul(other: mBaseForVec<T>): T;\n\n div(other: number): T;\n div(other: T): T;\n}\n\n/**\n * Matrix infix notation.\n *\n * @privateRemarks\n * These functions are not defined on matrices,\n * but are instead assigned to `MatBase` after both `data` and `std` are initialized.\n */\nexport interface matInfixNotation<T extends AnyMatInstance> {\n add(other: T): T;\n\n sub(other: T): T;\n\n mul(other: number): T;\n mul(other: vBaseForMat<T>): vBaseForMat<T>;\n mul(other: T): T;\n}\n\nexport function hasInternalDataType(\n value: unknown,\n): value is { [$wgslDataType]: BaseData } {\n return !!(value as { [$wgslDataType]: BaseData })?.[$wgslDataType];\n}\n\n/**\n * Represents a 64-bit integer.\n */\nexport interface AbstractInt extends BaseData {\n readonly type: 'abstractInt';\n // Type-tokens, not available at runtime\n readonly [$repr]: number;\n readonly [$invalidSchemaReason]: 'Abstract numerics are not host-shareable';\n // ---\n}\n\n/**\n * Represents a 64-bit IEEE 754 floating point number.\n */\nexport interface AbstractFloat extends BaseData {\n readonly type: 'abstractFloat';\n // Type-tokens, not available at runtime\n readonly [$repr]: number;\n readonly [$invalidSchemaReason]: 'Abstract numerics are not host-shareable';\n // ---\n}\n\nexport interface Void extends BaseData {\n readonly type: 'void';\n // Type-tokens, not available at runtime\n // biome-ignore lint/suspicious/noConfusingVoidType: void is void\n readonly [$repr]: void;\n readonly [$invalidSchemaReason]: 'Void is not host-shareable';\n // ---\n}\nexport const Void = {\n [$internal]: true,\n type: 'void',\n} as Void;\n\n// #region Instance Types\n\ninterface Swizzle2<T2, T3, T4> {\n readonly xx: T2;\n readonly xy: T2;\n readonly yx: T2;\n readonly yy: T2;\n\n readonly xxx: T3;\n readonly xxy: T3;\n readonly xyx: T3;\n readonly xyy: T3;\n readonly yxx: T3;\n readonly yxy: T3;\n readonly yyx: T3;\n readonly yyy: T3;\n\n readonly xxxx: T4;\n readonly xxxy: T4;\n readonly xxyx: T4;\n readonly xxyy: T4;\n readonly xyxx: T4;\n readonly xyxy: T4;\n readonly xyyx: T4;\n readonly xyyy: T4;\n readonly yxxx: T4;\n readonly yxxy: T4;\n readonly yxyx: T4;\n readonly yxyy: T4;\n readonly yyxx: T4;\n readonly yyxy: T4;\n readonly yyyx: T4;\n readonly yyyy: T4;\n}\n\ninterface Swizzle3<T2, T3, T4> extends Swizzle2<T2, T3, T4> {\n readonly xz: T2;\n readonly yz: T2;\n readonly zx: T2;\n readonly zy: T2;\n readonly zz: T2;\n\n readonly xxz: T3;\n readonly xyz: T3;\n readonly xzx: T3;\n readonly xzy: T3;\n readonly xzz: T3;\n readonly yxz: T3;\n readonly yyz: T3;\n readonly yzx: T3;\n readonly yzy: T3;\n readonly yzz: T3;\n readonly zxx: T3;\n readonly zxy: T3;\n readonly zxz: T3;\n readonly zyx: T3;\n readonly zyy: T3;\n readonly zyz: T3;\n readonly zzx: T3;\n readonly zzy: T3;\n readonly zzz: T3;\n\n readonly xxxz: T4;\n readonly xxyz: T4;\n readonly xxzx: T4;\n readonly xxzy: T4;\n readonly xxzz: T4;\n readonly xyxz: T4;\n readonly xyyz: T4;\n readonly xyzx: T4;\n readonly xyzy: T4;\n readonly xyzz: T4;\n readonly xzxx: T4;\n readonly xzxy: T4;\n readonly xzxz: T4;\n readonly xzyx: T4;\n readonly xzyy: T4;\n readonly xzyz: T4;\n readonly xzzx: T4;\n readonly xzzy: T4;\n readonly xzzz: T4;\n readonly yxxz: T4;\n readonly yxyz: T4;\n readonly yxzx: T4;\n readonly yxzy: T4;\n readonly yxzz: T4;\n readonly yyxz: T4;\n readonly yyyz: T4;\n readonly yyzx: T4;\n readonly yyzy: T4;\n readonly yyzz: T4;\n readonly yzxx: T4;\n readonly yzxy: T4;\n readonly yzxz: T4;\n readonly yzyx: T4;\n readonly yzyy: T4;\n readonly yzyz: T4;\n readonly yzzx: T4;\n readonly yzzy: T4;\n readonly yzzz: T4;\n readonly zxxx: T4;\n readonly zxxy: T4;\n readonly zxxz: T4;\n readonly zxyx: T4;\n readonly zxyy: T4;\n readonly zxyz: T4;\n readonly zxzx: T4;\n readonly zxzy: T4;\n readonly zxzz: T4;\n readonly zyxx: T4;\n readonly zyxy: T4;\n readonly zyxz: T4;\n readonly zyyx: T4;\n readonly zyyy: T4;\n readonly zyyz: T4;\n readonly zyzx: T4;\n readonly zyzy: T4;\n readonly zyzz: T4;\n readonly zzxx: T4;\n readonly zzxy: T4;\n readonly zzxz: T4;\n readonly zzyx: T4;\n readonly zzyy: T4;\n readonly zzyz: T4;\n readonly zzzx: T4;\n readonly zzzy: T4;\n readonly zzzz: T4;\n}\n\ninterface Swizzle4<T2, T3, T4> extends Swizzle3<T2, T3, T4> {\n readonly yw: T2;\n readonly zw: T2;\n readonly wx: T2;\n readonly wy: T2;\n readonly wz: T2;\n readonly ww: T2;\n\n readonly xxw: T3;\n readonly xyw: T3;\n readonly xzw: T3;\n readonly xwx: T3;\n readonly xwy: T3;\n readonly xwz: T3;\n readonly xww: T3;\n readonly yxw: T3;\n readonly yyw: T3;\n readonly yzw: T3;\n readonly ywx: T3;\n readonly ywy: T3;\n readonly ywz: T3;\n readonly yww: T3;\n readonly zxw: T3;\n readonly zyw: T3;\n readonly zzw: T3;\n readonly zwx: T3;\n readonly zwy: T3;\n readonly zwz: T3;\n readonly zww: T3;\n readonly wxx: T3;\n readonly wxz: T3;\n readonly wxy: T3;\n readonly wyy: T3;\n readonly wyz: T3;\n readonly wzz: T3;\n readonly wwx: T3;\n readonly wwy: T3;\n readonly wwz: T3;\n readonly www: T3;\n\n readonly xxxw: T4;\n readonly xxyw: T4;\n readonly xxzw: T4;\n readonly xxwx: T4;\n readonly xxwy: T4;\n readonly xxwz: T4;\n readonly xxww: T4;\n readonly xyxw: T4;\n readonly xyyw: T4;\n readonly xyzw: T4;\n readonly xywx: T4;\n readonly xywy: T4;\n readonly xywz: T4;\n readonly xyww: T4;\n readonly xzxw: T4;\n readonly xzyw: T4;\n readonly xzzw: T4;\n readonly xzwx: T4;\n readonly xzwy: T4;\n readonly xzwz: T4;\n readonly xzww: T4;\n readonly xwxx: T4;\n readonly xwxy: T4;\n readonly xwxz: T4;\n readonly xwyy: T4;\n readonly xwyz: T4;\n readonly xwzz: T4;\n readonly xwwx: T4;\n readonly xwwy: T4;\n readonly xwwz: T4;\n readonly xwww: T4;\n readonly yxxw: T4;\n readonly yxyw: T4;\n readonly yxzw: T4;\n readonly yxwx: T4;\n readonly yxwy: T4;\n readonly yxwz: T4;\n readonly yxww: T4;\n readonly yyxw: T4;\n readonly yyyw: T4;\n readonly yyzw: T4;\n readonly yywx: T4;\n readonly yywy: T4;\n readonly yywz: T4;\n readonly yyww: T4;\n readonly yzxw: T4;\n readonly yzyw: T4;\n readonly yzzw: T4;\n readonly yzwx: T4;\n readonly yzwy: T4;\n readonly yzwz: T4;\n readonly yzww: T4;\n readonly ywxx: T4;\n readonly ywxy: T4;\n readonly ywxz: T4;\n readonly ywxw: T4;\n readonly ywyy: T4;\n readonly ywyz: T4;\n readonly ywzz: T4;\n readonly ywwx: T4;\n readonly ywwy: T4;\n readonly ywwz: T4;\n readonly ywww: T4;\n readonly zxxw: T4;\n readonly zxyw: T4;\n readonly zxzw: T4;\n readonly zxwx: T4;\n readonly zxwy: T4;\n readonly zxwz: T4;\n readonly zxww: T4;\n readonly zyxw: T4;\n readonly zyyw: T4;\n readonly zyzw: T4;\n readonly zywx: T4;\n readonly zywy: T4;\n readonly zywz: T4;\n readonly zyww: T4;\n readonly zzxw: T4;\n readonly zzyw: T4;\n readonly zzzw: T4;\n readonly zzwx: T4;\n readonly zzwy: T4;\n readonly zzwz: T4;\n readonly zzww: T4;\n readonly zwxx: T4;\n readonly zwxy: T4;\n readonly zwxz: T4;\n readonly zwxw: T4;\n readonly zwyy: T4;\n readonly zwyz: T4;\n readonly zwzz: T4;\n readonly zwwx: T4;\n readonly zwwy: T4;\n readonly zwwz: T4;\n readonly zwww: T4;\n readonly wxxx: T4;\n readonly wxxy: T4;\n readonly wxxz: T4;\n readonly wxxw: T4;\n readonly wxyx: T4;\n readonly wxyy: T4;\n readonly wxyz: T4;\n readonly wxyw: T4;\n readonly wxzx: T4;\n readonly wxzy: T4;\n readonly wxzz: T4;\n readonly wxzw: T4;\n readonly wxwx: T4;\n readonly wxwy: T4;\n readonly wxwz: T4;\n readonly wxww: T4;\n readonly wyxx: T4;\n readonly wyxy: T4;\n readonly wyxz: T4;\n readonly wyxw: T4;\n readonly wyyy: T4;\n readonly wyyz: T4;\n readonly wyzw: T4;\n readonly wywx: T4;\n readonly wywy: T4;\n readonly wywz: T4;\n readonly wyww: T4;\n readonly wzxx: T4;\n readonly wzxy: T4;\n readonly wzxz: T4;\n readonly wzxw: T4;\n readonly wzyy: T4;\n readonly wzyz: T4;\n readonly wzzy: T4;\n readonly wzzw: T4;\n readonly wzwx: T4;\n readonly wzwy: T4;\n readonly wzwz: T4;\n readonly wzww: T4;\n readonly wwxx: T4;\n readonly wwxy: T4;\n readonly wwxz: T4;\n readonly wwxw: T4;\n readonly wwyy: T4;\n readonly wwyz: T4;\n readonly wwzz: T4;\n readonly wwwx: T4;\n readonly wwwy: T4;\n readonly wwwz: T4;\n readonly wwww: T4;\n}\n\ntype Tuple2<S> = [S, S];\ntype Tuple3<S> = [S, S, S];\ntype Tuple4<S> = [S, S, S, S];\n\n/**\n * Interface representing its WGSL vector type counterpart: vec2f or vec2<f32>.\n * A vector with 2 elements of type f32\n */\nexport interface v2f\n extends Tuple2<number>, Swizzle2<v2f, v3f, v4f>, vecInfixNotation<v2f> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec2f';\n x: number;\n y: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec2h or vec2<f16>.\n * A vector with 2 elements of type f16\n */\nexport interface v2h\n extends Tuple2<number>, Swizzle2<v2h, v3h, v4h>, vecInfixNotation<v2h> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec2h';\n x: number;\n y: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec2i or vec2<i32>.\n * A vector with 2 elements of type i32\n */\nexport interface v2i\n extends Tuple2<number>, Swizzle2<v2i, v3i, v4i>, vecInfixNotation<v2i> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec2i';\n x: number;\n y: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec2u or vec2<u32>.\n * A vector with 2 elements of type u32\n */\nexport interface v2u\n extends Tuple2<number>, Swizzle2<v2u, v3u, v4u>, vecInfixNotation<v2u> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec2u';\n x: number;\n y: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: `vec2<bool>`.\n * A vector with 2 elements of type `bool`\n */\nexport interface v2b extends Tuple2<boolean>, Swizzle2<v2b, v3b, v4b> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec2<bool>';\n x: boolean;\n y: boolean;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec3f or vec3<f32>.\n * A vector with 3 elements of type f32\n */\nexport interface v3f\n extends Tuple3<number>, Swizzle3<v2f, v3f, v4f>, vecInfixNotation<v3f> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec3f';\n x: number;\n y: number;\n z: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec3h or vec3<f16>.\n * A vector with 3 elements of type f16\n */\nexport interface v3h\n extends Tuple3<number>, Swizzle3<v2h, v3h, v4h>, vecInfixNotation<v3h> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec3h';\n x: number;\n y: number;\n z: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec3i or vec3<i32>.\n * A vector with 3 elements of type i32\n */\nexport interface v3i\n extends Tuple3<number>, Swizzle3<v2i, v3i, v4i>, vecInfixNotation<v3i> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec3i';\n x: number;\n y: number;\n z: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec3u or vec3<u32>.\n * A vector with 3 elements of type u32\n */\nexport interface v3u\n extends Tuple3<number>, Swizzle3<v2u, v3u, v4u>, vecInfixNotation<v3u> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec3u';\n x: number;\n y: number;\n z: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: `vec3<bool>`.\n * A vector with 3 elements of type `bool`\n */\nexport interface v3b extends Tuple3<boolean>, Swizzle3<v2b, v3b, v4b> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec3<bool>';\n x: boolean;\n y: boolean;\n z: boolean;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec4f or vec4<f32>.\n * A vector with 4 elements of type f32\n */\nexport interface v4f\n extends Tuple4<number>, Swizzle4<v2f, v3f, v4f>, vecInfixNotation<v4f> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec4f';\n x: number;\n y: number;\n z: number;\n w: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec4h or vec4<f16>.\n * A vector with 4 elements of type f16\n */\nexport interface v4h\n extends Tuple4<number>, Swizzle4<v2h, v3h, v4h>, vecInfixNotation<v4h> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec4h';\n x: number;\n y: number;\n z: number;\n w: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec4i or vec4<i32>.\n * A vector with 4 elements of type i32\n */\nexport interface v4i\n extends Tuple4<number>, Swizzle4<v2i, v3i, v4i>, vecInfixNotation<v4i> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec4i';\n x: number;\n y: number;\n z: number;\n w: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec4u or vec4<u32>.\n * A vector with 4 elements of type u32\n */\nexport interface v4u\n extends Tuple4<number>, Swizzle4<v2u, v3u, v4u>, vecInfixNotation<v4u> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec4u';\n x: number;\n y: number;\n z: number;\n w: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: `vec4<bool>`.\n * A vector with 4 elements of type `bool`\n */\nexport interface v4b extends Tuple4<boolean>, Swizzle4<v2b, v3b, v4b> {\n readonly [$internal]: true;\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec4<bool>';\n x: boolean;\n y: boolean;\n z: boolean;\n w: boolean;\n}\n\nexport type AnyFloat32VecInstance = v2f | v3f | v4f;\n\nexport type AnyFloatVecInstance = v2f | v2h | v3f | v3h | v4f | v4h;\n\nexport type AnyIntegerVecInstance = v2i | v2u | v3i | v3u | v4i | v4u;\n\nexport type AnyBooleanVecInstance = v2b | v3b | v4b;\n\nexport type AnyNumericVec2Instance = v2f | v2h | v2i | v2u;\nexport type AnyNumericVec3Instance = v3f | v3h | v3i | v3u;\nexport type AnyNumericVec4Instance = v4f | v4h | v4i | v4u;\n\nexport type AnyNumericVecInstance =\n | AnyNumericVec2Instance\n | AnyNumericVec3Instance\n | AnyNumericVec4Instance;\n\nexport type AnyVec2Instance = v2f | v2h | v2i | v2u | v2b;\nexport type AnyVec3Instance = v3f | v3h | v3i | v3u | v3b;\nexport type AnyVec4Instance = v4f | v4h | v4i | v4u | v4b;\n\nexport type AnyVecInstance =\n | AnyVec2Instance\n | AnyVec3Instance\n | AnyVec4Instance;\n\nexport type VecKind = AnyVecInstance['kind'];\n\n/**\n * Interface representing its WGSL matrix type counterpart: mat2x2\n * A matrix with 2 rows and 2 columns, with elements of type `TColumn`\n */\nexport interface mat2x2<TColumn> extends NumberArrayView {\n readonly [$internal]: true;\n readonly length: 4;\n readonly kind: string;\n /* override */ readonly columns: readonly [TColumn, TColumn];\n [n: number]: number;\n}\n\n/**\n * Interface representing its WGSL matrix type counterpart: mat2x2f or mat2x2<f32>\n * A matrix with 2 rows and 2 columns, with elements of type d.f32\n */\nexport interface m2x2f extends mat2x2<v2f>, matInfixNotation<m2x2f> {\n readonly kind: 'mat2x2f';\n}\n\n/**\n * Interface representing its WGSL matrix type counterpart: mat3x3\n * A matrix with 3 rows and 3 columns, with elements of type `TColumn`\n */\nexport interface mat3x3<TColumn> extends NumberArrayView {\n readonly [$internal]: true;\n readonly length: 12;\n readonly kind: string;\n /* override */ readonly columns: readonly [TColumn, TColumn, TColumn];\n [n: number]: number;\n}\n\n/**\n * Interface representing its WGSL matrix type counterpart: mat3x3f or mat3x3<f32>\n * A matrix with 3 rows and 3 columns, with elements of type d.f32\n */\nexport interface m3x3f extends mat3x3<v3f>, matInfixNotation<m3x3f> {\n readonly kind: 'mat3x3f';\n}\n\n/**\n * Interface representing its WGSL matrix type counterpart: mat4x4\n * A matrix with 4 rows and 4 columns, with elements of type `TColumn`\n */\nexport interface mat4x4<TColumn> extends NumberArrayView {\n readonly [$internal]: true;\n readonly length: 16;\n readonly kind: string;\n /* override */ readonly columns: readonly [\n TColumn,\n TColumn,\n TColumn,\n TColumn,\n ];\n [n: number]: number;\n}\n\n/**\n * Interface representing its WGSL matrix type counterpart: mat4x4f or mat4x4<f32>\n * A matrix with 4 rows and 4 columns, with elements of type d.f32\n */\nexport interface m4x4f extends mat4x4<v4f>, matInfixNotation<m4x4f> {\n readonly kind: 'mat4x4f';\n}\n\nexport type AnyMatInstance = m2x2f | m3x3f | m4x4f;\n\nexport type vBaseForMat<T extends AnyMatInstance> = T extends m2x2f ? v2f\n : T extends m3x3f ? v3f\n : v4f;\n\nexport type mBaseForVec<T extends AnyVecInstance> = T extends v2f ? m2x2f\n : T extends v3f ? m3x3f\n : T extends v4f ? m4x4f\n : never;\n\n// #endregion\n\n// #region WGSL Schema Types\n\n/**\n * Boolean schema representing a single WGSL bool value.\n * Cannot be used inside buffers as it is not host-shareable.\n */\nexport interface Bool extends BaseData {\n readonly type: 'bool';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: boolean;\n readonly [$invalidSchemaReason]:\n 'Bool is not host-shareable, use U32 or I32 instead';\n // ---\n\n (v?: number | boolean): boolean;\n}\n\n/**\n * 32-bit float schema representing a single WGSL f32 value.\n */\nexport interface F32 extends BaseData {\n readonly type: 'f32';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: number;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (v?: number | boolean): number;\n}\n\n/**\n * 16-bit float schema representing a single WGSL f16 value.\n */\nexport interface F16 extends BaseData {\n readonly type: 'f16';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: number;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (v?: number | boolean): number;\n}\n\n/**\n * Signed 32-bit integer schema representing a single WGSL i32 value.\n */\nexport interface I32 extends BaseData {\n readonly type: 'i32';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: number;\n readonly [$memIdent]: I32 | Atomic<I32> | DecoratedLocation<I32>;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (v?: number | boolean): number;\n}\n\n/**\n * Unsigned 32-bit integer schema representing a single WGSL u32 value.\n */\nexport interface U32 extends BaseData {\n readonly type: 'u32';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: number;\n readonly [$memIdent]: U32 | Atomic<U32> | DecoratedLocation<U32>;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (v?: number | boolean): number;\n}\n\n/**\n * Unsigned 16-bit integer schema used exclusively for index buffer schemas.\n */\nexport interface U16 extends BaseData {\n readonly type: 'u16';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: number;\n readonly [$invalidSchemaReason]:\n 'U16 is only usable inside arrays for index buffers, use U32 or I32 instead';\n // ---\n}\n\n/**\n * Type of the `d.vec2f` object/function: vector data type schema/constructor\n */\nexport interface Vec2f extends BaseData {\n readonly type: 'vec2f';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v2f;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (x: number, y: number): v2f;\n (xy: number): v2f;\n (): v2f;\n (v: AnyNumericVec2Instance): v2f;\n}\n\n/**\n * Type of the `d.vec2h` object/function: vector data type schema/constructor\n */\nexport interface Vec2h extends BaseData {\n readonly type: 'vec2h';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v2h;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (x: number, y: number): v2h;\n (xy: number): v2h;\n (): v2h;\n (v: AnyNumericVec2Instance): v2h;\n}\n\n/**\n * Type of the `d.vec2i` object/function: vector data type schema/constructor\n */\nexport interface Vec2i extends BaseData {\n readonly type: 'vec2i';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v2i;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (x: number, y: number): v2i;\n (xy: number): v2i;\n (): v2i;\n (v: AnyNumericVec2Instance): v2i;\n}\n\n/**\n * Type of the `d.vec2u` object/function: vector data type schema/constructor\n */\nexport interface Vec2u extends BaseData {\n readonly type: 'vec2u';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v2u;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (x: number, y: number): v2u;\n (xy: number): v2u;\n (): v2u;\n (v: AnyNumericVec2Instance): v2u;\n}\n\n/**\n * Type of the `d.vec2b` object/function: vector data type schema/constructor\n * Cannot be used inside buffers as it is not host-shareable.\n */\nexport interface Vec2b extends BaseData {\n readonly type: 'vec2<bool>';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v2b;\n readonly [$invalidSchemaReason]:\n 'Boolean vectors is not host-shareable, use numeric vectors instead';\n // ---\n\n (x: boolean, y: boolean): v2b;\n (xy: boolean): v2b;\n (): v2b;\n (v: v2b): v2b;\n}\n\n/**\n * Type of the `d.vec3f` object/function: vector data type schema/constructor\n */\nexport interface Vec3f extends BaseData {\n readonly type: 'vec3f';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v3f;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (x: number, y: number, z: number): v3f;\n (xyz: number): v3f;\n (): v3f;\n (v: AnyNumericVec3Instance): v3f;\n (v0: AnyNumericVec2Instance, z: number): v3f;\n (x: number, v0: AnyNumericVec2Instance): v3f;\n}\n\n/**\n * Type of the `d.vec3h` object/function: vector data type schema/constructor\n */\nexport interface Vec3h extends BaseData {\n readonly type: 'vec3h';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v3h;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (x: number, y: number, z: number): v3h;\n (xyz: number): v3h;\n (): v3h;\n (v: AnyNumericVec3Instance): v3h;\n (v0: AnyNumericVec2Instance, z: number): v3h;\n (x: number, v0: AnyNumericVec2Instance): v3h;\n}\n\n/**\n * Type of the `d.vec3i` object/function: vector data type schema/constructor\n */\nexport interface Vec3i extends BaseData {\n readonly type: 'vec3i';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v3i;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (x: number, y: number, z: number): v3i;\n (xyz: number): v3i;\n (): v3i;\n (v: AnyNumericVec3Instance): v3i;\n (v0: AnyNumericVec2Instance, z: number): v3i;\n (x: number, v0: AnyNumericVec2Instance): v3i;\n}\n\n/**\n * Type of the `d.vec3u` object/function: vector data type schema/constructor\n */\nexport interface Vec3u extends BaseData {\n readonly type: 'vec3u';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v3u;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (x: number, y: number, z: number): v3u;\n (xyz: number): v3u;\n (): v3u;\n (v: AnyNumericVec3Instance): v3u;\n (v0: AnyNumericVec2Instance, z: number): v3u;\n (x: number, v0: AnyNumericVec2Instance): v3u;\n}\n\n/**\n * Type of the `d.vec3b` object/function: vector data type schema/constructor\n * Cannot be used inside buffers as it is not host-shareable.\n */\nexport interface Vec3b extends BaseData {\n readonly type: 'vec3<bool>';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v3b;\n readonly [$invalidSchemaReason]:\n 'Boolean vectors is not host-shareable, use numeric vectors instead';\n // ---\n\n (x: boolean, y: boolean, z: boolean): v3b;\n (xyz: boolean): v3b;\n (): v3b;\n (v: v3b): v3b;\n (v0: v2b, z: boolean): v3b;\n (x: boolean, v0: v2b): v3b;\n}\n\n/**\n * Type of the `d.vec4f` object/function: vector data type schema/constructor\n */\nexport interface Vec4f extends BaseData {\n readonly type: 'vec4f';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v4f;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (x: number, y: number, z: number, w: number): v4f;\n (xyzw: number): v4f;\n (): v4f;\n (v: AnyNumericVec4Instance): v4f;\n (v0: AnyNumericVec3Instance, w: number): v4f;\n (x: number, v0: AnyNumericVec3Instance): v4f;\n (v0: AnyNumericVec2Instance, v1: AnyNumericVec2Instance): v4f;\n (v0: AnyNumericVec2Instance, z: number, w: number): v4f;\n (x: number, v0: AnyNumericVec2Instance, z: number): v4f;\n (x: number, y: number, v0: AnyNumericVec2Instance): v4f;\n}\n\n/**\n * Type of the `d.vec4h` object/function: vector data type schema/constructor\n */\nexport interface Vec4h extends BaseData {\n readonly type: 'vec4h';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v4h;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (x: number, y: number, z: number, w: number): v4h;\n (xyzw: number): v4h;\n (): v4h;\n (v: AnyNumericVec4Instance): v4h;\n (v0: AnyNumericVec3Instance, w: number): v4h;\n (x: number, v0: AnyNumericVec3Instance): v4h;\n (v0: AnyNumericVec2Instance, v1: AnyNumericVec2Instance): v4h;\n (v0: AnyNumericVec2Instance, z: number, w: number): v4h;\n (x: number, v0: AnyNumericVec2Instance, z: number): v4h;\n (x: number, y: number, v0: AnyNumericVec2Instance): v4h;\n}\n\n/**\n * Type of the `d.vec4i` object/function: vector data type schema/constructor\n */\nexport interface Vec4i extends BaseData {\n readonly type: 'vec4i';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v4i;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (x: number, y: number, z: number, w: number): v4i;\n (xyzw: number): v4i;\n (): v4i;\n (v: AnyNumericVec4Instance): v4i;\n (v0: AnyNumericVec3Instance, w: number): v4i;\n (x: number, v0: AnyNumericVec3Instance): v4i;\n (v0: AnyNumericVec2Instance, v1: AnyNumericVec2Instance): v4i;\n (v0: AnyNumericVec2Instance, z: number, w: number): v4i;\n (x: number, v0: AnyNumericVec2Instance, z: number): v4i;\n (x: number, y: number, v0: AnyNumericVec2Instance): v4i;\n}\n\n/**\n * Type of the `d.vec4u` object/function: vector data type schema/constructor\n */\nexport interface Vec4u extends BaseData {\n readonly type: 'vec4u';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v4u;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n\n (x: number, y: number, z: number, w: number): v4u;\n (xyzw: number): v4u;\n (): v4u;\n (v: AnyNumericVec4Instance): v4u;\n (v0: AnyNumericVec3Instance, w: number): v4u;\n (x: number, v0: AnyNumericVec3Instance): v4u;\n (v0: AnyNumericVec2Instance, v1: AnyNumericVec2Instance): v4u;\n (v0: AnyNumericVec2Instance, z: number, w: number): v4u;\n (x: number, v0: AnyNumericVec2Instance, z: number): v4u;\n (x: number, y: number, v0: AnyNumericVec2Instance): v4u;\n}\n\n/**\n * Type of the `d.vec4b` object/function: vector data type schema/constructor\n * Cannot be used inside buffers as it is not host-shareable.\n */\nexport interface Vec4b extends BaseData {\n readonly type: 'vec4<bool>';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: v4b;\n readonly [$invalidSchemaReason]:\n 'Boolean vectors is not host-shareable, use numeric vectors instead';\n // ---\n\n (x: boolean, y: boolean, z: boolean, w: boolean): v4b;\n (xyzw: boolean): v4b;\n (): v4b;\n (v: v4b): v4b;\n (v0: v3b, w: boolean): v4b;\n (x: boolean, v0: v3b): v4b;\n (v0: v2b, v1: v2b): v4b;\n (v0: v2b, z: boolean, w: boolean): v4b;\n (x: boolean, v0: v2b, z: boolean): v4b;\n (x: boolean, y: boolean, v0: v2b): v4b;\n}\n\n/**\n * Type of the `d.mat2x2f` object/function: matrix data type schema/constructor\n */\nexport interface Mat2x2f extends BaseData {\n readonly type: 'mat2x2f';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: m2x2f;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n // ---\n\n (...elements: [number, number, number, number]): m2x2f;\n (...columns: [v2f, v2f]): m2x2f;\n (): m2x2f;\n identity(): m2x2f;\n}\n\n/**\n * Type of the `d.mat3x3f` object/function: matrix data type schema/constructor\n */\nexport interface Mat3x3f extends BaseData {\n readonly type: 'mat3x3f';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: m3x3f;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n // ---\n\n // deno-fmt-ignore\n (...elements: [number, number, number, number, number, number, number, number, number]): m3x3f;\n (...columns: [v3f, v3f, v3f]): m3x3f;\n (): m3x3f;\n identity(): m3x3f;\n}\n\n/**\n * Type of the `d.mat4x4f` object/function: matrix data type schema/constructor\n */\nexport interface Mat4x4f extends BaseData {\n readonly type: 'mat4x4f';\n\n // Type-tokens, not available at runtime\n readonly [$repr]: m4x4f;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n // ---\n\n // deno-fmt-ignore\n (...elements: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]): m4x4f;\n (...columns: [v4f, v4f, v4f, v4f]): m4x4f;\n (): m4x4f;\n identity(): m4x4f;\n translation(vec: v3f): m4x4f;\n scaling(vec: v3f): m4x4f;\n rotationX(angle: number): m4x4f;\n rotationY(angle: number): m4x4f;\n rotationZ(angle: number): m4x4f;\n}\n\n/**\n * Array schema constructed via `d.arrayOf` function.\n *\n * Responsible for handling reading and writing array values\n * between binary and JS representation. Takes into account\n * the `byteAlignment` requirement of its elementType.\n */\nexport interface WgslArray<TElement extends BaseData = BaseData>\n extends BaseData {\n <T extends TElement>(elements: Infer<T>[]): Infer<T>[];\n (): Infer<TElement>[];\n readonly type: 'array';\n readonly elementCount: number;\n readonly elementType: TElement;\n\n // Type-tokens, not available at runtime\n readonly [$repr]: Infer<TElement>[];\n readonly [$gpuRepr]: InferGPU<TElement>[];\n readonly [$reprPartial]:\n | { idx: number; value: InferPartial<TElement> }[]\n | undefined;\n readonly [$memIdent]: WgslArray<MemIdentity<TElement>>;\n readonly [$validStorageSchema]: IsValidStorageSchema<TElement>;\n readonly [$validUniformSchema]: IsValidUniformSchema<TElement>;\n readonly [$validVertexSchema]: IsValidVertexSchema<TElement>;\n readonly [$invalidSchemaReason]:\n `in array element — ${ExtractInvalidSchemaError<TElement>}`;\n // ---\n}\n\n/**\n * Struct schema constructed via `d.struct` function.\n *\n * Responsible for handling reading and writing struct values\n * between binary and JS representation. Takes into account\n * the `byteAlignment` requirement of its members.\n */\nexport interface WgslStruct<\n // biome-ignore lint/suspicious/noExplicitAny: the widest type that works with both covariance and contravariance\n TProps extends Record<string, BaseData> = any,\n> extends BaseData, TgpuNamable {\n readonly type: 'struct';\n readonly propTypes: TProps;\n\n (props: Prettify<InferRecord<TProps>>): Prettify<InferRecord<TProps>>;\n (): Prettify<InferRecord<TProps>>;\n\n // Type-tokens, not available at runtime\n readonly [$repr]: Prettify<InferRecord<TProps>>;\n readonly [$gpuRepr]: Prettify<InferGPURecord<TProps>>;\n readonly [$memIdent]: WgslStruct<Prettify<MemIdentityRecord<TProps>>>;\n readonly [$reprPartial]:\n | Prettify<Partial<InferPartialRecord<TProps>>>\n | undefined;\n readonly [$invalidSchemaReason]: SwapNever<\n {\n [K in keyof TProps]: ExtractInvalidSchemaError<\n TProps[K],\n `in struct property '${K & string}' — `\n >;\n }[keyof TProps],\n undefined\n >;\n readonly [$validStorageSchema]: {\n [K in keyof TProps]: IsValidStorageSchema<TProps[K]>;\n }[keyof TProps] extends true ? true : false;\n readonly [$validUniformSchema]: {\n [K in keyof TProps]: IsValidUniformSchema<TProps[K]>;\n }[keyof TProps] extends true ? true : false;\n readonly [$validVertexSchema]: {\n [K in keyof TProps]: IsValidVertexSchema<TProps[K]>;\n }[keyof TProps] extends true ? true : false;\n // ---\n}\n\n/** @deprecated Just use `WgslStruct` without any type parameters */\nexport type AnyWgslStruct = WgslStruct;\n\nexport type AddressSpace =\n | 'uniform'\n | 'storage'\n | 'workgroup'\n | 'private'\n | 'function'\n | 'handle';\nexport type Access = 'read' | 'write' | 'read-write';\n\nexport interface Ptr<\n TAddr extends AddressSpace = AddressSpace,\n TInner extends BaseData = BaseData, // can also be sampler or texture (╯'□')╯︵ ┻━┻\n TAccess extends Access = Access,\n> extends BaseData {\n readonly type: 'ptr';\n readonly inner: TInner;\n readonly addressSpace: TAddr;\n readonly access: TAccess;\n\n // Type-tokens, not available at runtime\n readonly [$repr]: Infer<TInner>;\n readonly [$invalidSchemaReason]: 'Pointers are not host-shareable';\n // ---\n}\n\n/**\n * Schema representing the `atomic<...>` WGSL data type.\n */\nexport interface Atomic<TInner extends U32 | I32 = U32 | I32> extends BaseData {\n readonly type: 'atomic';\n readonly inner: TInner;\n\n // Type-tokens, not available at runtime\n readonly [$repr]: Infer<TInner>;\n readonly [$gpuRepr]: TInner extends U32 ? atomicU32 : atomicI32;\n readonly [$memIdent]: MemIdentity<TInner>;\n readonly [$validStorageSchema]: true;\n readonly [$validUniformSchema]: true;\n readonly [$validVertexSchema]: true;\n // ---\n}\n\nexport interface atomicU32 {\n readonly [$internal]: true;\n readonly type: 'atomicU32';\n}\n\nexport interface atomicI32 {\n readonly [$internal]: true;\n readonly type: 'atomicI32';\n}\n\nexport interface Align<T extends number> {\n readonly [$internal]: true;\n readonly type: '@align';\n readonly params: [T];\n}\n\nexport interface Size<T extends number> {\n readonly [$internal]: true;\n readonly type: '@size';\n readonly params: [T];\n}\n\nexport interface Location<T extends number = number> {\n readonly [$internal]: true;\n readonly type: '@location';\n readonly params: [T];\n}\n\nexport type PerspectiveOrLinearInterpolationType = `${\n | 'perspective'\n | 'linear'}${'' | ', center' | ', centroid' | ', sample'}`;\nexport type FlatInterpolationType = `flat${'' | ', first' | ', either'}`;\nexport type InterpolationType =\n | PerspectiveOrLinearInterpolationType\n | FlatInterpolationType;\n\nexport interface Interpolate<T extends InterpolationType = InterpolationType> {\n readonly [$internal]: true;\n readonly type: '@interpolate';\n readonly params: [T];\n}\n\nexport interface Builtin<T extends string> {\n readonly [$internal]: true;\n readonly type: '@builtin';\n readonly params: [T];\n}\n\nexport interface Invariant {\n readonly [$internal]: true;\n readonly type: '@invariant';\n readonly params: [];\n}\n\nexport interface Decorated<\n TInner extends BaseData = BaseData,\n TAttribs extends unknown[] = unknown[],\n> extends BaseData {\n readonly type: 'decorated';\n readonly inner: TInner;\n readonly attribs: TAttribs;\n\n // Type-tokens, not available at runtime\n readonly [$repr]: Infer<TInner>;\n readonly [$gpuRepr]: InferGPU<TInner>;\n readonly [$reprPartial]: InferPartial<TInner>;\n readonly [$memIdent]: TAttribs extends Location[]\n ? MemIdentity<TInner> | Decorated<MemIdentity<TInner>, TAttribs>\n : Decorated<MemIdentity<TInner>, TAttribs>;\n readonly [$validStorageSchema]: IsValidStorageSchema<TInner>;\n readonly [$validUniformSchema]: IsValidUniformSchema<TInner>;\n readonly [$validVertexSchema]: IsValidVertexSchema<TInner>;\n readonly [$invalidSchemaReason]: ExtractInvalidSchemaError<TInner>;\n // ---\n}\n\nexport const wgslTypeLiterals = [\n 'bool',\n 'f32',\n 'f16',\n 'i32',\n 'u32',\n 'u16',\n 'vec2f',\n 'vec2h',\n 'vec2i',\n 'vec2u',\n 'vec2<bool>',\n 'vec3f',\n 'vec3h',\n 'vec3i',\n 'vec3u',\n 'vec3<bool>',\n 'vec4f',\n 'vec4h',\n 'vec4i',\n 'vec4u',\n 'vec4<bool>',\n 'mat2x2f',\n 'mat3x3f',\n 'mat4x4f',\n 'struct',\n 'array',\n 'ptr',\n 'atomic',\n 'decorated',\n 'abstractInt',\n 'abstractFloat',\n 'void',\n] as const;\n\nexport type WgslTypeLiteral = (typeof wgslTypeLiterals)[number];\n\nexport type PerspectiveOrLinearInterpolatableBaseType =\n | F32\n | F16\n | Vec2f\n | Vec2h\n | Vec3f\n | Vec3h\n | Vec4f\n | Vec4h;\n\nexport type PerspectiveOrLinearInterpolatableData =\n | PerspectiveOrLinearInterpolatableBaseType\n | Decorated<PerspectiveOrLinearInterpolatableBaseType>;\n\nexport type FlatInterpolatableAdditionalBaseType =\n | I32\n | U32\n | Vec2i\n | Vec2u\n | Vec3i\n | Vec3u\n | Vec4i\n | Vec4u;\n\nexport type FlatInterpolatableData =\n | PerspectiveOrLinearInterpolatableData\n | FlatInterpolatableAdditionalBaseType\n | Decorated<FlatInterpolatableAdditionalBaseType>;\n\nexport type ScalarData =\n | Bool\n | F32\n | F16\n | I32\n | U32\n | AbstractInt\n | AbstractFloat;\n\nexport type AnyWgslData =\n | Bool\n | F32\n | F16\n | I32\n | U32\n | U16\n | Vec2f\n | Vec2h\n | Vec2i\n | Vec2u\n | Vec2b\n | Vec3f\n | Vec3h\n | Vec3i\n | Vec3u\n | Vec3b\n | Vec4f\n | Vec4h\n | Vec4i\n | Vec4u\n | Vec4b\n | Mat2x2f\n | Mat3x3f\n | Mat4x4f\n | WgslStruct\n | WgslArray\n | Ptr\n | Atomic<U32>\n | Atomic<I32>\n | Decorated\n | AbstractInt\n | AbstractFloat\n | Void;\n\n// #endregion\n\nexport function isVecInstance(value: unknown): value is AnyVecInstance {\n const v = value as AnyVecInstance | undefined;\n return !!v?.[$internal] &&\n typeof v.kind?.startsWith === 'function' &&\n v.kind.startsWith('vec');\n}\n\nexport function isVec2(value: unknown): value is Vec2f | Vec2h | Vec2i | Vec2u {\n const v = value as AnyWgslData | undefined;\n return !!v?.[$internal] &&\n typeof v.type?.startsWith === 'function' &&\n v.type.startsWith?.('vec2');\n}\n\nexport function isVec3(value: unknown): value is Vec3f | Vec3h | Vec3i | Vec3u {\n const v = value as AnyWgslData | undefined;\n return !!v?.[$internal] &&\n typeof v.type?.startsWith === 'function' &&\n v.type.startsWith('vec3');\n}\n\nexport function isVec4(value: unknown): value is Vec4f | Vec4h | Vec4i | Vec4u {\n const v = value as AnyWgslData | undefined;\n return !!v?.[$internal] &&\n typeof v.type?.startsWith === 'function' &&\n v.type.startsWith('vec4');\n}\n\nexport function isVec(\n value: unknown,\n): value is\n | Vec2f\n | Vec2h\n | Vec2i\n | Vec2u\n | Vec3f\n | Vec3h\n | Vec3i\n | Vec3u\n | Vec4f\n | Vec4h\n | Vec4i\n | Vec4u {\n return isVec2(value) || isVec3(value) || isVec4(value);\n}\n\nexport function isMatInstance(value: unknown): value is AnyMatInstance {\n const v = value as AnyMatInstance | undefined;\n return !!v?.[$internal] &&\n typeof v.kind?.startsWith === 'function' &&\n v.kind.startsWith('mat');\n}\n\nexport function isMat2x2f(value: unknown): value is Mat2x2f {\n return (\n (value as AnyWgslData)?.[$internal] &&\n (value as AnyWgslData)?.type === 'mat2x2f'\n );\n}\n\nexport function isMat3x3f(value: unknown): value is Mat3x3f {\n return (\n (value as AnyWgslData)?.[$internal] &&\n (value as AnyWgslData)?.type === 'mat3x3f'\n );\n}\n\nexport function isMat4x4f(value: unknown): value is Mat4x4f {\n return (\n (value as AnyWgslData)?.[$internal] &&\n (value as AnyWgslData)?.type === 'mat4x4f'\n );\n}\n\nexport function isMat(value: unknown): value is Mat2x2f | Mat3x3f | Mat4x4f {\n return isMat2x2f(value) || isMat3x3f(value) || isMat4x4f(value);\n}\n\nexport function isFloat32VecInstance(\n element: number | AnyVecInstance | AnyMatInstance,\n): element is AnyFloat32VecInstance {\n return isVecInstance(element) &&\n ['vec2f', 'vec3f', 'vec4f'].includes(element.kind);\n}\n\nexport function isWgslData(value: unknown): value is AnyWgslData {\n return (\n (value as AnyWgslData)?.[$internal] &&\n wgslTypeLiterals.includes((value as AnyWgslData)?.type)\n );\n}\n\n/**\n * Checks whether passed in value is an array schema,\n * as opposed to, e.g., a disarray schema.\n *\n * Array schemas can be used to describe uniform and storage buffers,\n * whereas disarray schemas cannot.\n *\n * @example\n * isWgslArray(d.arrayOf(d.u32, 4)) // true\n * isWgslArray(d.disarray(d.u32, 4)) // false\n * isWgslArray(d.vec3f) // false\n */\nexport function isWgslArray<T extends WgslArray>(\n schema: T | unknown,\n): schema is T {\n return (schema as T)?.[$internal] && (schema as T)?.type === 'array';\n}\n\n/**\n * Checks whether passed in value is a struct schema,\n * as opposed to, e.g., an unstruct schema.\n *\n * Struct schemas can be used to describe uniform and storage buffers,\n * whereas unstruct schemas cannot.\n *\n * @example\n * isWgslStruct(d.struct({ a: d.u32 })) // true\n * isWgslStruct(d.unstruct({ a: d.u32 })) // false\n * isWgslStruct(d.vec3f) // false\n */\nexport function isWgslStruct<T extends WgslStruct>(\n schema: T | unknown,\n): schema is T {\n return (schema as T)?.[$internal] && (schema as T)?.type === 'struct';\n}\n\n/**\n * Checks whether passed in value is a pointer ('function' scope) schema.\n *\n * @example\n * isPtrFn(d.ptrFn(d.f32)) // true\n * isPtrFn(d.f32) // false\n */\nexport function isPtr<T extends Ptr>(schema: T | unknown): schema is T {\n return (schema as T)?.[$internal] && (schema as T)?.type === 'ptr';\n}\n\n/**\n * Checks whether the passed in value is an atomic schema.\n *\n * @example\n * isAtomic(d.atomic(d.u32)) // true\n * isAtomic(d.u32) // false\n */\nexport function isAtomic<T extends Atomic<U32 | I32>>(\n schema: T | unknown,\n): schema is T {\n return (schema as T)?.[$internal] && (schema as T)?.type === 'atomic';\n}\n\nexport function isAlignAttrib<T extends Align<number>>(\n value: unknown | T,\n): value is T {\n return (value as T)?.[$internal] && (value as T)?.type === '@align';\n}\n\nexport function isSizeAttrib<T extends Size<number>>(\n value: unknown | T,\n): value is T {\n return (value as T)?.[$internal] && (value as T)?.type === '@size';\n}\n\nexport function isLocationAttrib<T extends Location<number>>(\n value: unknown | T,\n): value is T {\n return (value as T)?.[$internal] && (value as T)?.type === '@location';\n}\n\nexport function isInterpolateAttrib<T extends Interpolate<InterpolationType>>(\n value: unknown | T,\n): value is T {\n return (value as T)?.[$internal] && (value as T)?.type === '@interpolate';\n}\n\nexport function isBuiltinAttrib<T extends Builtin<string>>(\n value: unknown | T,\n): value is T {\n return (value as T)?.[$internal] && (value as T)?.type === '@builtin';\n}\n\nexport function isInvariantAttrib<T extends Invariant>(\n value: unknown | T,\n): value is T {\n return (value as T)?.[$internal] && (value as T)?.type === '@invariant';\n}\n\nexport function isDecorated<T extends Decorated>(\n value: unknown | T,\n): value is T {\n return (value as T)?.[$internal] && (value as T)?.type === 'decorated';\n}\n\nexport function isAbstractFloat(value: unknown): value is AbstractFloat {\n return (\n (value as AbstractFloat)?.[$internal] &&\n (value as AbstractFloat).type === 'abstractFloat'\n );\n}\n\nexport function isAbstractInt(value: unknown): value is AbstractInt {\n return (\n (value as AbstractInt)?.[$internal] &&\n (value as AbstractInt).type === 'abstractInt'\n );\n}\n\nexport function isVoid(value: unknown): value is Void {\n return (value as Void)?.[$internal] && (value as Void).type === 'void';\n}\n","import type { Block } from 'tinyest';\nimport type { TgpuBuffer } from './core/buffer/buffer.ts';\nimport type {\n TgpuBufferMutable,\n TgpuBufferReadonly,\n TgpuBufferUniform,\n TgpuBufferUsage,\n} from './core/buffer/bufferUsage.ts';\nimport type { TgpuConst } from './core/constant/tgpuConstant.ts';\nimport type { TgpuDeclare } from './core/declare/tgpuDeclare.ts';\nimport type { TgpuComputeFn } from './core/function/tgpuComputeFn.ts';\nimport type { TgpuFn } from './core/function/tgpuFn.ts';\nimport type { TgpuFragmentFn } from './core/function/tgpuFragmentFn.ts';\nimport type { TgpuVertexFn } from './core/function/tgpuVertexFn.ts';\nimport type { TgpuComputePipeline } from './core/pipeline/computePipeline.ts';\nimport type { TgpuRenderPipeline } from './core/pipeline/renderPipeline.ts';\nimport type { TgpuSampler } from './core/sampler/sampler.ts';\nimport {\n type Eventual,\n isDerived,\n isProviding,\n isSlot,\n type SlotValuePair,\n type TgpuAccessor,\n type TgpuSlot,\n} from './core/slot/slotTypes.ts';\nimport type { TgpuExternalTexture } from './core/texture/externalTexture.ts';\nimport type {\n TgpuAnyTextureView,\n TgpuTexture,\n} from './core/texture/texture.ts';\nimport type { TgpuVar } from './core/variable/tgpuVariable.ts';\nimport type { AnyData, UnknownData } from './data/dataTypes.ts';\nimport type { Snippet } from './data/snippet.ts';\nimport {\n type AnyMatInstance,\n type AnyVecInstance,\n type AnyWgslData,\n type BaseData,\n isWgslData,\n} from './data/wgslTypes.ts';\nimport type { NameRegistry } from './nameRegistry.ts';\nimport type { Infer, InferGPU } from './shared/repr.ts';\nimport { $internal } from './shared/symbols.ts';\nimport type {\n TgpuBindGroupLayout,\n TgpuLayoutEntry,\n} from './tgpuBindGroupLayout.ts';\n\nexport type ResolvableObject =\n | SelfResolvable\n | TgpuBufferUsage\n | TgpuConst\n | TgpuDeclare\n | TgpuFn\n | TgpuComputeFn\n | TgpuFragmentFn\n | TgpuComputePipeline\n | TgpuRenderPipeline\n | TgpuVertexFn\n | TgpuSampler\n | TgpuAccessor\n | TgpuExternalTexture\n | TgpuTexture\n | TgpuAnyTextureView\n | TgpuVar\n | AnyVecInstance\n | AnyMatInstance\n | AnyData\n | TgpuFn;\n\nexport type Wgsl = Eventual<string | number | boolean | ResolvableObject>;\n\nexport type TgpuShaderStage = 'compute' | 'vertex' | 'fragment';\n\nexport interface FnToWgslOptions {\n args: Snippet[];\n argAliases: Record<string, Snippet>;\n returnType: AnyData;\n body: Block;\n externalMap: Record<string, unknown>;\n}\n\nexport type ItemLayer = {\n type: 'item';\n usedSlots: Set<TgpuSlot<unknown>>;\n};\n\nexport interface ItemStateStack {\n readonly itemDepth: number;\n readonly topItem: ItemLayer;\n\n pushItem(): void;\n popItem(): void;\n pushSlotBindings(pairs: SlotValuePair<unknown>[]): void;\n popSlotBindings(): void;\n pushFunctionScope(\n args: Snippet[],\n argAliases: Record<string, Snippet>,\n returnType: AnyData,\n externalMap: Record<string, unknown>,\n ): void;\n popFunctionScope(): void;\n pushBlockScope(): void;\n popBlockScope(): void;\n topFunctionReturnType: AnyData;\n pop(type?: 'functionScope' | 'blockScope' | 'slotBinding' | 'item'): void;\n readSlot<T>(slot: TgpuSlot<T>): T | undefined;\n getSnippetById(id: string): Snippet | undefined;\n defineBlockVariable(id: string, type: AnyWgslData | UnknownData): Snippet;\n}\n\n/**\n * # What are execution modes/states? 🤷‍♂️\n * They're used to control how each TypeGPU resource reacts\n * to actions upon them.\n *\n * ## Normal mode\n * This is the default mode, where resources are acted upon\n * by code either:\n * - Not wrapped inside any of our execution-altering APIs\n * like tgpu.resolve or tgpu.simulate.\n * - Inside tgpu.derived definitions, where we're taking a break\n * from codegen/simulation to create resources on-demand.\n *\n * ```ts\n * const count = tgpu.privateVar(d.f32);\n * count.$ += 1; // Illegal in top-level\n *\n * const root = await tgpu.init();\n * const countMutable = root.createMutable(d.f32);\n * countMutable.$ = [1, 2, 3]; // Illegal in top-level\n * countMutable.write([1, 2, 3]); // OK!\n * ```\n *\n * ## Codegen mode\n * Brought upon by `tgpu.resolve()` (or higher-level APIs using it like our pipelines).\n * Resources are expected to generate WGSL code that represents them, instead of\n * fulfilling their task in JS.\n *\n * ```ts\n * const foo = tgpu.fn([], d.f32)(() => 123);\n * // The following is running in `codegen` mode\n * console.log(foo()); // Prints `foo_0()`\n * ```\n *\n * ## Simulate mode\n * Callbacks passed to `tgpu.simulate()` are executed in this mode. Each 'simulation'\n * is isolated, and does not share state with other simulations (even nested ones).\n * Variables and buffers can be accessed and mutated directly, and their state\n * is returned at the end of the simulation.\n *\n * ```ts\n * const var = tgpu.privateVar(d.f32, 0);\n *\n * const result = tgpu.simulate(() => {\n * // This is running in `simulate` mode\n * var.$ += 1; // Direct access is legal\n * return var.$; // Returns 1\n * });\n *\n * console.log(result.value); // Prints 1\n * ```\n */\nexport type ExecMode = 'normal' | 'codegen' | 'simulate';\n\nexport class NormalState {\n readonly type = 'normal' as const;\n}\n\nexport class CodegenState {\n readonly type = 'codegen' as const;\n}\n\nexport class SimulationState {\n readonly type = 'simulate' as const;\n\n constructor(\n readonly buffers: Map<TgpuBuffer<AnyData>, unknown>,\n readonly vars: {\n private: Map<TgpuVar, unknown>;\n workgroup: Map<TgpuVar, unknown>;\n },\n ) {}\n}\n\nexport type ExecState =\n | NormalState\n | CodegenState\n | SimulationState;\n\n/**\n * Passed into each resolvable item. All items in a tree share a resolution ctx,\n * but there can be layers added and removed from the item stack when going down\n * and up the tree.\n */\nexport interface ResolutionCtx {\n readonly names: NameRegistry;\n readonly mode: ExecState;\n\n addDeclaration(declaration: string): void;\n\n /**\n * Reserves a bind group number, and returns a placeholder that will be replaced\n * with a concrete number at the end of the resolution process.\n */\n allocateLayoutEntry(layout: TgpuBindGroupLayout): string;\n\n /**\n * Reserves a spot in the catch-all bind group, without the indirection of a bind-group.\n * This means the resource is 'fixed', and cannot be swapped between code execution.\n */\n allocateFixedEntry(\n layoutEntry: TgpuLayoutEntry,\n resource: object,\n ): {\n group: string;\n binding: number;\n };\n\n withSlots<T>(pairs: SlotValuePair<unknown>[], callback: () => T): T;\n\n pushMode(state: ExecState): void;\n popMode(expected?: ExecMode | undefined): void;\n\n /**\n * Unwraps all layers of slot/derived indirection and returns the concrete value if available.\n * @throws {MissingSlotValueError}\n */\n unwrap<T>(eventual: Eventual<T>): T;\n\n resolve(item: unknown): string;\n resolveValue<T extends BaseData>(\n value: Infer<T> | InferGPU<T>,\n schema: T,\n ): string;\n\n fnToWgsl(options: FnToWgslOptions): {\n head: Wgsl;\n body: Wgsl;\n };\n\n withVaryingLocations<T>(\n locations: Record<string, number>,\n callback: () => T,\n ): T;\n get varyingLocations(): Record<string, number> | undefined;\n\n [$internal]: {\n itemStateStack: ItemStateStack;\n };\n}\n\n/**\n * Houses a method '~resolve` that returns a code string\n * representing it, as opposed to offloading the resolution\n * to another mechanism.\n */\nexport interface SelfResolvable {\n '~resolve'(ctx: ResolutionCtx): string;\n toString(): string;\n}\n\nexport function isSelfResolvable(value: unknown): value is SelfResolvable {\n return typeof (value as SelfResolvable)?.['~resolve'] === 'function';\n}\n\nexport function isWgsl(value: unknown): value is Wgsl {\n return (\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'string' ||\n isSelfResolvable(value) ||\n isWgslData(value) ||\n isSlot(value) ||\n isDerived(value) ||\n isProviding(value)\n );\n}\n\nexport type BindableBufferUsage = 'uniform' | 'readonly' | 'mutable';\nexport type BufferUsage = 'uniform' | 'readonly' | 'mutable' | 'vertex';\nexport type ConversionStrategy =\n | 'keep'\n | 'unify';\n\n/**\n * Optional hints for converting function argument types during resolution.\n * In case of tgpu functions, this is just the array of argument schemas.\n * In case of raw dualImpls (e.g. in std), this is either a function that converts the snippets appropriately,\n * or a string defining a conversion strategy.\n * The strategy 'keep' is the default.\n */\nexport type FnArgsConversionHint =\n | AnyData[]\n | ((...args: Snippet[]) => AnyWgslData[])\n | ConversionStrategy;\n\nexport function isGPUBuffer(value: unknown): value is GPUBuffer {\n return (\n !!value &&\n typeof value === 'object' &&\n 'getMappedRange' in value &&\n 'mapAsync' in value\n );\n}\n\nexport function isBufferUsage<\n T extends\n | TgpuBufferUniform<BaseData>\n | TgpuBufferReadonly<BaseData>\n | TgpuBufferMutable<BaseData>,\n>(value: T | unknown): value is T {\n return (value as T)?.resourceType === 'buffer-usage';\n}\n\nexport function isMarkedInternal(\n value: unknown,\n): value is { [$internal]: Record<string, unknown> } {\n return !!(value as { [$internal]: Record<string, unknown> })?.[$internal];\n}\n","import { invariant } from './errors.ts';\nimport { type ExecState, NormalState, type ResolutionCtx } from './types.ts';\n\n/**\n * Used to track if the code we're currently\n * executing is inside an executing TypeGPU function.\n *\n * Helpful for providing better error messages.\n */\nlet insideTgpuFn = false;\n\nexport function provideInsideTgpuFn<T>(callback: () => T): T {\n if (insideTgpuFn) {\n return callback();\n }\n try {\n insideTgpuFn = true;\n return callback();\n } finally {\n insideTgpuFn = false;\n }\n}\n\nexport function isInsideTgpuFn(): boolean {\n return insideTgpuFn;\n}\n\nlet resolutionCtx: ResolutionCtx | undefined;\n\nexport function provideCtx<T>(ctx: ResolutionCtx, callback: () => T): T {\n invariant(\n resolutionCtx === undefined || resolutionCtx === ctx,\n 'Cannot nest context providers',\n );\n\n if (resolutionCtx === ctx) {\n return callback();\n }\n\n resolutionCtx = ctx;\n try {\n return callback();\n } finally {\n resolutionCtx = undefined;\n }\n}\n\nexport function getResolutionCtx(): ResolutionCtx | undefined {\n return resolutionCtx;\n}\n\n/**\n * Applicable when code is being executed outside of any\n * execution-altering APIs.\n */\nexport const topLevelState = new NormalState();\n\nexport function getExecMode(): ExecState {\n return resolutionCtx?.mode ?? topLevelState;\n}\n\nexport function inCodegenMode() {\n return resolutionCtx?.mode?.type === 'codegen';\n}\n\n// You can add getters for more modes if necessary...\n","import type { TgpuDualFn } from '../../data/dataTypes.ts';\nimport type { MapValueToSnippet, Snippet } from '../../data/snippet.ts';\nimport { inCodegenMode } from '../../execMode.ts';\nimport type { FnArgsConversionHint } from '../../types.ts';\nimport { setName } from '../../shared/meta.ts';\nimport { $internal } from '../../shared/symbols.ts';\n\nexport function createDualImpl<T extends (...args: never[]) => unknown>(\n jsImpl: T,\n gpuImpl: (...args: MapValueToSnippet<Parameters<T>>) => Snippet,\n name: string,\n argConversionHint: FnArgsConversionHint = 'keep',\n): TgpuDualFn<T> {\n const impl = ((...args: Parameters<T>) => {\n if (inCodegenMode()) {\n return gpuImpl(...(args as MapValueToSnippet<Parameters<T>>)) as Snippet;\n }\n return jsImpl(...args);\n }) as T;\n\n setName(impl, name);\n impl.toString = () => name;\n (impl as TgpuDualFn<T>)[$internal] = { jsImpl, gpuImpl, argConversionHint };\n\n return impl as TgpuDualFn<T>;\n}\n","import type { AnyData } from './dataTypes.ts';\n\n/**\n * Type utility to extract the inner type from decorated types.\n */\nexport type Undecorate<T> = T extends {\n readonly type: 'decorated' | 'loose-decorated';\n readonly inner: infer TInner;\n} ? TInner\n : T;\n\n/**\n * Type utility to undecorate all values in a record.\n */\nexport type UndecorateRecord<T extends Record<string, unknown>> = {\n [Key in keyof T]: Undecorate<T[Key]>;\n};\n\n/**\n * Runtime function to extract the inner data type from decorated types.\n * If the data is not decorated, returns the data as-is.\n */\nexport function undecorate(data: AnyData): AnyData {\n if (data.type === 'decorated' || data.type === 'loose-decorated') {\n return data.inner as AnyData;\n }\n return data;\n}\n","import { undecorate } from './decorateUtils.ts';\nimport type { AnyData, UnknownData } from './dataTypes.ts';\n\nexport interface Snippet {\n readonly value: unknown;\n readonly dataType: AnyData | UnknownData;\n}\n\nexport type MapValueToSnippet<T> = { [K in keyof T]: Snippet };\n\nclass SnippetImpl implements Snippet {\n constructor(\n readonly value: unknown,\n readonly dataType: AnyData | UnknownData,\n ) {}\n}\n\nexport function isSnippet(value: unknown): value is Snippet {\n return value instanceof SnippetImpl;\n}\n\nexport function snip(value: unknown, dataType: AnyData | UnknownData): Snippet {\n return new SnippetImpl(\n value,\n // We don't care about attributes in snippet land, so we discard that information.\n undecorate(dataType as AnyData),\n );\n}\n","import { createDualImpl } from '../core/function/dualImpl.ts';\nimport { $internal } from '../shared/symbols.ts';\nimport { snip } from './snippet.ts';\nimport type {\n AbstractFloat,\n AbstractInt,\n Bool,\n F16,\n F32,\n I32,\n U16,\n U32,\n} from './wgslTypes.ts';\n\nexport const abstractInt = {\n [$internal]: true,\n type: 'abstractInt',\n} as AbstractInt;\n\nexport const abstractFloat = {\n [$internal]: true,\n type: 'abstractFloat',\n} as AbstractFloat;\n\nconst boolCast = createDualImpl(\n // CPU implementation\n (v?: number | boolean) => {\n if (v === undefined) {\n return false;\n }\n if (typeof v === 'boolean') {\n return v;\n }\n return !!v;\n },\n // GPU implementation\n (v) => snip(`bool(${v?.value ?? ''})`, bool),\n 'boolCast',\n);\n\n/**\n * A schema that represents a boolean value. (equivalent to `bool` in WGSL)\n *\n * Can also be called to cast a value to a bool in accordance with WGSL casting rules.\n *\n * @example\n * const value = bool(); // false\n * @example\n * const value = bool(0); // false\n * @example\n * const value = bool(-0); // false\n * @example\n * const value = bool(21.37); // true\n */\nexport const bool: Bool = Object.assign(boolCast, {\n type: 'bool',\n}) as unknown as Bool;\n\nconst u32Cast = createDualImpl(\n // CPU implementation\n (v?: number | boolean) => {\n if (v === undefined) {\n return 0;\n }\n if (typeof v === 'boolean') {\n return v ? 1 : 0;\n }\n return (v & 0xffffffff) >>> 0;\n },\n // GPU implementation\n (v) => snip(`u32(${v?.value ?? ''})`, u32),\n 'u32Cast',\n);\n\n/**\n * A schema that represents an unsigned 32-bit integer value. (equivalent to `u32` in WGSL)\n *\n * Can also be called to cast a value to an u32 in accordance with WGSL casting rules.\n *\n * @example\n * const value = u32(); // 0\n * @example\n * const value = u32(7); // 7\n * @example\n * const value = u32(3.14); // 3\n * @example\n * const value = u32(-1); // 4294967295\n * @example\n * const value = u32(-3.1); // 0\n */\nexport const u32: U32 = Object.assign(u32Cast, {\n type: 'u32',\n}) as unknown as U32;\n\nconst i32Cast = createDualImpl(\n // CPU implementation\n (v?: number | boolean) => {\n if (v === undefined) {\n return 0;\n }\n if (typeof v === 'boolean') {\n return v ? 1 : 0;\n }\n return v | 0;\n },\n // GPU implementation\n (v) => snip(`i32(${v?.value ?? ''})`, i32),\n 'i32Cast',\n);\n\nexport const u16: U16 = {\n [$internal]: true,\n type: 'u16',\n} as U16;\n\n/**\n * A schema that represents a signed 32-bit integer value. (equivalent to `i32` in WGSL)\n *\n * Can also be called to cast a value to an i32 in accordance with WGSL casting rules.\n *\n * @example\n * const value = i32(); // 0\n * @example\n * const value = i32(3.14); // 3\n * @example\n * const value = i32(-3.9); // -3\n * @example\n * const value = i32(10000000000) // 1410065408\n */\nexport const i32: I32 = Object.assign(i32Cast, {\n type: 'i32',\n}) as unknown as I32;\n\nconst f32Cast = createDualImpl(\n // CPU implementation\n (v?: number | boolean) => {\n if (v === undefined) {\n return 0;\n }\n if (typeof v === 'boolean') {\n return v ? 1 : 0;\n }\n return Math.fround(v);\n },\n // GPU implementation\n (v) => snip(`f32(${v?.value ?? ''})`, f32),\n 'f32Cast',\n);\n\n/**\n * A schema that represents a 32-bit float value. (equivalent to `f32` in WGSL)\n *\n * Can also be called to cast a value to an f32.\n *\n * @example\n * const value = f32(); // 0\n * @example\n * const value = f32(1.23); // 1.23\n * @example\n * const value = f32(true); // 1\n */\nexport const f32: F32 = Object.assign(f32Cast, {\n type: 'f32',\n}) as unknown as F32;\n\n// helpers for floating point conversion\nconst buf32 = new ArrayBuffer(4);\nconst f32arr = new Float32Array(buf32);\nconst u32arr = new Uint32Array(buf32);\n\n/**\n * Convert a JavaScript number (treated as float32) to **binary16** bit pattern.\n * @param x 32-bit floating-point value\n * @returns 16-bit half-precision encoding (stored in a JS number)\n */\nexport function toHalfBits(x: number): number {\n f32arr[0] = x; // Write value; shared buffer now contains raw bits.\n const bits = u32arr[0] as number; // Read those bits as unsigned int.\n\n // 1. Extract sign, exponent, and mantissa from the 32‑bit layout.\n const sign = (bits >>> 31) & 0x1; // Bit 31 is the sign.\n let exp = (bits >>> 23) & 0xff; // Bits 30‑23 form the biased exponent.\n let mant = bits & 0x7fffff; // Bits 22‑0 are the significand.\n\n // 2. Handle special values (NaN, ±∞) before re‑biasing.\n if (exp === 0xff) {\n // Preserve the quiet‑NaN bit if mant≠0; otherwise this is ±∞.\n return (sign << 15) | 0x7c00 | (mant ? 0x0200 : 0);\n }\n\n // 3. Re‑bias the exponent from 127 → 15 (binary32 → binary16).\n exp = exp - 127 + 15;\n\n // 4. Underflow: exponent ≤ 0 yields sub‑normals or signed zero.\n if (exp <= 0) {\n // If we need to shift more than 10 places, the value rounds to ±0.\n if (exp < -10) {\n return sign << 15;\n }\n\n // Produce a sub‑normal: prepend the hidden 1, right‑shift, then round.\n mant = (mant | 0x800000) >> (1 - exp);\n mant = (mant + 0x1000) >> 13; // Round‑to‑nearest‑even at bit 10.\n return (sign << 15) | mant;\n }\n\n // 5. Overflow: if the biased exponent is 31 (0x1f) or higher, the number\n // cannot be represented in half precision, so we return ±∞.\n if (exp >= 0x1f) {\n return (sign << 15) | 0x7c00; // ±∞\n }\n\n // 6. Normalised number: round mantissa and pack sign|exp|mant.\n mant = mant + 0x1000; // Add rounding bias at bit 12.\n if (mant & 0x800000) { // The carry propagated out of the top bit; mantissa overflowed.\n mant = 0; // Rounded up to 1.0 × 2^(exp+1).\n ++exp; // Increment exponent (may overflow to ±∞).\n if (exp >= 0x1f) {\n return (sign << 15) | 0x7c00;\n }\n }\n\n return (sign << 15) | (exp << 10) | (mant >> 13);\n}\n\n/**\n * Convert a **binary16** encoded bit pattern back to JavaScript number.\n * @param h 16-bit half-precision bits\n * @returns JavaScript number (64-bit float) with same numerical value\n */\nexport function fromHalfBits(h: number): number {\n const sign = (h & 0x8000) ? -1 : 1; // Sign multiplier (preserves −0).\n const exp = (h >> 10) & 0x1f; // 5‑bit exponent.\n const mant = h & 0x03ff; // 10‑bit significand.\n\n // 1. Zero and sub‑normals.\n if (exp === 0) {\n return mant ? sign * mant * 2 ** -24 : sign * 0;\n }\n\n // 2. Special cases (exp == 31).\n if (exp === 0x1f) {\n return mant\n ? Number.NaN\n : (sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY);\n }\n\n // 3. Normalised numbers.\n return sign * (1 + mant / 1024) * 2 ** (exp - 15);\n}\n\nfunction roundToF16(x: number): number {\n return fromHalfBits(toHalfBits(x));\n}\n\nconst f16Cast = createDualImpl(\n // CPU implementation\n (v?: number | boolean) => {\n if (v === undefined) {\n return 0;\n }\n if (typeof v === 'boolean') {\n return v ? 1 : 0;\n }\n return roundToF16(v);\n },\n // GPU implementation\n // TODO: make usage of f16() in GPU mode check for feature availability and throw if not available\n (v) => snip(`f16(${v?.value ?? ''})`, f16),\n 'f16Cast',\n);\n\n/**\n * A schema that represents a 16-bit float value. (equivalent to `f16` in WGSL)\n *\n * Can also be called to cast a value to an f16.\n *\n * @example\n * const value = f16(); // 0\n * @example\n * const value = f32(1.23); // 1.23\n * @example\n * const value = f16(true); // 1\n * @example\n * const value = f16(21877.5); // 21872\n */\nexport const f16: F16 = Object.assign(f16Cast, {\n type: 'f16',\n}) as unknown as F16;\n","import { $internal } from '../shared/symbols.ts';\nimport type { SelfResolvable } from '../types.ts';\nimport { bool, f16, f32, i32, u32 } from './numeric.ts';\nimport type { VecKind } from './wgslTypes.ts';\n\n// deno-fmt-ignore\nexport abstract class VecBase<S> extends Array implements SelfResolvable {\n public readonly [$internal] = true;\n abstract get kind(): VecKind;\n abstract getElementSchema(): (v?: S) => S;\n\n\n abstract get _Vec2(): new (\n x: S,\n y: S,\n ) => Vec2<S>;\n abstract get _Vec3(): new (\n x: S,\n y: S,\n z: S,\n ) => Vec3<S>;\n abstract get _Vec4(): new (\n x: S,\n y: S,\n z: S,\n w: S,\n ) => Vec4<S>;\n\n '~resolve'(): string {\n return `${this.kind}(${this.join(', ')})`;\n }\n\n toString() {\n return this['~resolve']();\n }\n\n get xx() { return new this._Vec2(this[0], this[0]); }\n get xy() { return new this._Vec2(this[0], this[1]); }\n get xz() { return new this._Vec2(this[0], this[2]); }\n get xw() { return new this._Vec2(this[0], this[3]); }\n get yx() { return new this._Vec2(this[1], this[0]); }\n get yy() { return new this._Vec2(this[1], this[1]); }\n get yz() { return new this._Vec2(this[1], this[2]); }\n get yw() { return new this._Vec2(this[1], this[3]); }\n get zx() { return new this._Vec2(this[2], this[0]); }\n get zy() { return new this._Vec2(this[2], this[1]); }\n get zz() { return new this._Vec2(this[2], this[2]); }\n get zw() { return new this._Vec2(this[2], this[3]); }\n get wx() { return new this._Vec2(this[3], this[0]); }\n get wy() { return new this._Vec2(this[3], this[1]); }\n get wz() { return new this._Vec2(this[3], this[2]); }\n get ww() { return new this._Vec2(this[3], this[3]); }\n get xxx() { return new this._Vec3(this[0], this[0], this[0]); }\n get xxy() { return new this._Vec3(this[0], this[0], this[1]); }\n get xxz() { return new this._Vec3(this[0], this[0], this[2]); }\n get xxw() { return new this._Vec3(this[0], this[0], this[3]); }\n get xyx() { return new this._Vec3(this[0], this[1], this[0]); }\n get xyy() { return new this._Vec3(this[0], this[1], this[1]); }\n get xyz() { return new this._Vec3(this[0], this[1], this[2]); }\n get xyw() { return new this._Vec3(this[0], this[1], this[3]); }\n get xzx() { return new this._Vec3(this[0], this[2], this[0]); }\n get xzy() { return new this._Vec3(this[0], this[2], this[1]); }\n get xzz() { return new this._Vec3(this[0], this[2], this[2]); }\n get xzw() { return new this._Vec3(this[0], this[2], this[3]); }\n get xwx() { return new this._Vec3(this[0], this[3], this[0]); }\n get xwy() { return new this._Vec3(this[0], this[3], this[1]); }\n get xwz() { return new this._Vec3(this[0], this[3], this[2]); }\n get xww() { return new this._Vec3(this[0], this[3], this[3]); }\n get yxx() { return new this._Vec3(this[1], this[0], this[0]); }\n get yxy() { return new this._Vec3(this[1], this[0], this[1]); }\n get yxz() { return new this._Vec3(this[1], this[0], this[2]); }\n get yxw() { return new this._Vec3(this[1], this[0], this[3]); }\n get yyx() { return new this._Vec3(this[1], this[1], this[0]); }\n get yyy() { return new this._Vec3(this[1], this[1], this[1]); }\n get yyz() { return new this._Vec3(this[1], this[1], this[2]); }\n get yyw() { return new this._Vec3(this[1], this[1], this[3]); }\n get yzx() { return new this._Vec3(this[1], this[2], this[0]); }\n get yzy() { return new this._Vec3(this[1], this[2], this[1]); }\n get yzz() { return new this._Vec3(this[1], this[2], this[2]); }\n get yzw() { return new this._Vec3(this[1], this[2], this[3]); }\n get ywx() { return new this._Vec3(this[1], this[3], this[0]); }\n get ywy() { return new this._Vec3(this[1], this[3], this[1]); }\n get ywz() { return new this._Vec3(this[1], this[3], this[2]); }\n get yww() { return new this._Vec3(this[1], this[3], this[3]); }\n get zxx() { return new this._Vec3(this[2], this[0], this[0]); }\n get zxy() { return new this._Vec3(this[2], this[0], this[1]); }\n get zxz() { return new this._Vec3(this[2], this[0], this[2]); }\n get zxw() { return new this._Vec3(this[2], this[0], this[3]); }\n get zyx() { return new this._Vec3(this[2], this[1], this[0]); }\n get zyy() { return new this._Vec3(this[2], this[1], this[1]); }\n get zyz() { return new this._Vec3(this[2], this[1], this[2]); }\n get zyw() { return new this._Vec3(this[2], this[1], this[3]); }\n get zzx() { return new this._Vec3(this[2], this[2], this[0]); }\n get zzy() { return new this._Vec3(this[2], this[2], this[1]); }\n get zzz() { return new this._Vec3(this[2], this[2], this[2]); }\n get zzw() { return new this._Vec3(this[2], this[2], this[3]); }\n get zwx() { return new this._Vec3(this[2], this[3], this[0]); }\n get zwy() { return new this._Vec3(this[2], this[3], this[1]); }\n get zwz() { return new this._Vec3(this[2], this[3], this[2]); }\n get zww() { return new this._Vec3(this[2], this[3], this[3]); }\n get wxx() { return new this._Vec3(this[3], this[0], this[0]); }\n get wxy() { return new this._Vec3(this[3], this[0], this[1]); }\n get wxz() { return new this._Vec3(this[3], this[0], this[2]); }\n get wxw() { return new this._Vec3(this[3], this[0], this[3]); }\n get wyx() { return new this._Vec3(this[3], this[1], this[0]); }\n get wyy() { return new this._Vec3(this[3], this[1], this[1]); }\n get wyz() { return new this._Vec3(this[3], this[1], this[2]); }\n get wyw() { return new this._Vec3(this[3], this[1], this[3]); }\n get wzx() { return new this._Vec3(this[3], this[2], this[0]); }\n get wzy() { return new this._Vec3(this[3], this[2], this[1]); }\n get wzz() { return new this._Vec3(this[3], this[2], this[2]); }\n get wzw() { return new this._Vec3(this[3], this[2], this[3]); }\n get wwx() { return new this._Vec3(this[3], this[3], this[0]); }\n get wwy() { return new this._Vec3(this[3], this[3], this[1]); }\n get wwz() { return new this._Vec3(this[3], this[3], this[2]); }\n get www() { return new this._Vec3(this[3], this[3], this[3]); }\n get xxxx() { return new this._Vec4(this[0], this[0], this[0], this[0]); }\n get xxxy() { return new this._Vec4(this[0], this[0], this[0], this[1]); }\n get xxxz() { return new this._Vec4(this[0], this[0], this[0], this[2]); }\n get xxxw() { return new this._Vec4(this[0], this[0], this[0], this[3]); }\n get xxyx() { return new this._Vec4(this[0], this[0], this[1], this[0]); }\n get xxyy() { return new this._Vec4(this[0], this[0], this[1], this[1]); }\n get xxyz() { return new this._Vec4(this[0], this[0], this[1], this[2]); }\n get xxyw() { return new this._Vec4(this[0], this[0], this[1], this[3]); }\n get xxzx() { return new this._Vec4(this[0], this[0], this[2], this[0]); }\n get xxzy() { return new this._Vec4(this[0], this[0], this[2], this[1]); }\n get xxzz() { return new this._Vec4(this[0], this[0], this[2], this[2]); }\n get xxzw() { return new this._Vec4(this[0], this[0], this[2], this[3]); }\n get xxwx() { return new this._Vec4(this[0], this[0], this[3], this[0]); }\n get xxwy() { return new this._Vec4(this[0], this[0], this[3], this[1]); }\n get xxwz() { return new this._Vec4(this[0], this[0], this[3], this[2]); }\n get xxww() { return new this._Vec4(this[0], this[0], this[3], this[3]); }\n get xyxx() { return new this._Vec4(this[0], this[1], this[0], this[0]); }\n get xyxy() { return new this._Vec4(this[0], this[1], this[0], this[1]); }\n get xyxz() { return new this._Vec4(this[0], this[1], this[0], this[2]); }\n get xyxw() { return new this._Vec4(this[0], this[1], this[0], this[3]); }\n get xyyx() { return new this._Vec4(this[0], this[1], this[1], this[0]); }\n get xyyy() { return new this._Vec4(this[0], this[1], this[1], this[1]); }\n get xyyz() { return new this._Vec4(this[0], this[1], this[1], this[2]); }\n get xyyw() { return new this._Vec4(this[0], this[1], this[1], this[3]); }\n get xyzx() { return new this._Vec4(this[0], this[1], this[2], this[0]); }\n get xyzy() { return new this._Vec4(this[0], this[1], this[2], this[1]); }\n get xyzz() { return new this._Vec4(this[0], this[1], this[2], this[2]); }\n get xyzw() { return new this._Vec4(this[0], this[1], this[2], this[3]); }\n get xywx() { return new this._Vec4(this[0], this[1], this[3], this[0]); }\n get xywy() { return new this._Vec4(this[0], this[1], this[3], this[1]); }\n get xywz() { return new this._Vec4(this[0], this[1], this[3], this[2]); }\n get xyww() { return new this._Vec4(this[0], this[1], this[3], this[3]); }\n get xzxx() { return new this._Vec4(this[0], this[2], this[0], this[0]); }\n get xzxy() { return new this._Vec4(this[0], this[2], this[0], this[1]); }\n get xzxz() { return new this._Vec4(this[0], this[2], this[0], this[2]); }\n get xzxw() { return new this._Vec4(this[0], this[2], this[0], this[3]); }\n get xzyx() { return new this._Vec4(this[0], this[2], this[1], this[0]); }\n get xzyy() { return new this._Vec4(this[0], this[2], this[1], this[1]); }\n get xzyz() { return new this._Vec4(this[0], this[2], this[1], this[2]); }\n get xzyw() { return new this._Vec4(this[0], this[2], this[1], this[3]); }\n get xzzx() { return new this._Vec4(this[0], this[2], this[2], this[0]); }\n get xzzy() { return new this._Vec4(this[0], this[2], this[2], this[1]); }\n get xzzz() { return new this._Vec4(this[0], this[2], this[2], this[2]); }\n get xzzw() { return new this._Vec4(this[0], this[2], this[2], this[3]); }\n get xzwx() { return new this._Vec4(this[0], this[2], this[3], this[0]); }\n get xzwy() { return new this._Vec4(this[0], this[2], this[3], this[1]); }\n get xzwz() { return new this._Vec4(this[0], this[2], this[3], this[2]); }\n get xzww() { return new this._Vec4(this[0], this[2], this[3], this[3]); }\n get xwxx() { return new this._Vec4(this[0], this[3], this[0], this[0]); }\n get xwxy() { return new this._Vec4(this[0], this[3], this[0], this[1]); }\n get xwxz() { return new this._Vec4(this[0], this[3], this[0], this[2]); }\n get xwxw() { return new this._Vec4(this[0], this[3], this[0], this[3]); }\n get xwyx() { return new this._Vec4(this[0], this[3], this[1], this[0]); }\n get xwyy() { return new this._Vec4(this[0], this[3], this[1], this[1]); }\n get xwyz() { return new this._Vec4(this[0], this[3], this[1], this[2]); }\n get xwyw() { return new this._Vec4(this[0], this[3], this[1], this[3]); }\n get xwzx() { return new this._Vec4(this[0], this[3], this[2], this[0]); }\n get xwzy() { return new this._Vec4(this[0], this[3], this[2], this[1]); }\n get xwzz() { return new this._Vec4(this[0], this[3], this[2], this[2]); }\n get xwzw() { return new this._Vec4(this[0], this[3], this[2], this[3]); }\n get xwwx() { return new this._Vec4(this[0], this[3], this[3], this[0]); }\n get xwwy() { return new this._Vec4(this[0], this[3], this[3], this[1]); }\n get xwwz() { return new this._Vec4(this[0], this[3], this[3], this[2]); }\n get xwww() { return new this._Vec4(this[0], this[3], this[3], this[3]); }\n get yxxx() { return new this._Vec4(this[1], this[0], this[0], this[0]); }\n get yxxy() { return new this._Vec4(this[1], this[0], this[0], this[1]); }\n get yxxz() { return new this._Vec4(this[1], this[0], this[0], this[2]); }\n get yxxw() { return new this._Vec4(this[1], this[0], this[0], this[3]); }\n get yxyx() { return new this._Vec4(this[1], this[0], this[1], this[0]); }\n get yxyy() { return new this._Vec4(this[1], this[0], this[1], this[1]); }\n get yxyz() { return new this._Vec4(this[1], this[0], this[1], this[2]); }\n get yxyw() { return new this._Vec4(this[1], this[0], this[1], this[3]); }\n get yxzx() { return new this._Vec4(this[1], this[0], this[2], this[0]); }\n get yxzy() { return new this._Vec4(this[1], this[0], this[2], this[1]); }\n get yxzz() { return new this._Vec4(this[1], this[0], this[2], this[2]); }\n get yxzw() { return new this._Vec4(this[1], this[0], this[2], this[3]); }\n get yxwx() { return new this._Vec4(this[1], this[0], this[3], this[0]); }\n get yxwy() { return new this._Vec4(this[1], this[0], this[3], this[1]); }\n get yxwz() { return new this._Vec4(this[1], this[0], this[3], this[2]); }\n get yxww() { return new this._Vec4(this[1], this[0], this[3], this[3]); }\n get yyxx() { return new this._Vec4(this[1], this[1], this[0], this[0]); }\n get yyxy() { return new this._Vec4(this[1], this[1], this[0], this[1]); }\n get yyxz() { return new this._Vec4(this[1], this[1], this[0], this[2]); }\n get yyxw() { return new this._Vec4(this[1], this[1], this[0], this[3]); }\n get yyyx() { return new this._Vec4(this[1], this[1], this[1], this[0]); }\n get yyyy() { return new this._Vec4(this[1], this[1], this[1], this[1]); }\n get yyyz() { return new this._Vec4(this[1], this[1], this[1], this[2]); }\n get yyyw() { return new this._Vec4(this[1], this[1], this[1], this[3]); }\n get yyzx() { return new this._Vec4(this[1], this[1], this[2], this[0]); }\n get yyzy() { return new this._Vec4(this[1], this[1], this[2], this[1]); }\n get yyzz() { return new this._Vec4(this[1], this[1], this[2], this[2]); }\n get yyzw() { return new this._Vec4(this[1], this[1], this[2], this[3]); }\n get yywx() { return new this._Vec4(this[1], this[1], this[3], this[0]); }\n get yywy() { return new this._Vec4(this[1], this[1], this[3], this[1]); }\n get yywz() { return new this._Vec4(this[1], this[1], this[3], this[2]); }\n get yyww() { return new this._Vec4(this[1], this[1], this[3], this[3]); }\n get yzxx() { return new this._Vec4(this[1], this[2], this[0], this[0]); }\n get yzxy() { return new this._Vec4(this[1], this[2], this[0], this[1]); }\n get yzxz() { return new this._Vec4(this[1], this[2], this[0], this[2]); }\n get yzxw() { return new this._Vec4(this[1], this[2], this[0], this[3]); }\n get yzyx() { return new this._Vec4(this[1], this[2], this[1], this[0]); }\n get yzyy() { return new this._Vec4(this[1], this[2], this[1], this[1]); }\n get yzyz() { return new this._Vec4(this[1], this[2], this[1], this[2]); }\n get yzyw() { return new this._Vec4(this[1], this[2], this[1], this[3]); }\n get yzzx() { return new this._Vec4(this[1], this[2], this[2], this[0]); }\n get yzzy() { return new this._Vec4(this[1], this[2], this[2], this[1]); }\n get yzzz() { return new this._Vec4(this[1], this[2], this[2], this[2]); }\n get yzzw() { return new this._Vec4(this[1], this[2], this[2], this[3]); }\n get yzwx() { return new this._Vec4(this[1], this[2], this[3], this[0]); }\n get yzwy() { return new this._Vec4(this[1], this[2], this[3], this[1]); }\n get yzwz() { return new this._Vec4(this[1], this[2], this[3], this[2]); }\n get yzww() { return new this._Vec4(this[1], this[2], this[3], this[3]); }\n get ywxx() { return new this._Vec4(this[1], this[3], this[0], this[0]); }\n get ywxy() { return new this._Vec4(this[1], this[3], this[0], this[1]); }\n get ywxz() { return new this._Vec4(this[1], this[3], this[0], this[2]); }\n get ywxw() { return new this._Vec4(this[1], this[3], this[0], this[3]); }\n get ywyx() { return new this._Vec4(this[1], this[3], this[1], this[0]); }\n get ywyy() { return new this._Vec4(this[1], this[3], this[1], this[1]); }\n get ywyz() { return new this._Vec4(this[1], this[3], this[1], this[2]); }\n get ywyw() { return new this._Vec4(this[1], this[3], this[1], this[3]); }\n get ywzx() { return new this._Vec4(this[1], this[3], this[2], this[0]); }\n get ywzy() { return new this._Vec4(this[1], this[3], this[2], this[1]); }\n get ywzz() { return new this._Vec4(this[1], this[3], this[2], this[2]); }\n get ywzw() { return new this._Vec4(this[1], this[3], this[2], this[3]); }\n get ywwx() { return new this._Vec4(this[1], this[3], this[3], this[0]); }\n get ywwy() { return new this._Vec4(this[1], this[3], this[3], this[1]); }\n get ywwz() { return new this._Vec4(this[1], this[3], this[3], this[2]); }\n get ywww() { return new this._Vec4(this[1], this[3], this[3], this[3]); }\n get zxxx() { return new this._Vec4(this[2], this[0], this[0], this[0]); }\n get zxxy() { return new this._Vec4(this[2], this[0], this[0], this[1]); }\n get zxxz() { return new this._Vec4(this[2], this[0], this[0], this[2]); }\n get zxxw() { return new this._Vec4(this[2], this[0], this[0], this[3]); }\n get zxyx() { return new this._Vec4(this[2], this[0], this[1], this[0]); }\n get zxyy() { return new this._Vec4(this[2], this[0], this[1], this[1]); }\n get zxyz() { return new this._Vec4(this[2], this[0], this[1], this[2]); }\n get zxyw() { return new this._Vec4(this[2], this[0], this[1], this[3]); }\n get zxzx() { return new this._Vec4(this[2], this[0], this[2], this[0]); }\n get zxzy() { return new this._Vec4(this[2], this[0], this[2], this[1]); }\n get zxzz() { return new this._Vec4(this[2], this[0], this[2], this[2]); }\n get zxzw() { return new this._Vec4(this[2], this[0], this[2], this[3]); }\n get zxwx() { return new this._Vec4(this[2], this[0], this[3], this[0]); }\n get zxwy() { return new this._Vec4(this[2], this[0], this[3], this[1]); }\n get zxwz() { return new this._Vec4(this[2], this[0], this[3], this[2]); }\n get zxww() { return new this._Vec4(this[2], this[0], this[3], this[3]); }\n get zyxx() { return new this._Vec4(this[2], this[1], this[0], this[0]); }\n get zyxy() { return new this._Vec4(this[2], this[1], this[0], this[1]); }\n get zyxz() { return new this._Vec4(this[2], this[1], this[0], this[2]); }\n get zyxw() { return new this._Vec4(this[2], this[1], this[0], this[3]); }\n get zyyx() { return new this._Vec4(this[2], this[1], this[1], this[0]); }\n get zyyy() { return new this._Vec4(this[2], this[1], this[1], this[1]); }\n get zyyz() { return new this._Vec4(this[2], this[1], this[1], this[2]); }\n get zyyw() { return new this._Vec4(this[2], this[1], this[1], this[3]); }\n get zyzx() { return new this._Vec4(this[2], this[1], this[2], this[0]); }\n get zyzy() { return new this._Vec4(this[2], this[1], this[2], this[1]); }\n get zyzz() { return new this._Vec4(this[2], this[1], this[2], this[2]); }\n get zyzw() { return new this._Vec4(this[2], this[1], this[2], this[3]); }\n get zywx() { return new this._Vec4(this[2], this[1], this[3], this[0]); }\n get zywy() { return new this._Vec4(this[2], this[1], this[3], this[1]); }\n get zywz() { return new this._Vec4(this[2], this[1], this[3], this[2]); }\n get zyww() { return new this._Vec4(this[2], this[1], this[3], this[3]); }\n get zzxx() { return new this._Vec4(this[2], this[2], this[0], this[0]); }\n get zzxy() { return new this._Vec4(this[2], this[2], this[0], this[1]); }\n get zzxz() { return new this._Vec4(this[2], this[2], this[0], this[2]); }\n get zzxw() { return new this._Vec4(this[2], this[2], this[0], this[3]); }\n get zzyx() { return new this._Vec4(this[2], this[2], this[1], this[0]); }\n get zzyy() { return new this._Vec4(this[2], this[2], this[1], this[1]); }\n get zzyz() { return new this._Vec4(this[2], this[2], this[1], this[2]); }\n get zzyw() { return new this._Vec4(this[2], this[2], this[1], this[3]); }\n get zzzx() { return new this._Vec4(this[2], this[2], this[2], this[0]); }\n get zzzy() { return new this._Vec4(this[2], this[2], this[2], this[1]); }\n get zzzz() { return new this._Vec4(this[2], this[2], this[2], this[2]); }\n get zzzw() { return new this._Vec4(this[2], this[2], this[2], this[3]); }\n get zzwx() { return new this._Vec4(this[2], this[2], this[3], this[0]); }\n get zzwy() { return new this._Vec4(this[2], this[2], this[3], this[1]); }\n get zzwz() { return new this._Vec4(this[2], this[2], this[3], this[2]); }\n get zzww() { return new this._Vec4(this[2], this[2], this[3], this[3]); }\n get zwxx() { return new this._Vec4(this[2], this[3], this[0], this[0]); }\n get zwxy() { return new this._Vec4(this[2], this[3], this[0], this[1]); }\n get zwxz() { return new this._Vec4(this[2], this[3], this[0], this[2]); }\n get zwxw() { return new this._Vec4(this[2], this[3], this[0], this[3]); }\n get zwyx() { return new this._Vec4(this[2], this[3], this[1], this[0]); }\n get zwyy() { return new this._Vec4(this[2], this[3], this[1], this[1]); }\n get zwyz() { return new this._Vec4(this[2], this[3], this[1], this[2]); }\n get zwyw() { return new this._Vec4(this[2], this[3], this[1], this[3]); }\n get zwzx() { return new this._Vec4(this[2], this[3], this[2], this[0]); }\n get zwzy() { return new this._Vec4(this[2], this[3], this[2], this[1]); }\n get zwzz() { return new this._Vec4(this[2], this[3], this[2], this[2]); }\n get zwzw() { return new this._Vec4(this[2], this[3], this[2], this[3]); }\n get zwwx() { return new this._Vec4(this[2], this[3], this[3], this[0]); }\n get zwwy() { return new this._Vec4(this[2], this[3], this[3], this[1]); }\n get zwwz() { return new this._Vec4(this[2], this[3], this[3], this[2]); }\n get zwww() { return new this._Vec4(this[2], this[3], this[3], this[3]); }\n get wxxx() { return new this._Vec4(this[3], this[0], this[0], this[0]); }\n get wxxy() { return new this._Vec4(this[3], this[0], this[0], this[1]); }\n get wxxz() { return new this._Vec4(this[3], this[0], this[0], this[2]); }\n get wxxw() { return new this._Vec4(this[3], this[0], this[0], this[3]); }\n get wxyx() { return new this._Vec4(this[3], this[0], this[1], this[0]); }\n get wxyy() { return new this._Vec4(this[3], this[0], this[1], this[1]); }\n get wxyz() { return new this._Vec4(this[3], this[0], this[1], this[2]); }\n get wxyw() { return new this._Vec4(this[3], this[0], this[1], this[3]); }\n get wxzx() { return new this._Vec4(this[3], this[0], this[2], this[0]); }\n get wxzy() { return new this._Vec4(this[3], this[0], this[2], this[1]); }\n get wxzz() { return new this._Vec4(this[3], this[0], this[2], this[2]); }\n get wxzw() { return new this._Vec4(this[3], this[0], this[2], this[3]); }\n get wxwx() { return new this._Vec4(this[3], this[0], this[3], this[0]); }\n get wxwy() { return new this._Vec4(this[3], this[0], this[3], this[1]); }\n get wxwz() { return new this._Vec4(this[3], this[0], this[3], this[2]); }\n get wxww() { return new this._Vec4(this[3], this[0], this[3], this[3]); }\n get wyxx() { return new this._Vec4(this[3], this[1], this[0], this[0]); }\n get wyxy() { return new this._Vec4(this[3], this[1], this[0], this[1]); }\n get wyxz() { return new this._Vec4(this[3], this[1], this[0], this[2]); }\n get wyxw() { return new this._Vec4(this[3], this[1], this[0], this[3]); }\n get wyyx() { return new this._Vec4(this[3], this[1], this[1], this[0]); }\n get wyyy() { return new this._Vec4(this[3], this[1], this[1], this[1]); }\n get wyyz() { return new this._Vec4(this[3], this[1], this[1], this[2]); }\n get wyyw() { return new this._Vec4(this[3], this[1], this[1], this[3]); }\n get wyzx() { return new this._Vec4(this[3], this[1], this[2], this[0]); }\n get wyzy() { return new this._Vec4(this[3], this[1], this[2], this[1]); }\n get wyzz() { return new this._Vec4(this[3], this[1], this[2], this[2]); }\n get wyzw() { return new this._Vec4(this[3], this[1], this[2], this[3]); }\n get wywx() { return new this._Vec4(this[3], this[1], this[3], this[0]); }\n get wywy() { return new this._Vec4(this[3], this[1], this[3], this[1]); }\n get wywz() { return new this._Vec4(this[3], this[1], this[3], this[2]); }\n get wyww() { return new this._Vec4(this[3], this[1], this[3], this[3]); }\n get wzxx() { return new this._Vec4(this[3], this[2], this[0], this[0]); }\n get wzxy() { return new this._Vec4(this[3], this[2], this[0], this[1]); }\n get wzxz() { return new this._Vec4(this[3], this[2], this[0], this[2]); }\n get wzxw() { return new this._Vec4(this[3], this[2], this[0], this[3]); }\n get wzyx() { return new this._Vec4(this[3], this[2], this[1], this[0]); }\n get wzyy() { return new this._Vec4(this[3], this[2], this[1], this[1]); }\n get wzyz() { return new this._Vec4(this[3], this[2], this[1], this[2]); }\n get wzyw() { return new this._Vec4(this[3], this[2], this[1], this[3]); }\n get wzzx() { return new this._Vec4(this[3], this[2], this[2], this[0]); }\n get wzzy() { return new this._Vec4(this[3], this[2], this[2], this[1]); }\n get wzzz() { return new this._Vec4(this[3], this[2], this[2], this[2]); }\n get wzzw() { return new this._Vec4(this[3], this[2], this[2], this[3]); }\n get wzwx() { return new this._Vec4(this[3], this[2], this[3], this[0]); }\n get wzwy() { return new this._Vec4(this[3], this[2], this[3], this[1]); }\n get wzwz() { return new this._Vec4(this[3], this[2], this[3], this[2]); }\n get wzww() { return new this._Vec4(this[3], this[2], this[3], this[3]); }\n get wwxx() { return new this._Vec4(this[3], this[3], this[0], this[0]); }\n get wwxy() { return new this._Vec4(this[3], this[3], this[0], this[1]); }\n get wwxz() { return new this._Vec4(this[3], this[3], this[0], this[2]); }\n get wwxw() { return new this._Vec4(this[3], this[3], this[0], this[3]); }\n get wwyx() { return new this._Vec4(this[3], this[3], this[1], this[0]); }\n get wwyy() { return new this._Vec4(this[3], this[3], this[1], this[1]); }\n get wwyz() { return new this._Vec4(this[3], this[3], this[1], this[2]); }\n get wwyw() { return new this._Vec4(this[3], this[3], this[1], this[3]); }\n get wwzx() { return new this._Vec4(this[3], this[3], this[2], this[0]); }\n get wwzy() { return new this._Vec4(this[3], this[3], this[2], this[1]); }\n get wwzz() { return new this._Vec4(this[3], this[3], this[2], this[2]); }\n get wwzw() { return new this._Vec4(this[3], this[3], this[2], this[3]); }\n get wwwx() { return new this._Vec4(this[3], this[3], this[3], this[0]); }\n get wwwy() { return new this._Vec4(this[3], this[3], this[3], this[1]); }\n get wwwz() { return new this._Vec4(this[3], this[3], this[3], this[2]); }\n get wwww() { return new this._Vec4(this[3], this[3], this[3], this[3]); }\n}\n\ntype Tuple2<S> = [S, S];\ntype Tuple3<S> = [S, S, S];\ntype Tuple4<S> = [S, S, S, S];\n\nabstract class Vec2<S> extends VecBase<S> implements Tuple2<S> {\n declare readonly length: 2;\n\n e0: S;\n e1: S;\n\n constructor(x?: S, y?: S) {\n super(2);\n this.e0 = this.getElementSchema()(x);\n this.e1 = this.getElementSchema()(y ?? x);\n }\n\n get [0]() {\n return this.e0;\n }\n\n get [1]() {\n return this.e1;\n }\n\n set [0](value: S) {\n this.e0 = this.getElementSchema()(value);\n }\n\n set [1](value: S) {\n this.e1 = this.getElementSchema()(value);\n }\n\n get x() {\n return this[0];\n }\n\n get y() {\n return this[1];\n }\n\n set x(value: S) {\n this[0] = this.getElementSchema()(value);\n }\n\n set y(value: S) {\n this[1] = this.getElementSchema()(value);\n }\n}\n\nabstract class Vec3<S> extends VecBase<S> implements Tuple3<S> {\n declare readonly length: 3;\n\n e0: S;\n e1: S;\n e2: S;\n\n constructor(x?: S, y?: S, z?: S) {\n super(3);\n this.e0 = this.getElementSchema()(x);\n this.e1 = this.getElementSchema()(y ?? x);\n this.e2 = this.getElementSchema()(z ?? x);\n }\n\n get [0]() {\n return this.e0;\n }\n\n get [1]() {\n return this.e1;\n }\n\n get [2]() {\n return this.e2;\n }\n\n set [0](value: S) {\n this.e0 = this.getElementSchema()(value);\n }\n\n set [1](value: S) {\n this.e1 = this.getElementSchema()(value);\n }\n\n set [2](value: S) {\n this.e2 = this.getElementSchema()(value);\n }\n\n get x() {\n return this[0];\n }\n\n get y() {\n return this[1];\n }\n\n get z() {\n return this[2];\n }\n\n set x(value: S) {\n this[0] = this.getElementSchema()(value);\n }\n\n set y(value: S) {\n this[1] = this.getElementSchema()(value);\n }\n\n set z(value: S) {\n this[2] = this.getElementSchema()(value);\n }\n}\n\nabstract class Vec4<S> extends VecBase<S> implements Tuple4<S> {\n declare readonly length: 4;\n\n e0: S;\n e1: S;\n e2: S;\n e3: S;\n\n constructor(x?: S, y?: S, z?: S, w?: S) {\n super(4);\n this.e0 = this.getElementSchema()(x);\n this.e1 = this.getElementSchema()(y ?? x);\n this.e2 = this.getElementSchema()(z ?? x);\n this.e3 = this.getElementSchema()(w ?? x);\n }\n\n get [0]() {\n return this.e0;\n }\n\n get [1]() {\n return this.e1;\n }\n\n get [2]() {\n return this.e2;\n }\n\n get [3]() {\n return this.e3;\n }\n\n set [0](value: S) {\n this.e0 = this.getElementSchema()(value);\n }\n\n set [1](value: S) {\n this.e1 = this.getElementSchema()(value);\n }\n\n set [2](value: S) {\n this.e2 = this.getElementSchema()(value);\n }\n\n set [3](value: S) {\n this.e3 = this.getElementSchema()(value);\n }\n\n get x() {\n return this[0];\n }\n\n get y() {\n return this[1];\n }\n\n get z() {\n return this[2];\n }\n\n get w() {\n return this[3];\n }\n\n set x(value: S) {\n this[0] = value;\n }\n\n set y(value: S) {\n this[1] = value;\n }\n\n set z(value: S) {\n this[2] = value;\n }\n\n set w(value: S) {\n this[3] = value;\n }\n}\n\nexport class Vec2fImpl extends Vec2<number> {\n getElementSchema() {\n return f32;\n }\n get kind() {\n return 'vec2f' as const;\n }\n\n get _Vec2() {\n return Vec2fImpl;\n }\n get _Vec3() {\n return Vec3fImpl;\n }\n get _Vec4() {\n return Vec4fImpl;\n }\n}\n\nexport class Vec2hImpl extends Vec2<number> {\n getElementSchema() {\n return f16;\n }\n get kind() {\n return 'vec2h' as const;\n }\n\n get _Vec2() {\n return Vec2hImpl;\n }\n get _Vec3() {\n return Vec3hImpl;\n }\n get _Vec4() {\n return Vec4hImpl;\n }\n}\n\nexport class Vec2iImpl extends Vec2<number> {\n getElementSchema() {\n return i32;\n }\n get kind() {\n return 'vec2i' as const;\n }\n\n get _Vec2() {\n return Vec2iImpl;\n }\n get _Vec3() {\n return Vec3iImpl;\n }\n get _Vec4() {\n return Vec4iImpl;\n }\n}\n\nexport class Vec2uImpl extends Vec2<number> {\n getElementSchema() {\n return u32;\n }\n get kind() {\n return 'vec2u' as const;\n }\n\n get _Vec2() {\n return Vec2uImpl;\n }\n get _Vec3() {\n return Vec3uImpl;\n }\n get _Vec4() {\n return Vec4uImpl;\n }\n}\n\nexport class Vec2bImpl extends Vec2<boolean> {\n getElementSchema() {\n return bool;\n }\n get kind() {\n return 'vec2<bool>' as const;\n }\n\n get _Vec2() {\n return Vec2bImpl;\n }\n get _Vec3() {\n return Vec3bImpl;\n }\n get _Vec4() {\n return Vec4bImpl;\n }\n}\n\nexport class Vec3fImpl extends Vec3<number> {\n getElementSchema() {\n return f32;\n }\n get kind() {\n return 'vec3f' as const;\n }\n\n get _Vec2() {\n return Vec2fImpl;\n }\n get _Vec3() {\n return Vec3fImpl;\n }\n get _Vec4() {\n return Vec4fImpl;\n }\n}\n\nexport class Vec3hImpl extends Vec3<number> {\n getElementSchema() {\n return f16;\n }\n get kind() {\n return 'vec3h' as const;\n }\n\n get _Vec2() {\n return Vec2hImpl;\n }\n get _Vec3() {\n return Vec3hImpl;\n }\n get _Vec4() {\n return Vec4hImpl;\n }\n}\n\nexport class Vec3iImpl extends Vec3<number> {\n getElementSchema() {\n return i32;\n }\n get kind() {\n return 'vec3i' as const;\n }\n\n get _Vec2() {\n return Vec2iImpl;\n }\n get _Vec3() {\n return Vec3iImpl;\n }\n get _Vec4() {\n return Vec4iImpl;\n }\n}\n\nexport class Vec3uImpl extends Vec3<number> {\n getElementSchema() {\n return u32;\n }\n get kind() {\n return 'vec3u' as const;\n }\n\n get _Vec2() {\n return Vec2uImpl;\n }\n get _Vec3() {\n return Vec3uImpl;\n }\n get _Vec4() {\n return Vec4uImpl;\n }\n}\n\nexport class Vec3bImpl extends Vec3<boolean> {\n getElementSchema() {\n return bool;\n }\n get kind() {\n return 'vec3<bool>' as const;\n }\n\n get _Vec2() {\n return Vec2bImpl;\n }\n get _Vec3() {\n return Vec3bImpl;\n }\n get _Vec4() {\n return Vec4bImpl;\n }\n}\n\nexport class Vec4fImpl extends Vec4<number> {\n getElementSchema() {\n return f32;\n }\n get kind() {\n return 'vec4f' as const;\n }\n\n get _Vec2() {\n return Vec2fImpl;\n }\n get _Vec3() {\n return Vec3fImpl;\n }\n get _Vec4() {\n return Vec4fImpl;\n }\n}\n\nexport class Vec4hImpl extends Vec4<number> {\n getElementSchema() {\n return f16;\n }\n get kind() {\n return 'vec4h' as const;\n }\n\n get _Vec2() {\n return Vec2hImpl;\n }\n get _Vec3() {\n return Vec3hImpl;\n }\n get _Vec4() {\n return Vec4hImpl;\n }\n}\n\nexport class Vec4iImpl extends Vec4<number> {\n getElementSchema() {\n return i32;\n }\n get kind() {\n return 'vec4i' as const;\n }\n\n get _Vec2() {\n return Vec2iImpl;\n }\n get _Vec3() {\n return Vec3iImpl;\n }\n get _Vec4() {\n return Vec4iImpl;\n }\n}\n\nexport class Vec4uImpl extends Vec4<number> {\n getElementSchema() {\n return u32;\n }\n get kind() {\n return 'vec4u' as const;\n }\n\n get _Vec2() {\n return Vec2uImpl;\n }\n get _Vec3() {\n return Vec3uImpl;\n }\n get _Vec4() {\n return Vec4uImpl;\n }\n}\n\nexport class Vec4bImpl extends Vec4<boolean> {\n getElementSchema() {\n return bool;\n }\n get kind() {\n return 'vec4<bool>' as const;\n }\n\n get _Vec2() {\n return Vec2bImpl;\n }\n get _Vec3() {\n return Vec3bImpl;\n }\n get _Vec4() {\n return Vec4bImpl;\n }\n}\n","import { createDualImpl } from '../core/function/dualImpl.ts';\nimport { $repr } from '../shared/symbols.ts';\nimport { snip } from './snippet.ts';\nimport { bool, f16, f32, i32, u32 } from './numeric.ts';\nimport {\n Vec2bImpl,\n Vec2fImpl,\n Vec2hImpl,\n Vec2iImpl,\n Vec2uImpl,\n Vec3bImpl,\n Vec3fImpl,\n Vec3hImpl,\n Vec3iImpl,\n Vec3uImpl,\n Vec4bImpl,\n Vec4fImpl,\n Vec4hImpl,\n Vec4iImpl,\n Vec4uImpl,\n type VecBase,\n} from './vectorImpl.ts';\nimport type {\n AnyVecInstance,\n AnyWgslData,\n Decorated,\n Vec2b,\n Vec2f,\n Vec2h,\n Vec2i,\n Vec2u,\n Vec3b,\n Vec3f,\n Vec3h,\n Vec3i,\n Vec3u,\n Vec4b,\n Vec4f,\n Vec4h,\n Vec4i,\n Vec4u,\n} from './wgslTypes.ts';\nimport { isDecorated, isVec } from './wgslTypes.ts';\n\n// ----------\n// Public API\n// ----------\n\n/**\n * Schema representing vec2f - a vector with 2 elements of type f32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec2f(); // (0.0, 0.0)\n * const vector = d.vec2f(1); // (1.0, 1.0)\n * const vector = d.vec2f(0.5, 0.1); // (0.5, 0.1)\n *\n * @example\n * const buffer = root.createBuffer(d.vec2f, d.vec2f(0, 1)); // buffer holding a d.vec2f value, with an initial value of vec2f(0, 1);\n */\nexport const vec2f = makeVecSchema(Vec2fImpl) as Vec2f;\n\n/**\n * Schema representing vec2h - a vector with 2 elements of type f16.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec2h(); // (0.0, 0.0)\n * const vector = d.vec2h(1); // (1.0, 1.0)\n * const vector = d.vec2h(0.5, 0.1); // (0.5, 0.1)\n *\n * @example\n * const buffer = root.createBuffer(d.vec2h, d.vec2h(0, 1)); // buffer holding a d.vec2h value, with an initial value of vec2h(0, 1);\n */\nexport const vec2h = makeVecSchema(Vec2hImpl) as Vec2h;\n\n/**\n * Schema representing vec2i - a vector with 2 elements of type i32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec2i(); // (0, 0)\n * const vector = d.vec2i(1); // (1, 1)\n * const vector = d.vec2i(-1, 1); // (-1, 1)\n *\n * @example\n * const buffer = root.createBuffer(d.vec2i, d.vec2i(0, 1)); // buffer holding a d.vec2i value, with an initial value of vec2i(0, 1);\n */\nexport const vec2i = makeVecSchema(Vec2iImpl) as Vec2i;\n\n/**\n * Schema representing vec2u - a vector with 2 elements of type u32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec2u(); // (0, 0)\n * const vector = d.vec2u(1); // (1, 1)\n * const vector = d.vec2u(1, 2); // (1, 2)\n *\n * @example\n * const buffer = root.createBuffer(d.vec2u, d.vec2u(0, 1)); // buffer holding a d.vec2u value, with an initial value of vec2u(0, 1);\n */\nexport const vec2u = makeVecSchema(Vec2uImpl) as Vec2u;\n\n/**\n * Schema representing `vec2<bool>` - a vector with 2 elements of type `bool`.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec2b(); // (false, false)\n * const vector = d.vec2b(true); // (true, true)\n * const vector = d.vec2b(false, true); // (false, true)\n */\nexport const vec2b = makeVecSchema(Vec2bImpl) as Vec2b;\n\n/**\n * Schema representing vec3f - a vector with 3 elements of type f32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec3f(); // (0.0, 0.0, 0.0)\n * const vector = d.vec3f(1); // (1.0, 1.0, 1.0)\n * const vector = d.vec3f(1, 2, 3.5); // (1.0, 2.0, 3.5)\n *\n * @example\n * const buffer = root.createBuffer(d.vec3f, d.vec3f(0, 1, 2)); // buffer holding a d.vec3f value, with an initial value of vec3f(0, 1, 2);\n */\nexport const vec3f = makeVecSchema(Vec3fImpl) as Vec3f;\n\n/**\n * Schema representing vec3h - a vector with 3 elements of type f16.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec3h(); // (0.0, 0.0, 0.0)\n * const vector = d.vec3h(1); // (1.0, 1.0, 1.0)\n * const vector = d.vec3h(1, 2, 3.5); // (1.0, 2.0, 3.5)\n *\n * @example\n * const buffer = root.createBuffer(d.vec3h, d.vec3h(0, 1, 2)); // buffer holding a d.vec3h value, with an initial value of vec3h(0, 1, 2);\n */\nexport const vec3h = makeVecSchema(Vec3hImpl) as Vec3h;\n\n/**\n * Schema representing vec3i - a vector with 3 elements of type i32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec3i(); // (0, 0, 0)\n * const vector = d.vec3i(1); // (1, 1, 1)\n * const vector = d.vec3i(1, 2, -3); // (1, 2, -3)\n *\n * @example\n * const buffer = root.createBuffer(d.vec3i, d.vec3i(0, 1, 2)); // buffer holding a d.vec3i value, with an initial value of vec3i(0, 1, 2);\n */\nexport const vec3i = makeVecSchema(Vec3iImpl) as Vec3i;\n\n/**\n * Schema representing vec3u - a vector with 3 elements of type u32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec3u(); // (0, 0, 0)\n * const vector = d.vec3u(1); // (1, 1, 1)\n * const vector = d.vec3u(1, 2, 3); // (1, 2, 3)\n *\n * @example\n * const buffer = root.createBuffer(d.vec3u, d.vec3u(0, 1, 2)); // buffer holding a d.vec3u value, with an initial value of vec3u(0, 1, 2);\n */\nexport const vec3u = makeVecSchema(Vec3uImpl) as Vec3u;\n\n/**\n * Schema representing `vec3<bool>` - a vector with 3 elements of type `bool`.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec3b(); // (false, false, false)\n * const vector = d.vec3b(true); // (true, true, true)\n * const vector = d.vec3b(false, true, false); // (false, true, false)\n */\nexport const vec3b = makeVecSchema(Vec3bImpl) as Vec3b;\n\n/**\n * Schema representing vec4f - a vector with 4 elements of type f32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec4f(); // (0.0, 0.0, 0.0, 0.0)\n * const vector = d.vec4f(1); // (1.0, 1.0, 1.0, 1.0)\n * const vector = d.vec4f(1, 2, 3, 4.5); // (1.0, 2.0, 3.0, 4.5)\n *\n * @example\n * const buffer = root.createBuffer(d.vec4f, d.vec4f(0, 1, 2, 3)); // buffer holding a d.vec4f value, with an initial value of vec4f(0, 1, 2, 3);\n */\nexport const vec4f = makeVecSchema(Vec4fImpl) as Vec4f;\n\n/**\n * Schema representing vec4h - a vector with 4 elements of type f16.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec4h(); // (0.0, 0.0, 0.0, 0.0)\n * const vector = d.vec4h(1); // (1.0, 1.0, 1.0, 1.0)\n * const vector = d.vec4h(1, 2, 3, 4.5); // (1.0, 2.0, 3.0, 4.5)\n *\n * @example\n * const buffer = root.createBuffer(d.vec4h, d.vec4h(0, 1, 2, 3)); // buffer holding a d.vec4h value, with an initial value of vec4h(0, 1, 2, 3);\n */\nexport const vec4h = makeVecSchema(Vec4hImpl) as Vec4h;\n\n/**\n * Schema representing vec4i - a vector with 4 elements of type i32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec4i(); // (0, 0, 0, 0)\n * const vector = d.vec4i(1); // (1, 1, 1, 1)\n * const vector = d.vec4i(1, 2, 3, -4); // (1, 2, 3, -4)\n *\n * @example\n * const buffer = root.createBuffer(d.vec4i, d.vec4i(0, 1, 2, 3)); // buffer holding a d.vec4i value, with an initial value of vec4i(0, 1, 2, 3);\n */\nexport const vec4i = makeVecSchema(Vec4iImpl) as Vec4i;\n\n/**\n * Schema representing vec4u - a vector with 4 elements of type u32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec4u(); // (0, 0, 0, 0)\n * const vector = d.vec4u(1); // (1, 1, 1, 1)\n * const vector = d.vec4u(1, 2, 3, 4); // (1, 2, 3, 4)\n *\n * @example\n * const buffer = root.createBuffer(d.vec4u, d.vec4u(0, 1, 2, 3)); // buffer holding a d.vec4u value, with an initial value of vec4u(0, 1, 2, 3);\n */\nexport const vec4u = makeVecSchema(Vec4uImpl) as Vec4u;\n\n/**\n * Schema representing `vec4<bool>` - a vector with 4 elements of type `bool`.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec4b(); // (false, false, false, false)\n * const vector = d.vec4b(true); // (true, true, true, true)\n * const vector = d.vec4b(false, true, false, true); // (false, true, false, true)\n */\nexport const vec4b = makeVecSchema(Vec4bImpl) as Vec4b;\n\n// --------------\n// Implementation\n// --------------\n\nexport const vecTypeToConstructor = {\n vec2f,\n vec2h,\n vec2i,\n vec2u,\n 'vec2<bool>': vec2b,\n vec3f,\n vec3h,\n vec3i,\n vec3u,\n 'vec3<bool>': vec3b,\n vec4f,\n vec4h,\n vec4i,\n vec4u,\n 'vec4<bool>': vec4b,\n} as const;\n\nexport const vecTypeToPrimitive = {\n vec2f: f32,\n vec2h: f16,\n vec2i: i32,\n vec2u: u32,\n 'vec2<bool>': bool,\n vec3f: f32,\n vec3h: f16,\n vec3i: i32,\n vec3u: u32,\n 'vec3<bool>': bool,\n vec4f: f32,\n vec4h: f16,\n vec4i: i32,\n vec4u: u32,\n 'vec4<bool>': bool,\n} as const;\n\ntype VecSchemaBase<TValue> = {\n readonly type: string;\n readonly [$repr]: TValue;\n};\n\nfunction makeVecSchema<TValue, S extends number | boolean>(\n VecImpl: new (...args: S[]) => VecBase<S>,\n): VecSchemaBase<TValue> & ((...args: (S | AnyVecInstance)[]) => TValue) {\n const { kind: type, length: componentCount } = new VecImpl();\n\n const construct = createDualImpl(\n (...args: (S | AnyVecInstance)[]): TValue => {\n const values = new Array(args.length);\n\n let j = 0;\n for (const arg of args) {\n if (typeof arg === 'number' || typeof arg === 'boolean') {\n values[j++] = arg;\n } else {\n for (let c = 0; c < arg.length; ++c) {\n values[j++] = arg[c];\n }\n }\n }\n\n if (values.length <= 1 || values.length === componentCount) {\n return new VecImpl(...values) as TValue;\n }\n\n throw new Error(\n `'${type}' constructor called with invalid number of arguments.`,\n );\n },\n (...args) =>\n snip(\n `${type}(${args.map((v) => v.value).join(', ')})`,\n vecTypeToConstructor[type],\n ),\n type,\n (...args) =>\n args.map((arg) => {\n let argType = arg.dataType;\n if (isDecorated(argType)) {\n argType = (argType as Decorated).inner as AnyWgslData;\n }\n\n return isVec(argType) ? argType : vecTypeToPrimitive[type];\n }),\n );\n\n return Object.assign(construct, {\n type,\n [$repr]: undefined as TValue,\n });\n}\n","import { createDualImpl } from '../core/function/dualImpl.ts';\nimport type { $repr } from '../shared/symbols.ts';\nimport { $internal } from '../shared/symbols.ts';\nimport type { SelfResolvable } from '../types.ts';\nimport { snip } from './snippet.ts';\nimport { vec2f, vec3f, vec4f } from './vector.ts';\nimport type {\n AnyWgslData,\n m2x2f,\n m3x3f,\n m4x4f,\n mat2x2,\n Mat2x2f,\n mat3x3,\n Mat3x3f,\n mat4x4,\n Mat4x4f,\n NumberArrayView,\n v2f,\n v3f,\n v4f,\n VecKind,\n} from './wgslTypes.ts';\n\n// --------------\n// Implementation\n// --------------\n\ntype vBase = {\n kind: VecKind;\n length: number;\n [n: number]: number;\n};\n\nexport abstract class MatBase<TColumn> implements NumberArrayView {\n abstract readonly [$internal]: true;\n abstract readonly columns: readonly TColumn[];\n\n abstract readonly length: number;\n abstract [Symbol.iterator](): Iterator<number>;\n [n: number]: number;\n}\n\ninterface MatSchemaOptions<TType extends string, ColumnType> {\n type: TType;\n rows: 2 | 3 | 4;\n columns: 2 | 3 | 4;\n MatImpl: new (...args: number[]) => MatBase<ColumnType>;\n}\n\ntype MatConstructor<\n ValueType extends MatBase<ColumnType>,\n ColumnType extends vBase,\n> = (...args: (number | ColumnType)[]) => ValueType;\n\nfunction createMatSchema<\n TType extends string,\n ValueType extends MatBase<ColumnType>,\n ColumnType extends vBase,\n>(\n options: MatSchemaOptions<TType, ColumnType>,\n): { type: TType; [$repr]: ValueType } & MatConstructor<ValueType, ColumnType> {\n const MatSchema = {\n [$internal]: true,\n type: options.type,\n identity: identityFunctions[options.columns],\n translation: options.columns === 4 ? translation4 : undefined,\n scaling: options.columns === 4 ? scaling4 : undefined,\n rotationX: options.columns === 4 ? rotationX4 : undefined,\n rotationY: options.columns === 4 ? rotationY4 : undefined,\n rotationZ: options.columns === 4 ? rotationZ4 : undefined,\n } as unknown as AnyWgslData;\n\n const construct = createDualImpl(\n // CPU implementation\n (...args: (number | ColumnType)[]): ValueType => {\n const elements: number[] = [];\n\n for (const arg of args) {\n if (typeof arg === 'number') {\n elements.push(arg);\n } else {\n for (let i = 0; i < arg.length; ++i) {\n elements.push(arg[i] as number);\n }\n }\n }\n\n if (\n elements.length !== 0 &&\n elements.length !== options.columns * options.rows\n ) {\n throw new Error(\n `'${options.type}' constructor called with invalid number of arguments.`,\n );\n }\n\n for (let i = elements.length; i < options.columns * options.rows; ++i) {\n elements.push(0);\n }\n\n return new options.MatImpl(...elements) as ValueType;\n },\n // GPU implementation\n (...args) =>\n snip(\n `${MatSchema.type}(${args.map((v) => v.value).join(', ')})`,\n MatSchema,\n ),\n MatSchema.type,\n );\n\n return Object.assign(construct, MatSchema) as unknown as {\n type: TType;\n [$repr]: ValueType;\n } & MatConstructor<ValueType, ColumnType>;\n}\n\nabstract class mat2x2Impl<TColumn extends v2f> extends MatBase<TColumn>\n implements mat2x2<TColumn>, SelfResolvable {\n public readonly [$internal] = true;\n public readonly columns: readonly [TColumn, TColumn];\n public readonly length = 4;\n public abstract readonly kind: string;\n [n: number]: number;\n\n constructor(...elements: number[]) {\n super();\n this.columns = [\n this.makeColumn(elements[0] as number, elements[1] as number),\n this.makeColumn(elements[2] as number, elements[3] as number),\n ];\n }\n\n abstract makeColumn(e0: number, e1: number): TColumn;\n\n get [0]() {\n return this.columns[0].x;\n }\n\n get [1]() {\n return this.columns[0].y;\n }\n\n get [2]() {\n return this.columns[1].x;\n }\n\n get [3]() {\n return this.columns[1].y;\n }\n\n set [0](value: number) {\n this.columns[0].x = value;\n }\n\n set [1](value: number) {\n this.columns[0].y = value;\n }\n\n set [2](value: number) {\n this.columns[1].x = value;\n }\n\n set [3](value: number) {\n this.columns[1].y = value;\n }\n\n *[Symbol.iterator]() {\n yield this[0];\n yield this[1];\n yield this[2];\n yield this[3];\n }\n\n '~resolve'(): string {\n return `${this.kind}(${\n Array.from({ length: this.length })\n .map((_, i) => this[i])\n .join(', ')\n })`;\n }\n}\n\nclass mat2x2fImpl extends mat2x2Impl<v2f> {\n public readonly kind = 'mat2x2f';\n\n makeColumn(e0: number, e1: number): v2f {\n return vec2f(e0, e1);\n }\n}\n\nabstract class mat3x3Impl<TColumn extends v3f> extends MatBase<TColumn>\n implements mat3x3<TColumn>, SelfResolvable {\n public readonly [$internal] = true;\n public readonly columns: readonly [TColumn, TColumn, TColumn];\n public readonly length = 12;\n public abstract readonly kind: string;\n [n: number]: number;\n\n constructor(...elements: number[]) {\n super();\n this.columns = [\n this.makeColumn(\n elements[0] as number,\n elements[1] as number,\n elements[2] as number,\n ),\n this.makeColumn(\n elements[3] as number,\n elements[4] as number,\n elements[5] as number,\n ),\n this.makeColumn(\n elements[6] as number,\n elements[7] as number,\n elements[8] as number,\n ),\n ];\n }\n\n abstract makeColumn(x: number, y: number, z: number): TColumn;\n\n get [0]() {\n return this.columns[0].x;\n }\n\n get [1]() {\n return this.columns[0].y;\n }\n\n get [2]() {\n return this.columns[0].z;\n }\n\n get [3]() {\n return 0;\n }\n\n get [4]() {\n return this.columns[1].x;\n }\n\n get [5]() {\n return this.columns[1].y;\n }\n\n get [6]() {\n return this.columns[1].z;\n }\n\n get [7]() {\n return 0;\n }\n\n get [8]() {\n return this.columns[2].x;\n }\n\n get [9]() {\n return this.columns[2].y;\n }\n\n get [10]() {\n return this.columns[2].z;\n }\n\n get [11]() {\n return 0;\n }\n\n set [0](value: number) {\n this.columns[0].x = value;\n }\n\n set [1](value: number) {\n this.columns[0].y = value;\n }\n\n set [2](value: number) {\n this.columns[0].z = value;\n }\n\n set [3](_: number) {}\n\n set [4](value: number) {\n this.columns[1].x = value;\n }\n\n set [5](value: number) {\n this.columns[1].y = value;\n }\n\n set [6](value: number) {\n this.columns[1].z = value;\n }\n\n set [7](_: number) {}\n\n set [8](value: number) {\n this.columns[2].x = value;\n }\n\n set [9](value: number) {\n this.columns[2].y = value;\n }\n\n set [10](value: number) {\n this.columns[2].z = value;\n }\n\n set [11](_: number) {}\n\n *[Symbol.iterator]() {\n for (let i = 0; i < 12; i++) {\n yield this[i] as number;\n }\n }\n\n '~resolve'(): string {\n return `${this.kind}(${this[0]}, ${this[1]}, ${this[2]}, ${this[4]}, ${\n this[5]\n }, ${this[6]}, ${this[8]}, ${this[9]}, ${this[10]})`;\n }\n}\n\nclass mat3x3fImpl extends mat3x3Impl<v3f> {\n public readonly kind = 'mat3x3f';\n makeColumn(x: number, y: number, z: number): v3f {\n return vec3f(x, y, z);\n }\n}\n\nabstract class mat4x4Impl<TColumn extends v4f> extends MatBase<TColumn>\n implements mat4x4<TColumn>, SelfResolvable {\n public readonly [$internal] = true;\n public readonly columns: readonly [TColumn, TColumn, TColumn, TColumn];\n public abstract readonly kind: string;\n\n constructor(...elements: number[]) {\n super();\n this.columns = [\n this.makeColumn(\n elements[0] as number,\n elements[1] as number,\n elements[2] as number,\n elements[3] as number,\n ),\n this.makeColumn(\n elements[4] as number,\n elements[5] as number,\n elements[6] as number,\n elements[7] as number,\n ),\n this.makeColumn(\n elements[8] as number,\n elements[9] as number,\n elements[10] as number,\n elements[11] as number,\n ),\n this.makeColumn(\n elements[12] as number,\n elements[13] as number,\n elements[14] as number,\n elements[15] as number,\n ),\n ];\n }\n\n abstract makeColumn(x: number, y: number, z: number, w: number): TColumn;\n\n public readonly length = 16;\n [n: number]: number;\n\n get [0]() {\n return this.columns[0].x;\n }\n\n get [1]() {\n return this.columns[0].y;\n }\n\n get [2]() {\n return this.columns[0].z;\n }\n\n get [3]() {\n return this.columns[0].w;\n }\n\n get [4]() {\n return this.columns[1].x;\n }\n\n get [5]() {\n return this.columns[1].y;\n }\n\n get [6]() {\n return this.columns[1].z;\n }\n\n get [7]() {\n return this.columns[1].w;\n }\n\n get [8]() {\n return this.columns[2].x;\n }\n\n get [9]() {\n return this.columns[2].y;\n }\n\n get [10]() {\n return this.columns[2].z;\n }\n\n get [11]() {\n return this.columns[2].w;\n }\n\n get [12]() {\n return this.columns[3].x;\n }\n\n get [13]() {\n return this.columns[3].y;\n }\n\n get [14]() {\n return this.columns[3].z;\n }\n\n get [15]() {\n return this.columns[3].w;\n }\n\n set [0](value: number) {\n this.columns[0].x = value;\n }\n\n set [1](value: number) {\n this.columns[0].y = value;\n }\n\n set [2](value: number) {\n this.columns[0].z = value;\n }\n\n set [3](value: number) {\n this.columns[0].w = value;\n }\n\n set [4](value: number) {\n this.columns[1].x = value;\n }\n\n set [5](value: number) {\n this.columns[1].y = value;\n }\n\n set [6](value: number) {\n this.columns[1].z = value;\n }\n\n set [7](value: number) {\n this.columns[1].w = value;\n }\n\n set [8](value: number) {\n this.columns[2].x = value;\n }\n\n set [9](value: number) {\n this.columns[2].y = value;\n }\n\n set [10](value: number) {\n this.columns[2].z = value;\n }\n\n set [11](value: number) {\n this.columns[2].w = value;\n }\n\n set [12](value: number) {\n this.columns[3].x = value;\n }\n\n set [13](value: number) {\n this.columns[3].y = value;\n }\n\n set [14](value: number) {\n this.columns[3].z = value;\n }\n\n set [15](value: number) {\n this.columns[3].w = value;\n }\n\n *[Symbol.iterator]() {\n for (let i = 0; i < 16; i++) {\n yield this[i] as number;\n }\n }\n\n '~resolve'(): string {\n return `${this.kind}(${\n Array.from({ length: this.length })\n .map((_, i) => this[i])\n .join(', ')\n })`;\n }\n}\n\nclass mat4x4fImpl extends mat4x4Impl<v4f> {\n public readonly kind = 'mat4x4f';\n\n makeColumn(x: number, y: number, z: number, w: number): v4f {\n return vec4f(x, y, z, w);\n }\n}\n\n// ----------\n// Matrix ops\n// ----------\n\n/**\n * Returns a 2-by-2 identity matrix.\n * @returns {m2x2f} The result matrix.\n */\nexport const identity2 = createDualImpl(\n // CPU implementation\n () => mat2x2f(1, 0, 0, 1),\n // GPU implementation\n () => ({\n value: `mat4x4f(\n 1.0, 0.0,\n 0.0, 1.0\n )`,\n dataType: mat2x2f,\n }),\n 'identity2',\n);\n\n/**\n * Returns a 3-by-3 identity matrix.\n * @returns {m3x3f} The result matrix.\n */\nexport const identity3 = createDualImpl(\n // CPU implementation\n () => mat3x3f(1, 0, 0, 0, 1, 0, 0, 0, 1),\n // GPU implementation\n () => ({\n value: `mat4x4f(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0,\n )`,\n dataType: mat3x3f,\n }),\n 'identity3',\n);\n\n/**\n * Returns a 4-by-4 identity matrix.\n * @returns {m4x4f} The result matrix.\n */\nexport const identity4 = createDualImpl(\n // CPU implementation\n () => mat4x4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),\n // GPU implementation\n () => ({\n value: `mat4x4f(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n )`,\n dataType: mat4x4f,\n }),\n 'identity4',\n);\n\nconst identityFunctions = {\n 2: identity2,\n 3: identity3,\n 4: identity4,\n};\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param {v3f} vector - The vector by which to translate.\n * @returns {m4x4f} The translation matrix.\n */\nexport const translation4 = createDualImpl(\n // CPU implementation\n (vector: v3f) =>\n // deno-fmt-ignore\n mat4x4f(\n 1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n vector.x, vector.y, vector.z, 1,\n ),\n // GPU implementation\n (vector) => ({\n value: `mat4x4f(\n 1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n ${vector.value}.x, ${vector.value}.y, ${vector.value}.z, 1\n )`,\n dataType: mat4x4f,\n }),\n 'translation4',\n);\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by the corresponding entry in the given vector.\n * @param {v3f} vector - A vector of three entries specifying the factor by which to scale in each dimension.\n * @returns {m4x4f} The scaling matrix.\n */\nexport const scaling4 = createDualImpl(\n // CPU implementation\n (vector: v3f) =>\n // deno-fmt-ignore\n mat4x4f(\n vector.x, 0, 0, 0,\n 0, vector.y, 0, 0,\n 0, 0, vector.z, 0,\n 0, 0, 0, 1,\n ),\n // GPU implementation\n (vector) => ({\n value: `mat4x4f(\n ${vector.value}.x, 0, 0, 0,\n 0, ${vector.value}.y, 0, 0,\n 0, 0, ${vector.value}.z, 0,\n 0, 0, 0, 1\n )`,\n dataType: mat4x4f,\n }),\n 'scaling4',\n);\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param {number} angle - The angle by which to rotate (in radians).\n * @returns {m4x4f} The rotation matrix.\n */\nexport const rotationX4 = createDualImpl(\n // CPU implementation\n (a: number) =>\n // deno-fmt-ignore\n mat4x4f(\n 1, 0, 0, 0,\n 0, Math.cos(a), Math.sin(a), 0,\n 0, -Math.sin(a), Math.cos(a), 0,\n 0, 0, 0, 1,\n ),\n // GPU implementation\n (a) =>\n snip(\n `mat4x4f(\n 1, 0, 0, 0,\n 0, cos(${a.value}), sin(${a.value}), 0,\n 0, -sin(${a.value}), cos(${a.value}), 0,\n 0, 0, 0, 1\n )`,\n mat4x4f,\n ),\n 'rotationX4',\n);\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param {number} angle - The angle by which to rotate (in radians).\n * @returns {m4x4f} The rotation matrix.\n */\nexport const rotationY4 = createDualImpl(\n // CPU implementation\n (a: number) =>\n // deno-fmt-ignore\n mat4x4f(\n Math.cos(a), 0, -Math.sin(a), 0,\n 0, 1, 0, 0,\n Math.sin(a), 0, Math.cos(a), 0,\n 0, 0, 0, 1,\n ),\n // GPU implementation\n (a) =>\n snip(\n `mat4x4f(\n cos(${a.value}), 0, -sin(${a.value}), 0,\n 0, 1, 0, 0,\n sin(${a.value}), 0, cos(${a.value}), 0,\n 0, 0, 0, 1\n )`,\n mat4x4f,\n ),\n 'rotationY4',\n);\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param {number} angle - The angle by which to rotate (in radians).\n * @returns {m4x4f} The rotation matrix.\n */\nexport const rotationZ4 = createDualImpl(\n // CPU implementation\n (a: number) =>\n // deno-fmt-ignore\n mat4x4f(\n Math.cos(a), Math.sin(a), 0, 0,\n -Math.sin(a), Math.cos(a), 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1,\n ),\n // GPU implementation\n (a) =>\n snip(\n `mat4x4f(\n cos(${a.value}), sin(${a.value}), 0, 0,\n -sin(${a.value}), cos(${a.value}), 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1\n )`,\n mat4x4f,\n ),\n 'rotationZ4',\n);\n\n// ----------\n// Public API\n// ----------\n\n/**\n * Schema representing mat2x2f - a matrix with 2 rows and 2 columns, with elements of type f32.\n * Also a constructor function for this matrix type.\n *\n * @example\n * const zero2x2 = mat2x2f(); // filled with zeros\n *\n * @example\n * const mat = mat2x2f(0, 1, 2, 3);\n * mat.columns[0] // vec2f(0, 1)\n * mat.columns[1] // vec2f(2, 3)\n *\n * @example\n * const mat = mat2x2f(\n * vec2f(0, 1), // column 0\n * vec2f(1, 2), // column 1\n * );\n *\n * @example\n * const buffer = root.createBuffer(d.mat2x2f, d.mat2x2f(0, 1, 2, 3)); // buffer holding a d.mat2x2f value, with an initial value of ((0, 1), (2, 3))\n */\nexport const mat2x2f = createMatSchema<'mat2x2f', m2x2f, v2f>({\n type: 'mat2x2f',\n rows: 2,\n columns: 2,\n MatImpl: mat2x2fImpl,\n}) as Mat2x2f;\n\n/**\n * Schema representing mat3x3f - a matrix with 3 rows and 3 columns, with elements of type f32.\n * Also a constructor function for this matrix type.\n *\n * @example\n * const zero3x3 = mat3x3f(); // filled with zeros\n *\n * @example\n * const mat = mat3x3f(0, 1, 2, 3, 4, 5, 6, 7, 8);\n * mat.columns[0] // vec3f(0, 1, 2)\n * mat.columns[1] // vec3f(3, 4, 5)\n * mat.columns[2] // vec3f(6, 7, 8)\n *\n * @example\n * const mat = mat3x3f(\n * vec3f(0, 1, 2), // column 0\n * vec3f(2, 3, 4), // column 1\n * vec3f(5, 6, 7), // column 2\n * );\n *\n * @example\n * const buffer = root.createBuffer(d.mat3x3f, d.mat3x3f()); // buffer holding a d.mat3x3f value, with an initial value of mat3x3f filled with zeros\n */\nexport const mat3x3f = createMatSchema<'mat3x3f', m3x3f, v3f>({\n type: 'mat3x3f',\n rows: 3,\n columns: 3,\n MatImpl: mat3x3fImpl,\n}) as Mat3x3f;\n\n/**\n * Schema representing mat4x4f - a matrix with 4 rows and 4 columns, with elements of type f32.\n * Also a constructor function for this matrix type.\n *\n * @example\n * const zero4x4 = mat4x4f(); // filled with zeros\n *\n * @example\n * const mat = mat4x4f(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);\n * mat.columns[0] // vec4f(0, 1, 2, 3)\n * mat.columns[1] // vec4f(4, 5, 6, 7)\n * mat.columns[2] // vec4f(8, 9, 10, 11)\n * mat.columns[3] // vec4f(12, 13, 14, 15)\n *\n * @example\n * const mat = mat4x4f(\n * vec4f(0, 1, 2, 3), // column 0\n * vec4f(4, 5, 6, 7), // column 1\n * vec4f(8, 9, 10, 11), // column 2\n * vec4f(12, 13, 14, 15), // column 3\n * );\n *\n * @example\n * const buffer = root.createBuffer(d.mat4x4f, d.mat4x4f()); // buffer holding a d.mat4x4f value, with an initial value of mat4x4f filled with zeros\n */\nexport const mat4x4f = createMatSchema<'mat4x4f', m4x4f, v4f>({\n type: 'mat4x4f',\n rows: 4,\n columns: 4,\n MatImpl: mat4x4fImpl,\n}) as Mat4x4f;\n\nexport function matToArray(mat: m2x2f | m3x3f | m4x4f): number[] {\n if (mat.kind === 'mat3x3f') {\n return [\n mat[0],\n mat[1],\n mat[2],\n mat[4],\n mat[5],\n mat[6],\n mat[8],\n mat[9],\n mat[10],\n ] as number[];\n }\n\n return Array.from({ length: mat.length }).map((_, idx) => mat[idx] as number);\n}\n","export const smoothstepScalar = (\n edge0: number,\n edge1: number,\n x: number,\n): number => {\n if (edge0 === edge1) {\n return 0; // WGSL spec says this is an indeterminate value\n }\n const t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n return t * t * (3 - 2 * t);\n};\n\nexport const clamp = (value: number, low: number, high: number) =>\n Math.min(Math.max(low, value), high);\n\nexport const divInteger = (lhs: number, rhs: number) => {\n if (rhs === 0) {\n return lhs;\n }\n return Math.trunc(lhs / rhs);\n};\n","import { mat2x2f, mat3x3f, mat4x4f } from './matrix.ts';\nimport { clamp, divInteger, smoothstepScalar } from './numberOps.ts';\nimport {\n vec2b,\n vec2f,\n vec2h,\n vec2i,\n vec2u,\n vec3b,\n vec3f,\n vec3h,\n vec3i,\n vec3u,\n vec4b,\n vec4f,\n vec4h,\n vec4i,\n vec4u,\n} from './vector.ts';\nimport type * as wgsl from './wgslTypes.ts';\nimport type { VecKind } from './wgslTypes.ts';\n\ntype vBase = { kind: VecKind };\ntype mBase = { kind: MatKind };\ntype v2 = wgsl.v2f | wgsl.v2h | wgsl.v2i | wgsl.v2u;\ntype v3 = wgsl.v3f | wgsl.v3h | wgsl.v3i | wgsl.v3u;\ntype v4 = wgsl.v4f | wgsl.v4h | wgsl.v4i | wgsl.v4u;\n\ntype MatKind = 'mat2x2f' | 'mat3x3f' | 'mat4x4f';\n\nconst lengthVec2 = (v: v2) => Math.sqrt(v.x ** 2 + v.y ** 2);\nconst lengthVec3 = (v: v3) => Math.sqrt(v.x ** 2 + v.y ** 2 + v.z ** 2);\nconst lengthVec4 = (v: v4) =>\n Math.sqrt(v.x ** 2 + v.y ** 2 + v.z ** 2 + v.w ** 2);\n\nconst dotVec2 = (lhs: v2, rhs: v2) => lhs.x * rhs.x + lhs.y * rhs.y;\nconst dotVec3 = (lhs: v3, rhs: v3) =>\n lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z;\nconst dotVec4 = (lhs: v4, rhs: v4) =>\n lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z + lhs.w * rhs.w;\n\ntype UnaryOp = (a: number) => number;\ntype BinaryOp = (a: number, b: number) => number;\n\nconst unary2f = (op: UnaryOp) => (a: wgsl.v2f) => vec2f(op(a.x), op(a.y));\nconst unary2h = (op: UnaryOp) => (a: wgsl.v2h) => vec2h(op(a.x), op(a.y));\nconst unary2i = (op: UnaryOp) => (a: wgsl.v2i) => vec2i(op(a.x), op(a.y));\nconst unary2u = (op: UnaryOp) => (a: wgsl.v2u) => vec2u(op(a.x), op(a.y));\n\nconst unary3f = (op: UnaryOp) => (a: wgsl.v3f) =>\n vec3f(op(a.x), op(a.y), op(a.z));\n\nconst unary3h = (op: UnaryOp) => (a: wgsl.v3h) =>\n vec3h(op(a.x), op(a.y), op(a.z));\n\nconst unary3i = (op: UnaryOp) => (a: wgsl.v3i) =>\n vec3i(op(a.x), op(a.y), op(a.z));\n\nconst unary3u = (op: UnaryOp) => (a: wgsl.v3u) =>\n vec3u(op(a.x), op(a.y), op(a.z));\n\nconst unary4f = (op: UnaryOp) => (a: wgsl.v4f) =>\n vec4f(op(a.x), op(a.y), op(a.z), op(a.w));\n\nconst unary4h = (op: UnaryOp) => (a: wgsl.v4h) =>\n vec4h(op(a.x), op(a.y), op(a.z), op(a.w));\n\nconst unary4i = (op: UnaryOp) => (a: wgsl.v4i) =>\n vec4i(op(a.x), op(a.y), op(a.z), op(a.w));\n\nconst unary4u = (op: UnaryOp) => (a: wgsl.v4u) =>\n vec4u(op(a.x), op(a.y), op(a.z), op(a.w));\n\nconst unary2x2f = (op: UnaryOp) => (a: wgsl.m2x2f) => {\n const a_ = a.columns as [wgsl.v2f, wgsl.v2f];\n return mat2x2f(unary2f(op)(a_[0]), unary2f(op)(a_[1]));\n};\n\nconst unary3x3f = (op: UnaryOp) => (a: wgsl.m3x3f) => {\n const a_ = a.columns as [wgsl.v3f, wgsl.v3f, wgsl.v3f];\n return mat3x3f(unary3f(op)(a_[0]), unary3f(op)(a_[1]), unary3f(op)(a_[2]));\n};\n\nconst unary4x4f = (op: UnaryOp) => (a: wgsl.m4x4f) => {\n const a_ = a.columns as [wgsl.v4f, wgsl.v4f, wgsl.v4f, wgsl.v4f];\n return mat4x4f(\n unary4f(op)(a_[0]),\n unary4f(op)(a_[1]),\n unary4f(op)(a_[2]),\n unary4f(op)(a_[3]),\n );\n};\n\nconst binaryComponentWise2f = (op: BinaryOp) => (a: wgsl.v2f, b: wgsl.v2f) =>\n vec2f(op(a.x, b.x), op(a.y, b.y));\n\nconst binaryComponentWise2h = (op: BinaryOp) => (a: wgsl.v2h, b: wgsl.v2h) =>\n vec2h(op(a.x, b.x), op(a.y, b.y));\n\nconst binaryComponentWise2i = (op: BinaryOp) => (a: wgsl.v2i, b: wgsl.v2i) =>\n vec2i(op(a.x, b.x), op(a.y, b.y));\n\nconst binaryComponentWise2u = (op: BinaryOp) => (a: wgsl.v2u, b: wgsl.v2u) =>\n vec2u(op(a.x, b.x), op(a.y, b.y));\n\nconst binaryComponentWise3f = (op: BinaryOp) => (a: wgsl.v3f, b: wgsl.v3f) =>\n vec3f(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z));\n\nconst binaryComponentWise3h = (op: BinaryOp) => (a: wgsl.v3h, b: wgsl.v3h) =>\n vec3h(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z));\n\nconst binaryComponentWise3i = (op: BinaryOp) => (a: wgsl.v3i, b: wgsl.v3i) =>\n vec3i(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z));\n\nconst binaryComponentWise3u = (op: BinaryOp) => (a: wgsl.v3u, b: wgsl.v3u) =>\n vec3u(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z));\n\nconst binaryComponentWise4f = (op: BinaryOp) => (a: wgsl.v4f, b: wgsl.v4f) =>\n vec4f(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w));\n\nconst binaryComponentWise4h = (op: BinaryOp) => (a: wgsl.v4h, b: wgsl.v4h) =>\n vec4h(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w));\n\nconst binaryComponentWise4i = (op: BinaryOp) => (a: wgsl.v4i, b: wgsl.v4i) =>\n vec4i(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w));\n\nconst binaryComponentWise4u = (op: BinaryOp) => (a: wgsl.v4u, b: wgsl.v4u) =>\n vec4u(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w));\n\nconst binaryComponentWise2x2f =\n (op: BinaryOp) => (a: wgsl.m2x2f, b: wgsl.m2x2f) => {\n const a_ = a.columns as [wgsl.v2f, wgsl.v2f];\n const b_ = b.columns as [wgsl.v2f, wgsl.v2f];\n return mat2x2f(\n binaryComponentWise2f(op)(a_[0], b_[0]),\n binaryComponentWise2f(op)(a_[1], b_[1]),\n );\n };\n\nconst binaryComponentWise3x3f =\n (op: BinaryOp) => (a: wgsl.m3x3f, b: wgsl.m3x3f) => {\n const a_ = a.columns as [wgsl.v3f, wgsl.v3f, wgsl.v3f];\n const b_ = b.columns as [wgsl.v3f, wgsl.v3f, wgsl.v3f];\n return mat3x3f(\n binaryComponentWise3f(op)(a_[0], b_[0]),\n binaryComponentWise3f(op)(a_[1], b_[1]),\n binaryComponentWise3f(op)(a_[2], b_[2]),\n );\n };\n\nconst binaryComponentWise4x4f =\n (op: BinaryOp) => (a: wgsl.m4x4f, b: wgsl.m4x4f) => {\n const a_ = a.columns as [wgsl.v4f, wgsl.v4f, wgsl.v4f, wgsl.v4f];\n const b_ = b.columns as [wgsl.v4f, wgsl.v4f, wgsl.v4f, wgsl.v4f];\n return mat4x4f(\n binaryComponentWise4f(op)(a_[0], b_[0]),\n binaryComponentWise4f(op)(a_[1], b_[1]),\n binaryComponentWise4f(op)(a_[2], b_[2]),\n binaryComponentWise4f(op)(a_[3], b_[3]),\n );\n };\n\ntype TernaryOp = (a: number, b: number, c: number) => number;\n\nconst ternaryComponentWise2f =\n (op: TernaryOp) => (a: wgsl.v2f, b: wgsl.v2f, c: wgsl.v2f) =>\n vec2f(op(a.x, b.x, c.x), op(a.y, b.y, c.y));\n\nconst ternaryComponentWise2h =\n (op: TernaryOp) => (a: wgsl.v2h, b: wgsl.v2h, c: wgsl.v2h) =>\n vec2h(op(a.x, b.x, c.x), op(a.y, b.y, c.y));\n\nconst ternaryComponentWise3f =\n (op: TernaryOp) => (a: wgsl.v3f, b: wgsl.v3f, c: wgsl.v3f) =>\n vec3f(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z));\n\nconst ternaryComponentWise3h =\n (op: TernaryOp) => (a: wgsl.v3h, b: wgsl.v3h, c: wgsl.v3h) =>\n vec3h(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z));\n\nconst ternaryComponentWise4f =\n (op: TernaryOp) => (a: wgsl.v4f, b: wgsl.v4f, c: wgsl.v4f) =>\n vec4f(\n op(a.x, b.x, c.x),\n op(a.y, b.y, c.y),\n op(a.z, b.z, c.z),\n op(a.w, b.w, c.w),\n );\n\nconst ternaryComponentWise4h =\n (op: TernaryOp) => (a: wgsl.v4h, b: wgsl.v4h, c: wgsl.v4h) =>\n vec4h(\n op(a.x, b.x, c.x),\n op(a.y, b.y, c.y),\n op(a.z, b.z, c.z),\n op(a.w, b.w, c.w),\n );\n\nexport const VectorOps = {\n eq: {\n vec2f: (e1: wgsl.v2f, e2: wgsl.v2f) => vec2b(e1.x === e2.x, e1.y === e2.y),\n vec2h: (e1: wgsl.v2h, e2: wgsl.v2h) => vec2b(e1.x === e2.x, e1.y === e2.y),\n vec2i: (e1: wgsl.v2i, e2: wgsl.v2i) => vec2b(e1.x === e2.x, e1.y === e2.y),\n vec2u: (e1: wgsl.v2u, e2: wgsl.v2u) => vec2b(e1.x === e2.x, e1.y === e2.y),\n 'vec2<bool>': (e1: wgsl.v2b, e2: wgsl.v2b) =>\n vec2b(e1.x === e2.x, e1.y === e2.y),\n\n vec3f: (e1: wgsl.v3f, e2: wgsl.v3f) =>\n vec3b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z),\n vec3h: (e1: wgsl.v3h, e2: wgsl.v3h) =>\n vec3b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z),\n vec3i: (e1: wgsl.v3i, e2: wgsl.v3i) =>\n vec3b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z),\n vec3u: (e1: wgsl.v3u, e2: wgsl.v3u) =>\n vec3b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z),\n 'vec3<bool>': (e1: wgsl.v3b, e2: wgsl.v3b) =>\n vec3b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z),\n\n vec4f: (e1: wgsl.v4f, e2: wgsl.v4f) =>\n vec4b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z, e1.w === e2.w),\n vec4h: (e1: wgsl.v4h, e2: wgsl.v4h) =>\n vec4b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z, e1.w === e2.w),\n vec4i: (e1: wgsl.v4i, e2: wgsl.v4i) =>\n vec4b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z, e1.w === e2.w),\n vec4u: (e1: wgsl.v4u, e2: wgsl.v4u) =>\n vec4b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z, e1.w === e2.w),\n 'vec4<bool>': (e1: wgsl.v4b, e2: wgsl.v4b) =>\n vec4b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z, e1.w === e2.w),\n } as Record<\n VecKind,\n <T extends wgsl.AnyVecInstance>(\n e1: T,\n e2: T,\n ) => T extends wgsl.AnyVec2Instance ? wgsl.v2b\n : T extends wgsl.AnyVec3Instance ? wgsl.v3b\n : wgsl.v4b\n >,\n\n lt: {\n vec2f: (e1: wgsl.v2f, e2: wgsl.v2f) => vec2b(e1.x < e2.x, e1.y < e2.y),\n vec2h: (e1: wgsl.v2h, e2: wgsl.v2h) => vec2b(e1.x < e2.x, e1.y < e2.y),\n vec2i: (e1: wgsl.v2i, e2: wgsl.v2i) => vec2b(e1.x < e2.x, e1.y < e2.y),\n vec2u: (e1: wgsl.v2u, e2: wgsl.v2u) => vec2b(e1.x < e2.x, e1.y < e2.y),\n\n vec3f: (e1: wgsl.v3f, e2: wgsl.v3f) =>\n vec3b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z),\n vec3h: (e1: wgsl.v3h, e2: wgsl.v3h) =>\n vec3b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z),\n vec3i: (e1: wgsl.v3i, e2: wgsl.v3i) =>\n vec3b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z),\n vec3u: (e1: wgsl.v3u, e2: wgsl.v3u) =>\n vec3b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z),\n\n vec4f: (e1: wgsl.v4f, e2: wgsl.v4f) =>\n vec4b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z, e1.w < e2.w),\n vec4h: (e1: wgsl.v4h, e2: wgsl.v4h) =>\n vec4b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z, e1.w < e2.w),\n vec4i: (e1: wgsl.v4i, e2: wgsl.v4i) =>\n vec4b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z, e1.w < e2.w),\n vec4u: (e1: wgsl.v4u, e2: wgsl.v4u) =>\n vec4b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z, e1.w < e2.w),\n } as Record<\n VecKind,\n <T extends wgsl.AnyNumericVecInstance>(\n e1: T,\n e2: T,\n ) => T extends wgsl.AnyVec2Instance ? wgsl.v2b\n : T extends wgsl.AnyVec3Instance ? wgsl.v3b\n : wgsl.v4b\n >,\n\n or: {\n 'vec2<bool>': (e1: wgsl.v2b, e2: wgsl.v2b) =>\n vec2b(e1.x || e2.x, e1.y || e2.y),\n 'vec3<bool>': (e1: wgsl.v3b, e2: wgsl.v3b) =>\n vec3b(e1.x || e2.x, e1.y || e2.y, e1.z || e2.z),\n 'vec4<bool>': (e1: wgsl.v4b, e2: wgsl.v4b) =>\n vec4b(e1.x || e2.x, e1.y || e2.y, e1.z || e2.z, e1.w || e2.w),\n } as Record<\n VecKind,\n <T extends wgsl.AnyBooleanVecInstance>(e1: T, e2: T) => T\n >,\n\n all: {\n 'vec2<bool>': (e: wgsl.v2b) => e.x && e.y,\n 'vec3<bool>': (e: wgsl.v3b) => e.x && e.y && e.z,\n 'vec4<bool>': (e: wgsl.v4b) => e.x && e.y && e.z && e.w,\n } as Record<VecKind, (v: wgsl.AnyBooleanVecInstance) => boolean>,\n\n abs: {\n vec2f: unary2f(Math.abs),\n vec2h: unary2h(Math.abs),\n vec2i: unary2i(Math.abs),\n vec2u: unary2u(Math.abs),\n\n vec3f: unary3f(Math.abs),\n vec3h: unary3h(Math.abs),\n vec3i: unary3i(Math.abs),\n vec3u: unary3u(Math.abs),\n\n vec4f: unary4f(Math.abs),\n vec4h: unary4h(Math.abs),\n vec4i: unary4i(Math.abs),\n vec4u: unary4u(Math.abs),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n atan2: {\n vec2f: binaryComponentWise2f(Math.atan2),\n vec2h: binaryComponentWise2h(Math.atan2),\n\n vec3f: binaryComponentWise3f(Math.atan2),\n vec3h: binaryComponentWise3h(Math.atan2),\n\n vec4f: binaryComponentWise4f(Math.atan2),\n vec4h: binaryComponentWise4h(Math.atan2),\n } as Record<VecKind, <T extends vBase>(a: T, b: T) => T>,\n\n acos: {\n vec2f: unary2f(Math.acos),\n vec2h: unary2h(Math.acos),\n vec2i: unary2i(Math.acos),\n vec2u: unary2u(Math.acos),\n\n vec3f: unary3f(Math.acos),\n vec3h: unary3h(Math.acos),\n vec3i: unary3i(Math.acos),\n vec3u: unary3u(Math.acos),\n\n vec4f: unary4f(Math.acos),\n vec4h: unary4h(Math.acos),\n vec4i: unary4i(Math.acos),\n vec4u: unary4u(Math.acos),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n acosh: {\n vec2f: unary2f(Math.acosh),\n vec2h: unary2h(Math.acosh),\n\n vec3f: unary3f(Math.acosh),\n vec3h: unary3h(Math.acosh),\n\n vec4f: unary4f(Math.acosh),\n vec4h: unary4h(Math.acosh),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n asin: {\n vec2f: unary2f(Math.asin),\n vec2h: unary2h(Math.asin),\n vec2i: unary2i(Math.asin),\n vec2u: unary2u(Math.asin),\n\n vec3f: unary3f(Math.asin),\n vec3h: unary3h(Math.asin),\n vec3i: unary3i(Math.asin),\n vec3u: unary3u(Math.asin),\n\n vec4f: unary4f(Math.asin),\n vec4h: unary4h(Math.asin),\n vec4i: unary4i(Math.asin),\n vec4u: unary4u(Math.asin),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n ceil: {\n vec2f: unary2f(Math.ceil),\n vec2h: unary2h(Math.ceil),\n\n vec3f: unary3f(Math.ceil),\n vec3h: unary3h(Math.ceil),\n\n vec4f: unary4f(Math.ceil),\n vec4h: unary4h(Math.ceil),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n clamp: {\n vec2f: (v: wgsl.v2f, low: wgsl.v2f, high: wgsl.v2f) =>\n vec2f(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y)),\n vec2h: (v: wgsl.v2h, low: wgsl.v2h, high: wgsl.v2h) =>\n vec2h(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y)),\n vec2i: (v: wgsl.v2i, low: wgsl.v2i, high: wgsl.v2i) =>\n vec2i(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y)),\n vec2u: (v: wgsl.v2u, low: wgsl.v2u, high: wgsl.v2u) =>\n vec2u(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y)),\n\n vec3f: (v: wgsl.v3f, low: wgsl.v3f, high: wgsl.v3f) =>\n vec3f(\n clamp(v.x, low.x, high.x),\n clamp(v.y, low.y, high.y),\n clamp(v.z, low.z, high.z),\n ),\n vec3h: (v: wgsl.v3h, low: wgsl.v3h, high: wgsl.v3h) =>\n vec3h(\n clamp(v.x, low.x, high.x),\n clamp(v.y, low.y, high.y),\n clamp(v.z, low.z, high.z),\n ),\n vec3i: (v: wgsl.v3i, low: wgsl.v3i, high: wgsl.v3f) =>\n vec3i(\n clamp(v.x, low.x, high.x),\n clamp(v.y, low.y, high.y),\n clamp(v.z, low.z, high.z),\n ),\n vec3u: (v: wgsl.v3u, low: wgsl.v3u, high: wgsl.v3f) =>\n vec3u(\n clamp(v.x, low.x, high.x),\n clamp(v.y, low.y, high.y),\n clamp(v.z, low.z, high.z),\n ),\n\n vec4f: (v: wgsl.v4f, low: wgsl.v4f, high: wgsl.v4f) =>\n vec4f(\n clamp(v.x, low.x, high.x),\n clamp(v.y, low.y, high.y),\n clamp(v.z, low.z, high.z),\n clamp(v.w, low.w, high.w),\n ),\n vec4h: (v: wgsl.v4h, low: wgsl.v4h, high: wgsl.v4h) =>\n vec4h(\n clamp(v.x, low.x, high.x),\n clamp(v.y, low.y, high.y),\n clamp(v.z, low.z, high.z),\n clamp(v.w, low.w, high.w),\n ),\n vec4i: (v: wgsl.v4i, low: wgsl.v4i, high: wgsl.v4i) =>\n vec4i(\n clamp(v.x, low.x, high.x),\n clamp(v.y, low.y, high.y),\n clamp(v.z, low.z, high.z),\n clamp(v.w, low.w, high.w),\n ),\n vec4u: (v: wgsl.v4u, low: wgsl.v4u, high: wgsl.v4u) =>\n vec4u(\n clamp(v.x, low.x, high.x),\n clamp(v.y, low.y, high.y),\n clamp(v.z, low.z, high.z),\n clamp(v.w, low.w, high.w),\n ),\n } as Record<VecKind, <T extends vBase>(v: T, low: T, high: T) => T>,\n\n length: {\n vec2f: lengthVec2,\n vec2h: lengthVec2,\n\n vec3f: lengthVec3,\n vec3h: lengthVec3,\n\n vec4f: lengthVec4,\n vec4h: lengthVec4,\n } as Record<VecKind, (v: vBase) => number>,\n\n add: {\n vec2f: binaryComponentWise2f((a, b) => a + b),\n vec2h: binaryComponentWise2h((a, b) => a + b),\n vec2i: binaryComponentWise2i((a, b) => a + b),\n vec2u: binaryComponentWise2u((a, b) => a + b),\n\n vec3f: binaryComponentWise3f((a, b) => a + b),\n vec3h: binaryComponentWise3h((a, b) => a + b),\n vec3i: binaryComponentWise3i((a, b) => a + b),\n vec3u: binaryComponentWise3u((a, b) => a + b),\n\n vec4f: binaryComponentWise4f((a, b) => a + b),\n vec4h: binaryComponentWise4h((a, b) => a + b),\n vec4i: binaryComponentWise4i((a, b) => a + b),\n vec4u: binaryComponentWise4u((a, b) => a + b),\n\n mat2x2f: binaryComponentWise2x2f((a, b) => a + b),\n mat3x3f: binaryComponentWise3x3f((a, b) => a + b),\n mat4x4f: binaryComponentWise4x4f((a, b) => a + b),\n } as Record<\n VecKind | MatKind,\n <T extends vBase | mBase>(lhs: T, rhs: T) => T\n >,\n\n smoothstep: {\n vec2f: ternaryComponentWise2f(smoothstepScalar),\n vec2h: ternaryComponentWise2h(smoothstepScalar),\n vec3f: ternaryComponentWise3f(smoothstepScalar),\n vec3h: ternaryComponentWise3h(smoothstepScalar),\n vec4f: ternaryComponentWise4f(smoothstepScalar),\n vec4h: ternaryComponentWise4h(smoothstepScalar),\n } as Record<\n VecKind,\n <T extends vBase>(\n edge0: T,\n edge1: T,\n x: T,\n ) => T extends wgsl.AnyVec2Instance ? wgsl.v2f\n : T extends wgsl.AnyVec3Instance ? wgsl.v3f\n : T extends wgsl.AnyVec4Instance ? wgsl.v4f\n : wgsl.AnyVecInstance\n >,\n\n addMixed: {\n vec2f: (a: wgsl.v2f, b: number) => unary2f((e) => e + b)(a),\n vec2h: (a: wgsl.v2h, b: number) => unary2h((e) => e + b)(a),\n vec2i: (a: wgsl.v2i, b: number) => unary2i((e) => e + b)(a),\n vec2u: (a: wgsl.v2u, b: number) => unary2u((e) => e + b)(a),\n\n vec3f: (a: wgsl.v3f, b: number) => unary3f((e) => e + b)(a),\n vec3h: (a: wgsl.v3h, b: number) => unary3h((e) => e + b)(a),\n vec3i: (a: wgsl.v3i, b: number) => unary3i((e) => e + b)(a),\n vec3u: (a: wgsl.v3u, b: number) => unary3u((e) => e + b)(a),\n\n vec4f: (a: wgsl.v4f, b: number) => unary4f((e) => e + b)(a),\n vec4h: (a: wgsl.v4h, b: number) => unary4h((e) => e + b)(a),\n vec4i: (a: wgsl.v4i, b: number) => unary4i((e) => e + b)(a),\n vec4u: (a: wgsl.v4u, b: number) => unary4u((e) => e + b)(a),\n\n mat2x2f: (a: wgsl.m2x2f, b: number) => unary2x2f((e) => e + b)(a),\n mat3x3f: (a: wgsl.m3x3f, b: number) => unary3x3f((e) => e + b)(a),\n mat4x4f: (a: wgsl.m4x4f, b: number) => unary4x4f((e) => e + b)(a),\n } as Record<\n VecKind | MatKind,\n <T extends vBase | mBase>(lhs: T, rhs: number) => T\n >,\n\n mulSxV: {\n vec2f: (s: number, v: wgsl.v2f) => unary2f((e) => s * e)(v),\n vec2h: (s: number, v: wgsl.v2h) => unary2h((e) => s * e)(v),\n vec2i: (s: number, v: wgsl.v2i) => unary2i((e) => s * e)(v),\n vec2u: (s: number, v: wgsl.v2u) => unary2u((e) => s * e)(v),\n\n vec3f: (s: number, v: wgsl.v3f) => unary3f((e) => s * e)(v),\n vec3h: (s: number, v: wgsl.v3h) => unary3h((e) => s * e)(v),\n vec3i: (s: number, v: wgsl.v3i) => unary3i((e) => s * e)(v),\n vec3u: (s: number, v: wgsl.v3u) => unary3u((e) => s * e)(v),\n\n vec4f: (s: number, v: wgsl.v4f) => unary4f((e) => s * e)(v),\n vec4h: (s: number, v: wgsl.v4h) => unary4h((e) => s * e)(v),\n vec4i: (s: number, v: wgsl.v4i) => unary4i((e) => s * e)(v),\n vec4u: (s: number, v: wgsl.v4u) => unary4u((e) => s * e)(v),\n\n mat2x2f: (s: number, m: wgsl.m2x2f) => unary2x2f((e) => s * e)(m),\n mat3x3f: (s: number, m: wgsl.m3x3f) => unary3x3f((e) => s * e)(m),\n mat4x4f: (s: number, m: wgsl.m4x4f) => unary4x4f((e) => s * e)(m),\n } as Record<\n VecKind | MatKind,\n <T extends vBase | wgsl.AnyMatInstance>(s: number, v: T) => T\n >,\n\n mulVxV: {\n vec2f: binaryComponentWise2f((a, b) => a * b),\n vec2h: binaryComponentWise2h((a, b) => a * b),\n vec2i: binaryComponentWise2i((a, b) => a * b),\n vec2u: binaryComponentWise2u((a, b) => a * b),\n\n vec3f: binaryComponentWise3f((a, b) => a * b),\n vec3h: binaryComponentWise3h((a, b) => a * b),\n vec3i: binaryComponentWise3i((a, b) => a * b),\n vec3u: binaryComponentWise3u((a, b) => a * b),\n\n vec4f: binaryComponentWise4f((a, b) => a * b),\n vec4h: binaryComponentWise4h((a, b) => a * b),\n vec4i: binaryComponentWise4i((a, b) => a * b),\n vec4u: binaryComponentWise4u((a, b) => a * b),\n\n mat2x2f: (a: wgsl.m2x2f, b: wgsl.m2x2f) => {\n const a_ = a.columns;\n const b_ = b.columns;\n\n return mat2x2f(\n a_[0].x * b_[0].x + a_[1].x * b_[0].y,\n a_[0].y * b_[0].x + a_[1].y * b_[0].y,\n a_[0].x * b_[1].x + a_[1].x * b_[1].y,\n a_[0].y * b_[1].x + a_[1].y * b_[1].y,\n );\n },\n\n mat3x3f: (a: wgsl.m3x3f, b: wgsl.m3x3f) => {\n const a_ = a.columns;\n const b_ = b.columns;\n\n return mat3x3f(\n a_[0].x * b_[0].x + a_[1].x * b_[0].y + a_[2].x * b_[0].z,\n a_[0].y * b_[0].x + a_[1].y * b_[0].y + a_[2].y * b_[0].z,\n a_[0].z * b_[0].x + a_[1].z * b_[0].y + a_[2].z * b_[0].z,\n a_[0].x * b_[1].x + a_[1].x * b_[1].y + a_[2].x * b_[1].z,\n a_[0].y * b_[1].x + a_[1].y * b_[1].y + a_[2].y * b_[1].z,\n a_[0].z * b_[1].x + a_[1].z * b_[1].y + a_[2].z * b_[1].z,\n a_[0].x * b_[2].x + a_[1].x * b_[2].y + a_[2].x * b_[2].z,\n a_[0].y * b_[2].x + a_[1].y * b_[2].y + a_[2].y * b_[2].z,\n a_[0].z * b_[2].x + a_[1].z * b_[2].y + a_[2].z * b_[2].z,\n );\n },\n\n mat4x4f: (a: wgsl.m4x4f, b: wgsl.m4x4f) => {\n const a_ = a.columns;\n const b_ = b.columns;\n\n return mat4x4f(\n a_[0].x * b_[0].x +\n a_[1].x * b_[0].y +\n a_[2].x * b_[0].z +\n a_[3].x * b_[0].w,\n a_[0].y * b_[0].x +\n a_[1].y * b_[0].y +\n a_[2].y * b_[0].z +\n a_[3].y * b_[0].w,\n a_[0].z * b_[0].x +\n a_[1].z * b_[0].y +\n a_[2].z * b_[0].z +\n a_[3].z * b_[0].w,\n a_[0].w * b_[0].x +\n a_[1].w * b_[0].y +\n a_[2].w * b_[0].z +\n a_[3].w * b_[0].w,\n a_[0].x * b_[1].x +\n a_[1].x * b_[1].y +\n a_[2].x * b_[1].z +\n a_[3].x * b_[1].w,\n a_[0].y * b_[1].x +\n a_[1].y * b_[1].y +\n a_[2].y * b_[1].z +\n a_[3].y * b_[1].w,\n a_[0].z * b_[1].x +\n a_[1].z * b_[1].y +\n a_[2].z * b_[1].z +\n a_[3].z * b_[1].w,\n a_[0].w * b_[1].x +\n a_[1].w * b_[1].y +\n a_[2].w * b_[1].z +\n a_[3].w * b_[1].w,\n a_[0].x * b_[2].x +\n a_[1].x * b_[2].y +\n a_[2].x * b_[2].z +\n a_[3].x * b_[2].w,\n a_[0].y * b_[2].x +\n a_[1].y * b_[2].y +\n a_[2].y * b_[2].z +\n a_[3].y * b_[2].w,\n a_[0].z * b_[2].x +\n a_[1].z * b_[2].y +\n a_[2].z * b_[2].z +\n a_[3].z * b_[2].w,\n a_[0].w * b_[2].x +\n a_[1].w * b_[2].y +\n a_[2].w * b_[2].z +\n a_[3].w * b_[2].w,\n a_[0].x * b_[3].x +\n a_[1].x * b_[3].y +\n a_[2].x * b_[3].z +\n a_[3].x * b_[3].w,\n a_[0].y * b_[3].x +\n a_[1].y * b_[3].y +\n a_[2].y * b_[3].z +\n a_[3].y * b_[3].w,\n a_[0].z * b_[3].x +\n a_[1].z * b_[3].y +\n a_[2].z * b_[3].z +\n a_[3].z * b_[3].w,\n a_[0].w * b_[3].x +\n a_[1].w * b_[3].y +\n a_[2].w * b_[3].z +\n a_[3].w * b_[3].w,\n );\n },\n } as Record<\n VecKind | MatKind,\n <T extends vBase | wgsl.AnyMatInstance>(lhs: T, rhs: T) => T\n >,\n\n mulMxV: {\n mat2x2f: (m: wgsl.m2x2f, v: wgsl.v2f) => {\n const m_ = m.columns;\n return vec2f(\n m_[0].x * v.x + m_[1].x * v.y,\n m_[0].y * v.x + m_[1].y * v.y,\n );\n },\n\n mat3x3f: (m: wgsl.m3x3f, v: wgsl.v3f) => {\n const m_ = m.columns;\n return vec3f(\n m_[0].x * v.x + m_[1].x * v.y + m_[2].x * v.z,\n m_[0].y * v.x + m_[1].y * v.y + m_[2].y * v.z,\n m_[0].z * v.x + m_[1].z * v.y + m_[2].z * v.z,\n );\n },\n\n mat4x4f: (m: wgsl.m4x4f, v: wgsl.v4f) => {\n const m_ = m.columns;\n return vec4f(\n m_[0].x * v.x + m_[1].x * v.y + m_[2].x * v.z + m_[3].x * v.w,\n m_[0].y * v.x + m_[1].y * v.y + m_[2].y * v.z + m_[3].y * v.w,\n m_[0].z * v.x + m_[1].z * v.y + m_[2].z * v.z + m_[3].z * v.w,\n m_[0].w * v.x + m_[1].w * v.y + m_[2].w * v.z + m_[3].w * v.w,\n );\n },\n } as Record<\n MatKind,\n <T extends wgsl.AnyMatInstance>(\n m: T,\n v: wgsl.vBaseForMat<T>,\n ) => wgsl.vBaseForMat<T>\n >,\n\n mulVxM: {\n mat2x2f: (v: wgsl.v2f, m: wgsl.m2x2f) => {\n const m_ = m.columns;\n return vec2f(\n v.x * m_[0].x + v.y * m_[0].y,\n v.x * m_[1].x + v.y * m_[1].y,\n );\n },\n\n mat3x3f: (v: wgsl.v3f, m: wgsl.m3x3f) => {\n const m_ = m.columns;\n return vec3f(\n v.x * m_[0].x + v.y * m_[0].y + v.z * m_[0].z,\n v.x * m_[1].x + v.y * m_[1].y + v.z * m_[1].z,\n v.x * m_[2].x + v.y * m_[2].y + v.z * m_[2].z,\n );\n },\n\n mat4x4f: (v: wgsl.v4f, m: wgsl.m4x4f) => {\n const m_ = m.columns;\n return vec4f(\n v.x * m_[0].x + v.y * m_[0].y + v.z * m_[0].z + v.w * m_[0].w,\n v.x * m_[1].x + v.y * m_[1].y + v.z * m_[1].z + v.w * m_[1].w,\n v.x * m_[2].x + v.y * m_[2].y + v.z * m_[2].z + v.w * m_[2].w,\n v.x * m_[3].x + v.y * m_[3].y + v.z * m_[3].z + v.w * m_[3].w,\n );\n },\n } as Record<\n MatKind,\n <T extends wgsl.AnyMatInstance>(\n v: wgsl.vBaseForMat<T>,\n m: T,\n ) => wgsl.vBaseForMat<T>\n >,\n\n div: {\n vec2f: binaryComponentWise2f((a, b) => a / b),\n vec2h: binaryComponentWise2h((a, b) => a / b),\n vec2i: binaryComponentWise2i(divInteger),\n vec2u: binaryComponentWise2u(divInteger),\n\n vec3f: binaryComponentWise3f((a, b) => a / b),\n vec3h: binaryComponentWise3h((a, b) => a / b),\n vec3i: binaryComponentWise3i(divInteger),\n vec3u: binaryComponentWise3u(divInteger),\n\n vec4f: binaryComponentWise4f((a, b) => a / b),\n vec4h: binaryComponentWise4h((a, b) => a / b),\n vec4i: binaryComponentWise4i(divInteger),\n vec4u: binaryComponentWise4u(divInteger),\n } as Record<VecKind, <T extends vBase>(a: T, b: T) => T>,\n\n dot: {\n vec2f: dotVec2,\n vec2h: dotVec2,\n vec2i: dotVec2,\n vec2u: dotVec2,\n vec3f: dotVec3,\n vec3h: dotVec3,\n vec3i: dotVec3,\n vec3u: dotVec3,\n vec4f: dotVec4,\n vec4h: dotVec4,\n vec4i: dotVec4,\n vec4u: dotVec4,\n } as Record<VecKind, <T extends vBase>(lhs: T, rhs: T) => number>,\n\n normalize: {\n vec2f: (v: wgsl.v2f) => {\n const len = lengthVec2(v);\n return vec2f(v.x / len, v.y / len);\n },\n vec2h: (v: wgsl.v2h) => {\n const len = lengthVec2(v);\n return vec2h(v.x / len, v.y / len);\n },\n vec2i: (v: wgsl.v2i) => {\n const len = lengthVec2(v);\n return vec2i(v.x / len, v.y / len);\n },\n vec2u: (v: wgsl.v2u) => {\n const len = lengthVec2(v);\n return vec2u(v.x / len, v.y / len);\n },\n\n vec3f: (v: wgsl.v3f) => {\n const len = lengthVec3(v);\n return vec3f(v.x / len, v.y / len, v.z / len);\n },\n vec3h: (v: wgsl.v3h) => {\n const len = lengthVec3(v);\n return vec3h(v.x / len, v.y / len, v.z / len);\n },\n vec3i: (v: wgsl.v3i) => {\n const len = lengthVec3(v);\n return vec3i(v.x / len, v.y / len, v.z / len);\n },\n vec3u: (v: wgsl.v3u) => {\n const len = lengthVec3(v);\n return vec3u(v.x / len, v.y / len, v.z / len);\n },\n\n vec4f: (v: wgsl.v4f) => {\n const len = lengthVec4(v);\n return vec4f(v.x / len, v.y / len, v.z / len, v.w / len);\n },\n vec4h: (v: wgsl.v4h) => {\n const len = lengthVec4(v);\n return vec4h(v.x / len, v.y / len, v.z / len, v.w / len);\n },\n vec4i: (v: wgsl.v4i) => {\n const len = lengthVec4(v);\n return vec4i(v.x / len, v.y / len, v.z / len, v.w / len);\n },\n vec4u: (v: wgsl.v4u) => {\n const len = lengthVec4(v);\n return vec4u(v.x / len, v.y / len, v.z / len, v.w / len);\n },\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n cross: {\n vec3f: (a: wgsl.v3f, b: wgsl.v3f) => {\n return vec3f(\n a.y * b.z - a.z * b.y,\n a.z * b.x - a.x * b.z,\n a.x * b.y - a.y * b.x,\n );\n },\n vec3h: (a: wgsl.v3h, b: wgsl.v3h) => {\n return vec3h(\n a.y * b.z - a.z * b.y,\n a.z * b.x - a.x * b.z,\n a.x * b.y - a.y * b.x,\n );\n },\n } as Record<\n 'vec3f' | 'vec3h',\n <T extends wgsl.v3f | wgsl.v3h>(a: T, b: T) => T\n >,\n\n mod: {\n vec2f: binaryComponentWise2f((a, b) => a % b),\n vec2h: binaryComponentWise2h((a, b) => a % b),\n vec2i: binaryComponentWise2i((a, b) => a % b),\n vec2u: binaryComponentWise2u((a, b) => a % b),\n\n vec3f: binaryComponentWise3f((a, b) => a % b),\n vec3h: binaryComponentWise3h((a, b) => a % b),\n vec3i: binaryComponentWise3i((a, b) => a % b),\n vec3u: binaryComponentWise3u((a, b) => a % b),\n\n vec4f: binaryComponentWise4f((a, b) => a % b),\n vec4h: binaryComponentWise4h((a, b) => a % b),\n vec4i: binaryComponentWise4i((a, b) => a % b),\n vec4u: binaryComponentWise4u((a, b) => a % b),\n } as Record<VecKind, <T extends vBase>(a: T, b: T) => T>,\n\n floor: {\n vec2f: unary2f(Math.floor),\n vec2h: unary2h(Math.floor),\n\n vec3f: unary3f(Math.floor),\n vec3h: unary3h(Math.floor),\n\n vec4f: unary4f(Math.floor),\n vec4h: unary4h(Math.floor),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n max: {\n vec2f: binaryComponentWise2f(Math.max),\n vec2h: binaryComponentWise2h(Math.max),\n vec2i: binaryComponentWise2i(Math.max),\n vec2u: binaryComponentWise2u(Math.max),\n\n vec3f: binaryComponentWise3f(Math.max),\n vec3h: binaryComponentWise3h(Math.max),\n vec3i: binaryComponentWise3i(Math.max),\n vec3u: binaryComponentWise3u(Math.max),\n\n vec4f: binaryComponentWise4f(Math.max),\n vec4h: binaryComponentWise4h(Math.max),\n vec4i: binaryComponentWise4i(Math.max),\n vec4u: binaryComponentWise4u(Math.max),\n } as Record<VecKind, <T extends vBase>(a: T, b: T) => T>,\n\n min: {\n vec2f: binaryComponentWise2f(Math.min),\n vec2h: binaryComponentWise2h(Math.min),\n vec2i: binaryComponentWise2i(Math.min),\n vec2u: binaryComponentWise2u(Math.min),\n\n vec3f: binaryComponentWise3f(Math.min),\n vec3h: binaryComponentWise3h(Math.min),\n vec3i: binaryComponentWise3i(Math.min),\n vec3u: binaryComponentWise3u(Math.min),\n\n vec4f: binaryComponentWise4f(Math.min),\n vec4h: binaryComponentWise4h(Math.min),\n vec4i: binaryComponentWise4i(Math.min),\n vec4u: binaryComponentWise4u(Math.min),\n } as Record<VecKind, <T extends vBase>(a: T, b: T) => T>,\n\n pow: {\n vec2f: (base: wgsl.v2f, exponent: wgsl.v2f) =>\n vec2f(base.x ** exponent.x, base.y ** exponent.y),\n vec2h: (base: wgsl.v2h, exponent: wgsl.v2h) =>\n vec2h(base.x ** exponent.x, base.y ** exponent.y),\n\n vec3f: (base: wgsl.v3f, exponent: wgsl.v3f) =>\n vec3f(base.x ** exponent.x, base.y ** exponent.y, base.z ** exponent.z),\n vec3h: (base: wgsl.v3h, exponent: wgsl.v3h) =>\n vec3h(base.x ** exponent.x, base.y ** exponent.y, base.z ** exponent.z),\n\n vec4f: (base: wgsl.v4f, exponent: wgsl.v4f) =>\n vec4f(\n base.x ** exponent.x,\n base.y ** exponent.y,\n base.z ** exponent.z,\n base.w ** exponent.w,\n ),\n vec4h: (base: wgsl.v4h, exponent: wgsl.v4h) =>\n vec4h(\n base.x ** exponent.x,\n base.y ** exponent.y,\n base.z ** exponent.z,\n base.w ** exponent.w,\n ),\n } as Record<\n 'vec2f' | 'vec3f' | 'vec4f' | 'vec2h' | 'vec3h' | 'vec4h' | 'number',\n <T extends wgsl.AnyFloatVecInstance | number>(a: T, b: T) => T\n >,\n\n sign: {\n vec2f: unary2f(Math.sign),\n vec2h: unary2h(Math.sign),\n vec2i: unary2i(Math.sign),\n\n vec3f: unary3f(Math.sign),\n vec3h: unary3h(Math.sign),\n vec3i: unary3i(Math.sign),\n\n vec4f: unary4f(Math.sign),\n vec4h: unary4h(Math.sign),\n vec4i: unary4i(Math.sign),\n } as Record<VecKind, <T extends vBase>(e: T) => T>,\n\n sqrt: {\n vec2f: unary2f(Math.sqrt),\n vec2h: unary2h(Math.sqrt),\n\n vec3f: unary3f(Math.sqrt),\n vec3h: unary3h(Math.sqrt),\n\n vec4f: unary4f(Math.sqrt),\n vec4h: unary4h(Math.sqrt),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n mix: {\n vec2f: (e1: wgsl.v2f, e2: wgsl.v2f, e3: wgsl.v2f | number) => {\n if (typeof e3 === 'number') {\n return vec2f(e1.x * (1 - e3) + e2.x * e3, e1.y * (1 - e3) + e2.y * e3);\n }\n return vec2f(\n e1.x * (1 - e3.x) + e2.x * e3.x,\n e1.y * (1 - e3.y) + e2.y * e3.y,\n );\n },\n vec2h: (e1: wgsl.v2h, e2: wgsl.v2h, e3: wgsl.v2h | number) => {\n if (typeof e3 === 'number') {\n return vec2h(e1.x * (1 - e3) + e2.x * e3, e1.y * (1 - e3) + e2.y * e3);\n }\n return vec2h(\n e1.x * (1 - e3.x) + e2.x * e3.x,\n e1.y * (1 - e3.y) + e2.y * e3.y,\n );\n },\n\n vec3f: (e1: wgsl.v3f, e2: wgsl.v3f, e3: wgsl.v3f | number) => {\n if (typeof e3 === 'number') {\n return vec3f(\n e1.x * (1 - e3) + e2.x * e3,\n e1.y * (1 - e3) + e2.y * e3,\n e1.z * (1 - e3) + e2.z * e3,\n );\n }\n return vec3f(\n e1.x * (1 - e3.x) + e2.x * e3.x,\n e1.y * (1 - e3.y) + e2.y * e3.y,\n e1.z * (1 - e3.z) + e2.z * e3.z,\n );\n },\n vec3h: (e1: wgsl.v3h, e2: wgsl.v3h, e3: wgsl.v3h | number) => {\n if (typeof e3 === 'number') {\n return vec3h(\n e1.x * (1 - e3) + e2.x * e3,\n e1.y * (1 - e3) + e2.y * e3,\n e1.z * (1 - e3) + e2.z * e3,\n );\n }\n return vec3h(\n e1.x * (1 - e3.x) + e2.x * e3.x,\n e1.y * (1 - e3.y) + e2.y * e3.y,\n e1.z * (1 - e3.z) + e2.z * e3.z,\n );\n },\n\n vec4f: (e1: wgsl.v4f, e2: wgsl.v4f, e3: wgsl.v4f | number) => {\n if (typeof e3 === 'number') {\n return vec4f(\n e1.x * (1 - e3) + e2.x * e3,\n e1.y * (1 - e3) + e2.y * e3,\n e1.z * (1 - e3) + e2.z * e3,\n e1.w * (1 - e3) + e2.w * e3,\n );\n }\n return vec4f(\n e1.x * (1 - e3.x) + e2.x * e3.x,\n e1.y * (1 - e3.y) + e2.y * e3.y,\n e1.z * (1 - e3.z) + e2.z * e3.z,\n e1.w * (1 - e3.w) + e2.w * e3.w,\n );\n },\n vec4h: (e1: wgsl.v4h, e2: wgsl.v4h, e3: wgsl.v4h | number) => {\n if (typeof e3 === 'number') {\n return vec4h(\n e1.x * (1 - e3) + e2.x * e3,\n e1.y * (1 - e3) + e2.y * e3,\n e1.z * (1 - e3) + e2.z * e3,\n e1.w * (1 - e3) + e2.w * e3,\n );\n }\n return vec4h(\n e1.x * (1 - e3.x) + e2.x * e3.x,\n e1.y * (1 - e3.y) + e2.y * e3.y,\n e1.z * (1 - e3.z) + e2.z * e3.z,\n e1.w * (1 - e3.w) + e2.w * e3.w,\n );\n },\n } as Record<\n 'vec2f' | 'vec3f' | 'vec4f' | 'vec2h' | 'vec3h' | 'vec4h',\n <T extends wgsl.v2f | wgsl.v3f | wgsl.v4f | wgsl.v2h | wgsl.v3h | wgsl.v4h>(\n a: T,\n b: T,\n c: T | number,\n ) => T\n >,\n\n sin: {\n vec2f: unary2f(Math.sin),\n vec2h: unary2h(Math.sin),\n\n vec3f: unary3f(Math.sin),\n vec3h: unary3h(Math.sin),\n\n vec4f: unary4f(Math.sin),\n vec4h: unary4h(Math.sin),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n cos: {\n vec2f: unary2f(Math.cos),\n vec2h: unary2h(Math.cos),\n\n vec3f: unary3f(Math.cos),\n vec3h: unary3h(Math.cos),\n\n vec4f: unary4f(Math.cos),\n vec4h: unary4h(Math.cos),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n cosh: {\n vec2f: unary2f(Math.cosh),\n vec2h: unary2h(Math.cosh),\n\n vec3f: unary3f(Math.cosh),\n vec3h: unary3h(Math.cosh),\n\n vec4f: unary4f(Math.cosh),\n vec4h: unary4h(Math.cosh),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n exp: {\n vec2f: unary2f(Math.exp),\n vec2h: unary2h(Math.exp),\n\n vec3f: unary3f(Math.exp),\n vec3h: unary3h(Math.exp),\n\n vec4f: unary4f(Math.exp),\n vec4h: unary4h(Math.exp),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n exp2: {\n vec2f: unary2f((val) => 2 ** val),\n vec2h: unary2h((val) => 2 ** val),\n\n vec3f: unary3f((val) => 2 ** val),\n vec3h: unary3h((val) => 2 ** val),\n\n vec4f: unary4f((val) => 2 ** val),\n vec4h: unary4h((val) => 2 ** val),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n log: {\n vec2f: unary2f(Math.log),\n vec2h: unary2h(Math.log),\n\n vec3f: unary3f(Math.log),\n vec3h: unary3h(Math.log),\n\n vec4f: unary4f(Math.log),\n vec4h: unary4h(Math.log),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n log2: {\n vec2f: unary2f(Math.log2),\n vec2h: unary2h(Math.log2),\n\n vec3f: unary3f(Math.log2),\n vec3h: unary3h(Math.log2),\n\n vec4f: unary4f(Math.log2),\n vec4h: unary4h(Math.log2),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n fract: {\n vec2f: unary2f((value) => value - Math.floor(value)),\n vec2h: unary2h((value) => value - Math.floor(value)),\n\n vec3f: unary3f((value) => value - Math.floor(value)),\n vec3h: unary3h((value) => value - Math.floor(value)),\n\n vec4f: unary4f((value) => value - Math.floor(value)),\n vec4h: unary4h((value) => value - Math.floor(value)),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n isCloseToZero: {\n vec2f: (v: wgsl.v2f, n: number) => Math.abs(v.x) <= n && Math.abs(v.y) <= n,\n vec2h: (v: wgsl.v2h, n: number) => Math.abs(v.x) <= n && Math.abs(v.y) <= n,\n\n vec3f: (v: wgsl.v3f, n: number) =>\n Math.abs(v.x) <= n && Math.abs(v.y) <= n && Math.abs(v.z) <= n,\n vec3h: (v: wgsl.v3h, n: number) =>\n Math.abs(v.x) <= n && Math.abs(v.y) <= n && Math.abs(v.z) <= n,\n\n vec4f: (v: wgsl.v4f, n: number) =>\n Math.abs(v.x) <= n &&\n Math.abs(v.y) <= n &&\n Math.abs(v.z) <= n &&\n Math.abs(v.w) <= n,\n vec4h: (v: wgsl.v4h, n: number) =>\n Math.abs(v.x) <= n &&\n Math.abs(v.y) <= n &&\n Math.abs(v.z) <= n &&\n Math.abs(v.w) <= n,\n } as Record<VecKind, <T extends vBase>(v: T, n: number) => boolean>,\n\n neg: {\n vec2f: unary2f((value) => -value),\n vec2h: unary2h((value) => -value),\n vec2i: unary2i((value) => -value),\n vec2u: unary2u((value) => -value),\n 'vec2<bool>': (e: wgsl.v2b) => vec2b(!e.x, !e.y),\n\n vec3f: unary3f((value) => -value),\n vec3h: unary3h((value) => -value),\n vec3i: unary3i((value) => -value),\n vec3u: unary3u((value) => -value),\n 'vec3<bool>': (e: wgsl.v3b) => vec3b(!e.x, !e.y, !e.z),\n\n vec4f: unary4f((value) => -value),\n vec4h: unary4h((value) => -value),\n vec4i: unary4i((value) => -value),\n vec4u: unary4u((value) => -value),\n 'vec4<bool>': (e: wgsl.v4b) => vec4b(!e.x, !e.y, !e.z, !e.w),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n\n select: {\n vec2f: (f: wgsl.v2f, t: wgsl.v2f, c: wgsl.v2b) =>\n vec2f(c.x ? t.x : f.x, c.y ? t.y : f.y),\n vec2h: (f: wgsl.v2h, t: wgsl.v2h, c: wgsl.v2b) =>\n vec2h(c.x ? t.x : f.x, c.y ? t.y : f.y),\n vec2i: (f: wgsl.v2i, t: wgsl.v2i, c: wgsl.v2b) =>\n vec2i(c.x ? t.x : f.x, c.y ? t.y : f.y),\n vec2u: (f: wgsl.v2u, t: wgsl.v2u, c: wgsl.v2b) =>\n vec2u(c.x ? t.x : f.x, c.y ? t.y : f.y),\n 'vec2<bool>': (f: wgsl.v2b, t: wgsl.v2b, c: wgsl.v2b) =>\n vec2b(c.x ? t.x : f.x, c.y ? t.y : f.y),\n\n vec3f: (f: wgsl.v3f, t: wgsl.v3f, c: wgsl.v3b) =>\n vec3f(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z),\n vec3h: (f: wgsl.v3h, t: wgsl.v3h, c: wgsl.v3b) =>\n vec3h(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z),\n vec3i: (f: wgsl.v3i, t: wgsl.v3i, c: wgsl.v3b) =>\n vec3i(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z),\n vec3u: (f: wgsl.v3u, t: wgsl.v3u, c: wgsl.v3b) =>\n vec3u(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z),\n 'vec3<bool>': (f: wgsl.v3b, t: wgsl.v3b, c: wgsl.v3b) =>\n vec3b(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z),\n\n vec4f: (f: wgsl.v4f, t: wgsl.v4f, c: wgsl.v4b) =>\n vec4f(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z, c.w ? t.w : f.w),\n vec4h: (f: wgsl.v4h, t: wgsl.v4h, c: wgsl.v4b) =>\n vec4h(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z, c.w ? t.w : f.w),\n vec4i: (f: wgsl.v4i, t: wgsl.v4i, c: wgsl.v4b) =>\n vec4i(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z, c.w ? t.w : f.w),\n vec4u: (f: wgsl.v4u, t: wgsl.v4u, c: wgsl.v4b) =>\n vec4u(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z, c.w ? t.w : f.w),\n 'vec4<bool>': (f: wgsl.v4b, t: wgsl.v4b, c: wgsl.v4b) =>\n vec4b(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z, c.w ? t.w : f.w),\n } as Record<\n VecKind,\n <T extends wgsl.AnyVecInstance>(\n f: T,\n t: T,\n c: T extends wgsl.AnyVec2Instance ? wgsl.v2b\n : T extends wgsl.AnyVec3Instance ? wgsl.v3b\n : wgsl.v4b,\n ) => T\n >,\n\n tanh: {\n vec2f: unary2f(Math.tanh),\n vec2h: unary2h(Math.tanh),\n\n vec3f: unary3f(Math.tanh),\n vec3h: unary3h(Math.tanh),\n\n vec4f: unary4f(Math.tanh),\n vec4h: unary4h(Math.tanh),\n } as Record<VecKind, <T extends vBase>(v: T) => T>,\n};\n","import { vecTypeToConstructor } from '../data/vector.ts';\nimport type { AnyData, TgpuDualFn } from '../data/dataTypes.ts';\nimport { snip, type Snippet } from '../data/snippet.ts';\nimport { smoothstepScalar } from '../data/numberOps.ts';\nimport { f32 } from '../data/numeric.ts';\nimport { VectorOps } from '../data/vectorOps.ts';\nimport {\n type AbstractFloat,\n type AbstractInt,\n type AnyFloatVecInstance,\n type AnyMatInstance,\n type AnyNumericVecInstance,\n type F16,\n type F32,\n type I32,\n isFloat32VecInstance,\n isMatInstance,\n isVecInstance,\n type mBaseForVec,\n type U32,\n type v2f,\n type v2h,\n type v2i,\n type v3f,\n type v3h,\n type v3i,\n type v4f,\n type v4h,\n type v4i,\n type vBaseForMat,\n} from '../data/wgslTypes.ts';\nimport { createDualImpl } from '../core/function/dualImpl.ts';\nimport { $internal } from '../shared/symbols.ts';\n\ntype NumVec = AnyNumericVecInstance;\ntype Mat = AnyMatInstance;\n\nexport function isSnippetNumeric(snippet: Snippet) {\n return isNumericSchema(snippet.dataType);\n}\n\nexport function isNumericSchema(\n schema: unknown,\n): schema is AbstractInt | AbstractFloat | F32 | F16 | I32 | U32 {\n const type = (schema as AnyData)?.type;\n\n return (\n !!(schema as AnyData)?.[$internal] &&\n (type === 'abstractInt' ||\n type === 'abstractFloat' ||\n type === 'f32' ||\n type === 'f16' ||\n type === 'i32' ||\n type === 'u32')\n );\n}\n\nfunction cpuAdd(lhs: number, rhs: number): number; // default addition\nfunction cpuAdd<T extends NumVec>(lhs: number, rhs: T): T; // mixed addition\nfunction cpuAdd<T extends NumVec>(lhs: T, rhs: number): T; // mixed addition\nfunction cpuAdd<T extends NumVec | Mat>(lhs: T, rhs: T): T; // component-wise addition\nfunction cpuAdd<\n // union overload\n Lhs extends number | NumVec | Mat,\n Rhs extends (Lhs extends number ? number | NumVec\n : Lhs extends NumVec ? number | Lhs\n : Lhs extends Mat ? Lhs\n : never),\n>(lhs: Lhs, rhs: Rhs): Lhs | Rhs;\nfunction cpuAdd(lhs: number | NumVec | Mat, rhs: number | NumVec | Mat) {\n if (typeof lhs === 'number' && typeof rhs === 'number') {\n return lhs + rhs; // default addition\n }\n if (typeof lhs === 'number' && isVecInstance(rhs)) {\n return VectorOps.addMixed[rhs.kind](rhs, lhs); // mixed addition\n }\n if (isVecInstance(lhs) && typeof rhs === 'number') {\n return VectorOps.addMixed[lhs.kind](lhs, rhs); // mixed addition\n }\n if (\n (isVecInstance(lhs) && isVecInstance(rhs)) ||\n (isMatInstance(lhs) && isMatInstance(rhs))\n ) {\n return VectorOps.add[lhs.kind](lhs, rhs); // component-wise addition\n }\n\n throw new Error('Add/Sub called with invalid arguments.');\n}\n\nexport const add = createDualImpl(\n // CPU implementation\n cpuAdd,\n // GPU implementation\n (lhs, rhs) =>\n snip(\n `(${lhs.value} + ${rhs.value})`,\n isSnippetNumeric(lhs) ? rhs.dataType : lhs.dataType,\n ),\n 'unify',\n);\n\nfunction cpuSub(lhs: number, rhs: number): number; // default subtraction\nfunction cpuSub<T extends NumVec>(lhs: number, rhs: T): T; // mixed subtraction\nfunction cpuSub<T extends NumVec>(lhs: T, rhs: number): T; // mixed subtraction\nfunction cpuSub<T extends NumVec | Mat>(lhs: T, rhs: T): T; // component-wise subtraction\nfunction cpuSub<\n // union overload\n Lhs extends number | NumVec | Mat,\n Rhs extends (Lhs extends number ? number | NumVec\n : Lhs extends NumVec ? number | Lhs\n : Lhs extends Mat ? Lhs\n : never),\n>(lhs: Lhs, rhs: Rhs): Lhs | Rhs;\nfunction cpuSub(lhs: number | NumVec | Mat, rhs: number | NumVec | Mat) {\n // while illegal on the wgsl side, we can do this in js\n return cpuAdd(lhs, mul(-1, rhs));\n}\n\nexport const sub = createDualImpl(\n // CPU implementation\n cpuSub,\n // GPU implementation\n (lhs, rhs) =>\n snip(\n `(${lhs.value} - ${rhs.value})`,\n isSnippetNumeric(lhs) ? rhs.dataType : lhs.dataType,\n ),\n 'sub',\n 'unify',\n);\n\nfunction cpuMul(lhs: number, rhs: number): number; // default multiplication\nfunction cpuMul<MV extends NumVec | Mat>(lhs: number, rhs: MV): MV; // scale\nfunction cpuMul<MV extends NumVec | Mat>(lhs: MV, rhs: number): MV; // scale\nfunction cpuMul<V extends NumVec>(lhs: V, rhs: V): V; // component-wise multiplication\nfunction cpuMul<M extends Mat, V extends vBaseForMat<M>>(lhs: V, rhs: M): V; // row-vector-matrix\nfunction cpuMul<M extends Mat, V extends vBaseForMat<M>>(lhs: M, rhs: V): V; // matrix-column-vector\nfunction cpuMul<M extends Mat>(lhs: M, rhs: M): M; // matrix multiplication\nfunction cpuMul<\n // union overload\n Lhs extends number | NumVec | Mat,\n Rhs extends (\n Lhs extends number ? number | NumVec | Mat\n : Lhs extends NumVec ? number | Lhs | mBaseForVec<Lhs>\n : Lhs extends Mat ? number | vBaseForMat<Lhs> | Lhs\n : never\n ),\n>(lhs: Lhs, rhs: Rhs): Lhs | Rhs;\nfunction cpuMul(lhs: number | NumVec | Mat, rhs: number | NumVec | Mat) {\n if (typeof lhs === 'number' && typeof rhs === 'number') {\n return lhs * rhs; // default multiplication\n }\n if (typeof lhs === 'number' && (isVecInstance(rhs) || isMatInstance(rhs))) {\n return VectorOps.mulSxV[rhs.kind](lhs, rhs); // scale\n }\n if ((isVecInstance(lhs) || isMatInstance(lhs)) && typeof rhs === 'number') {\n return VectorOps.mulSxV[lhs.kind](rhs, lhs); // scale\n }\n if (isVecInstance(lhs) && isVecInstance(rhs)) {\n return VectorOps.mulVxV[lhs.kind](lhs, rhs); // component-wise\n }\n if (isFloat32VecInstance(lhs) && isMatInstance(rhs)) {\n return VectorOps.mulVxM[rhs.kind](lhs, rhs); // row-vector-matrix\n }\n if (isMatInstance(lhs) && isFloat32VecInstance(rhs)) {\n return VectorOps.mulMxV[lhs.kind](lhs, rhs); // matrix-column-vector\n }\n if (isMatInstance(lhs) && isMatInstance(rhs)) {\n return VectorOps.mulVxV[lhs.kind](lhs, rhs); // matrix multiplication\n }\n\n throw new Error('Mul called with invalid arguments.');\n}\n\nexport const mul = createDualImpl(\n // CPU implementation\n cpuMul,\n // GPU implementation\n (lhs, rhs) => {\n const returnType = isSnippetNumeric(lhs)\n // Scalar * Scalar/Vector/Matrix\n ? rhs.dataType\n : isSnippetNumeric(rhs)\n // Vector/Matrix * Scalar\n ? lhs.dataType\n : lhs.dataType.type.startsWith('vec')\n // Vector * Vector/Matrix\n ? lhs.dataType\n : rhs.dataType.type.startsWith('vec')\n // Matrix * Vector\n ? rhs.dataType\n // Matrix * Matrix\n : lhs.dataType;\n return snip(`(${lhs.value} * ${rhs.value})`, returnType);\n },\n 'mul',\n);\n\ntype DivOverload = {\n (lhs: number, rhs: number): number; // default js division\n <T extends NumVec | number>(lhs: T, rhs: T): T; // component-wise division\n <T extends NumVec | number>(lhs: number, rhs: T): T; // mixed division\n <T extends NumVec | number>(lhs: T, rhs: number): T; // mixed division\n};\n\nexport const div: TgpuDualFn<DivOverload> = createDualImpl(\n // CPU implementation\n <T extends NumVec | number>(lhs: T, rhs: T): T => {\n if (typeof lhs === 'number' && typeof rhs === 'number') {\n return (lhs / rhs) as T;\n }\n if (typeof lhs === 'number' && isVecInstance(rhs)) {\n const schema = vecTypeToConstructor[rhs.kind];\n return VectorOps.div[rhs.kind](schema(lhs), rhs) as T;\n }\n if (isVecInstance(lhs) && typeof rhs === 'number') {\n const schema = vecTypeToConstructor[lhs.kind];\n return VectorOps.div[lhs.kind](lhs, schema(rhs)) as T;\n }\n if (isVecInstance(lhs) && isVecInstance(rhs)) {\n return VectorOps.div[lhs.kind](lhs, rhs) as T;\n }\n throw new Error('Div called with invalid arguments.');\n },\n // GPU implementation\n (lhs, rhs) => {\n if (isSnippetNumeric(lhs) && isSnippetNumeric(rhs)) {\n return snip(`(f32(${lhs.value}) / ${rhs.value})`, f32);\n }\n return snip(`(${lhs.value} / ${rhs.value})`, lhs.dataType);\n },\n 'div',\n);\n\nexport const abs = createDualImpl(\n // CPU implementation\n <T extends NumVec | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.abs(value) as T;\n }\n return VectorOps.abs[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`abs(${value.value})`, value.dataType),\n 'abs',\n);\n\nexport const atan2 = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(y: T, x: T): T => {\n if (typeof y === 'number' && typeof x === 'number') {\n return Math.atan2(y, x) as T;\n }\n return VectorOps.atan2[(y as AnyFloatVecInstance).kind](\n y as never,\n x as never,\n ) as T;\n },\n // GPU implementation\n (y, x) => snip(`atan2(${y.value}, ${x.value})`, y.dataType),\n 'atan2',\n);\n\nexport const acos = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.acos(value) as T;\n }\n return VectorOps.acos[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`acos(${value.value})`, value.dataType),\n 'acos',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#acosh-builtin\n */\nexport const acosh = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.acosh(value) as T;\n }\n return VectorOps.acosh[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`acosh(${value.value})`, value.dataType),\n 'acosh',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#asin-builtin\n */\nexport const asin = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.asin(value) as T;\n }\n return VectorOps.asin[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`asin(${value.value})`, value.dataType),\n 'asin',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#ceil-builtin\n */\nexport const ceil = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.ceil(value) as T;\n }\n return VectorOps.ceil[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`ceil(${value.value})`, value.dataType),\n 'ceil',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#clamp\n */\nexport const clamp = createDualImpl(\n // CPU implementation\n <T extends NumVec | number>(value: T, low: T, high: T): T => {\n if (typeof value === 'number') {\n return Math.min(Math.max(low as number, value), high as number) as T;\n }\n return VectorOps.clamp[value.kind](\n value,\n low as NumVec,\n high as NumVec,\n ) as T;\n },\n // GPU implementation\n (value, low, high) =>\n snip(`clamp(${value.value}, ${low.value}, ${high.value})`, value.dataType),\n 'clamp',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#cos-builtin\n */\nexport const cos = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.cos(value) as T;\n }\n return VectorOps.cos[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`cos(${value.value})`, value.dataType),\n 'cos',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#cosh-builtin\n */\nexport const cosh = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.cosh(value) as T;\n }\n return VectorOps.cosh[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`cosh(${value.value})`, value.dataType),\n 'cosh',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#cross-builtin\n */\nexport const cross = createDualImpl(\n // CPU implementation\n <T extends v3f | v3h>(a: T, b: T): T => VectorOps.cross[a.kind](a, b),\n // GPU implementation\n (a, b) => snip(`cross(${a.value}, ${b.value})`, a.dataType),\n 'cross',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#dot-builtin\n */\nexport const dot = createDualImpl(\n // CPU implementation\n <T extends NumVec>(lhs: T, rhs: T): number =>\n VectorOps.dot[lhs.kind](lhs, rhs),\n // GPU implementation\n (lhs, rhs) => snip(`dot(${lhs.value}, ${rhs.value})`, f32),\n 'dot',\n);\n\nexport const normalize = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance>(v: T): T => VectorOps.normalize[v.kind](v),\n // GPU implementation\n (v) => snip(`normalize(${v.value})`, v.dataType),\n 'normalize',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#floor-builtin\n */\nexport const floor = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.floor(value) as T;\n }\n return VectorOps.floor[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`floor(${value.value})`, value.dataType),\n 'floor',\n);\n\nexport const fract = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(a: T): T => {\n if (typeof a === 'number') {\n return (a - Math.floor(a)) as T;\n }\n return VectorOps.fract[a.kind](a) as T;\n },\n // GPU implementation\n (a) => snip(`fract(${a.value})`, a.dataType),\n 'fract',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#length-builtin\n */\nexport const length = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): number => {\n if (typeof value === 'number') {\n return Math.abs(value);\n }\n return VectorOps.length[value.kind](value);\n },\n // GPU implementation\n (value) => snip(`length(${value.value})`, f32),\n 'length',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#log-builtin\n */\nexport const log = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.log(value) as T;\n }\n return VectorOps.log[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`log(${value.value})`, value.dataType),\n 'log',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#log2-builtin\n */\nexport const log2 = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.log2(value) as T;\n }\n return VectorOps.log2[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`log2(${value.value})`, value.dataType),\n 'log2',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#max-float-builtin\n */\nexport const max = createDualImpl(\n // CPU implementation\n <T extends NumVec | number>(a: T, b: T): T => {\n if (typeof a === 'number') {\n return Math.max(a, b as number) as T;\n }\n return VectorOps.max[a.kind](a, b as NumVec) as T;\n },\n // GPU implementation\n (a, b) => snip(`max(${a.value}, ${b.value})`, a.dataType),\n 'max',\n 'unify',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#min-float-builtin\n */\nexport const min = createDualImpl(\n // CPU implementation\n <T extends NumVec | number>(a: T, b: T): T => {\n if (typeof a === 'number') {\n return Math.min(a, b as number) as T;\n }\n return VectorOps.min[a.kind](a, b as NumVec) as T;\n },\n // GPU implementation\n (a, b) => snip(`min(${a.value}, ${b.value})`, a.dataType),\n 'min',\n 'unify',\n);\n\nexport const sign = createDualImpl(\n // CPU implementation\n // \\/ specifically no unsigned variants\n <T extends v2f | v2h | v2i | v3f | v3h | v3i | v4f | v4h | v4i | number>(\n e: T,\n ): T => {\n if (typeof e === 'number') {\n return Math.sign(e) as T;\n }\n return VectorOps.sign[e.kind](e) as T;\n },\n // GPU implementation\n (e) => snip(`sign(${e.value})`, e.dataType),\n 'sign',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#sin-builtin\n */\nexport const sin = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.sin(value) as T;\n }\n return VectorOps.sin[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`sin(${value.value})`, value.dataType),\n 'sin',\n);\n\ntype ModOverload = {\n (a: number, b: number): number;\n <T extends NumVec>(a: T, b: T): T;\n <T extends NumVec>(a: number, b: T): T;\n <T extends NumVec>(a: T, b: number): T;\n};\n\n/**\n * @privateRemarks\n * Both JS and WGSL implementations use truncated definition of modulo\n */\nexport const mod: ModOverload = createDualImpl(\n // CPU implementation\n <T extends NumVec | number>(a: T, b: T): T => {\n if (typeof a === 'number' && typeof b === 'number') {\n return (a % b) as T; // scalar % scalar\n }\n if (typeof a === 'number' && isVecInstance(b)) {\n // scalar % vector\n const schema = vecTypeToConstructor[b.kind];\n return VectorOps.mod[b.kind](schema(a), b) as T;\n }\n if (isVecInstance(a) && typeof b === 'number') {\n const schema = vecTypeToConstructor[a.kind];\n // vector % scalar\n return VectorOps.mod[a.kind](a, schema(b)) as T;\n }\n\n if (isVecInstance(a) && isVecInstance(b)) {\n // vector % vector\n return VectorOps.mod[a.kind](a, b) as T;\n }\n throw new Error(\n 'Mod called with invalid arguments, expected types: number or vector.',\n );\n },\n // GPU implementation\n (a, b) => {\n const type = isSnippetNumeric(a) ? b.dataType : a.dataType;\n return snip(`(${a.value} % ${b.value})`, type);\n },\n 'mod',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#exp-builtin\n */\nexport const exp = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.exp(value) as T;\n }\n return VectorOps.exp[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`exp(${value.value})`, value.dataType),\n 'exp',\n);\n\n/**\n * @privateRemarks\n * https://www.w3.org/TR/WGSL/#exp2-builtin\n */\nexport const exp2 = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return (2 ** value) as T;\n }\n return VectorOps.exp2[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`exp2(${value.value})`, value.dataType),\n 'exp2',\n);\n\ntype PowOverload = {\n (base: number, exponent: number): number;\n <T extends AnyFloatVecInstance>(base: T, exponent: T): T;\n};\n\nexport const pow: PowOverload = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(base: T, exponent: T): T => {\n if (typeof base === 'number' && typeof exponent === 'number') {\n return (base ** exponent) as T;\n }\n if (\n typeof base === 'object' &&\n typeof exponent === 'object' &&\n 'kind' in base &&\n 'kind' in exponent\n ) {\n return VectorOps.pow[base.kind](base, exponent) as T;\n }\n throw new Error('Invalid arguments to pow()');\n },\n // GPU implementation\n (base, exponent) =>\n snip(`pow(${base.value}, ${exponent.value})`, base.dataType),\n 'pow',\n);\n\ntype MixOverload = {\n (e1: number, e2: number, e3: number): number;\n <T extends AnyFloatVecInstance>(e1: T, e2: T, e3: number): T;\n <T extends AnyFloatVecInstance>(e1: T, e2: T, e3: T): T;\n};\n\nexport const mix: MixOverload = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(e1: T, e2: T, e3: T | number): T => {\n if (typeof e1 === 'number') {\n if (typeof e3 !== 'number' || typeof e2 !== 'number') {\n throw new Error(\n 'When e1 and e2 are numbers, the blend factor must be a number.',\n );\n }\n return (e1 * (1 - e3) + e2 * e3) as T;\n }\n\n if (typeof e1 === 'number' || typeof e2 === 'number') {\n throw new Error('e1 and e2 need to both be vectors of the same kind.');\n }\n\n return VectorOps.mix[e1.kind](e1, e2, e3) as T;\n },\n // GPU implementation\n (e1, e2, e3) =>\n snip(`mix(${e1.value}, ${e2.value}, ${e3.value})`, e1.dataType),\n 'mix',\n);\n\nexport const reflect = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance>(e1: T, e2: T): T =>\n sub(e1, mul(2 * dot(e2, e1), e2)),\n // GPU implementation\n (e1, e2) => snip(`reflect(${e1.value}, ${e2.value})`, e1.dataType),\n 'reflect',\n);\n\nexport const distance = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(a: T, b: T): number => {\n if (typeof a === 'number' && typeof b === 'number') {\n return Math.abs(a - b);\n }\n return length(\n sub(a as AnyFloatVecInstance, b as AnyFloatVecInstance),\n ) as number;\n },\n // GPU implementation\n (a, b) => snip(`distance(${a.value}, ${b.value})`, f32),\n 'distance',\n);\n\nexport const neg = createDualImpl(\n // CPU implementation\n <T extends NumVec | number>(value: T): T => {\n if (typeof value === 'number') {\n return -value as T;\n }\n return VectorOps.neg[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`-(${value.value})`, value.dataType),\n 'neg',\n);\n\nexport const sqrt = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.sqrt(value) as T;\n }\n return VectorOps.sqrt[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`sqrt(${value.value})`, value.dataType),\n 'sqrt',\n);\n\nexport const tanh = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(value: T): T => {\n if (typeof value === 'number') {\n return Math.tanh(value) as T;\n }\n return VectorOps.tanh[value.kind](value) as T;\n },\n // GPU implementation\n (value) => snip(`tanh(${value.value})`, value.dataType),\n 'tanh',\n);\n\nexport const smoothstep = createDualImpl(\n // CPU implementation\n <T extends AnyFloatVecInstance | number>(edge0: T, edge1: T, x: T): T => {\n if (typeof x === 'number') {\n return smoothstepScalar(\n edge0 as number,\n edge1 as number,\n x as number,\n ) as T;\n }\n return VectorOps.smoothstep[x.kind](\n edge0 as AnyFloatVecInstance,\n edge1 as AnyFloatVecInstance,\n x as AnyFloatVecInstance,\n ) as T;\n },\n // GPU implementation\n (edge0, edge1, x) =>\n snip(`smoothstep(${edge0.value}, ${edge1.value}, ${x.value})`, x.dataType),\n 'smoothstep',\n);\n","import { $internal } from '../shared/symbols.ts';\nimport type { AnyData } from './dataTypes.ts';\nimport type { Ptr } from './wgslTypes.ts';\n\nexport function ptrFn<T extends AnyData>(\n inner: T,\n): Ptr<'function', T, 'read-write'> {\n return {\n [$internal]: true,\n type: 'ptr',\n inner,\n addressSpace: 'function',\n access: 'read-write',\n } as Ptr<'function', T, 'read-write'>;\n}\n\nexport function ptrPrivate<T extends AnyData>(\n inner: T,\n): Ptr<'private', T, 'read-write'> {\n return {\n [$internal]: true,\n type: 'ptr',\n inner,\n addressSpace: 'private',\n access: 'read-write',\n } as Ptr<'private', T, 'read-write'>;\n}\n\nexport function ptrWorkgroup<T extends AnyData>(\n inner: T,\n): Ptr<'workgroup', T, 'read-write'> {\n return {\n [$internal]: true,\n type: 'ptr',\n inner,\n addressSpace: 'workgroup',\n access: 'read-write',\n } as Ptr<'workgroup', T, 'read-write'>;\n}\n\nexport function ptrStorage<\n T extends AnyData,\n TAccess extends 'read' | 'read-write' = 'read',\n>(inner: T, access: TAccess = 'read' as TAccess): Ptr<'storage', T, TAccess> {\n return {\n [$internal]: true,\n type: 'ptr',\n inner,\n addressSpace: 'storage',\n access,\n } as Ptr<'storage', T, TAccess>;\n}\n\nexport function ptrUniform<T extends AnyData>(\n inner: T,\n): Ptr<'uniform', T, 'read'> {\n return {\n [$internal]: true,\n type: 'ptr',\n inner,\n addressSpace: 'uniform',\n access: 'read',\n } as Ptr<'uniform', T, 'read'>;\n}\n\nexport function ptrHandle<T extends AnyData>(\n inner: T,\n): Ptr<'handle', T, 'read'> {\n return {\n [$internal]: true,\n type: 'ptr',\n inner,\n addressSpace: 'handle',\n access: 'read',\n } as Ptr<'handle', T, 'read'>;\n}\n"],"mappings":"AAGE,IAAAA,EAAW,QCEN,IAAMC,EAAY,OAAO,WAAWC,CAAO,YAAY,EAIjDC,GAAgB,OAAO,WAAWD,CAAO,gBAAgB,EAIzDE,GAAc,OAAO,WAAWF,CAAO,cAAc,EACrDG,GAAkB,OAAO,WAAWH,CAAO,kBAAkB,EAI7DI,GAAa,OAAO,WAAWJ,CAAO,aAAa,EASnDK,GAAQ,OAAO,WAAWL,CAAO,QAAQ,EAKzCM,GAAW,OAAO,WAAWN,CAAO,WAAW,EAK/CO,GAAe,OAAO,WAAWP,CAAO,eAAe,EAIvDQ,GAAY,OAAO,WAAWR,CAAO,YAAY,EAKjDS,GAAsB,OACjC,WAAWT,CAAO,wBACpB,EAIaU,GAAsB,OACjC,WAAWV,CAAO,sBACpB,EAIaW,GAAqB,OAChC,WAAWX,CAAO,qBACpB,EAIaY,GAAuB,OAClC,WAAWZ,CAAO,uBACpB,EC3DO,IAAMa,GAAM,WAAW,QAAQ,IAAI,WAAa,cAE1CC,GAAO,WAAW,QAAQ,IAAI,WAAa,OCsBxD,OAAO,OAAO,WAAY,CACxB,qBAAwB,CAAIC,EAAQC,IAClCC,GAAUF,CAAG,GACVA,IAA8CG,CAAS,GAAK,CAACC,GAAQJ,CAAG,EACvE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dF,EACiC,CACjC,MAAO,CACL,CAACC,CAAS,EAAG,GACb,KAAM,MACN,MAAAD,EACA,aAAc,UACd,OAAQ,YACV,CACF,CAEO,SAASG,GACdH,EACmC,CACnC,MAAO,CACL,CAACC,CAAS,EAAG,GACb,KAAM,MACN,MAAAD,EACA,aAAc,YACd,OAAQ,YACV,CACF,CAEO,SAASI,GAGdJ,EAAUK,EAAkB,OAA+C,CAC3E,MAAO,CACL,CAACJ,CAAS,EAAG,GACb,KAAM,MACN,MAAAD,EACA,aAAc,UACd,OAAAK,CACF,CACF,CAEO,SAASC,GACdN,EAC2B,CAC3B,MAAO,CACL,CAACC,CAAS,EAAG,GACb,KAAM,MACN,MAAAD,EACA,aAAc,UACd,OAAQ,MACV,CACF,CAEO,SAASO,GACdP,EAC0B,CAC1B,MAAO,CACL,CAACC,CAAS,EAAG,GACb,KAAM,MACN,MAAAD,EACA,aAAc,SACd,OAAQ,MACV,CACF","names":["version","$internal","version","$wgslDataType","$gpuValueOf","$getNameForward","$providing","$repr","$gpuRepr","$reprPartial","$memIdent","$validStorageSchema","$validUniformSchema","$validVertexSchema","$invalidSchemaReason","DEV","TEST","exp","label","isNamable","$internal","getName","globalWithMeta","PERF","DEV","TEST","name","data","records","entries","isForwarded","value","$getNameForward","definition","getMetaData","setName","setMetaData","metaData","map","prefix","invariant","condition","message","DEV","provided","value","ResolutionError","_ResolutionError","cause","trace","entries","ancestor","newTrace","ExecutionError","_ExecutionError","MissingSlotValueError","_MissingSlotValueError","slot","NotUniformError","_NotUniformError","getName","MissingLinksError","_MissingLinksError","fnLabel","externalNames","MissingBindGroupsError","_MissingBindGroupsError","layouts","layout","MissingVertexBuffersError","_MissingVertexBuffersError","IllegalVarAccessError","_IllegalVarAccessError","msg","IllegalBufferAccessError","_IllegalBufferAccessError","WgslTypeError","_WgslTypeError","isSlot","value","isDerived","isProviding","$providing","isAccessor","hasInternalDataType","value","$wgslDataType","Void","$internal","wgslTypeLiterals","isVecInstance","v","isVec2","isVec3","isVec4","isVec","isMatInstance","isMat2x2f","isMat3x3f","isMat4x4f","isMat","isFloat32VecInstance","element","isWgslData","isWgslArray","schema","isWgslStruct","isPtr","isAtomic","isAlignAttrib","isSizeAttrib","isLocationAttrib","isInterpolateAttrib","isBuiltinAttrib","isDecorated","value","$internal","isVoid","value","$internal","NormalState","CodegenState","SimulationState","buffers","vars","isSelfResolvable","value","isWgsl","isWgslData","isSlot","isDerived","isProviding","isGPUBuffer","isBufferUsage","isMarkedInternal","$internal","insideTgpuFn","provideInsideTgpuFn","callback","isInsideTgpuFn","resolutionCtx","provideCtx","ctx","invariant","getResolutionCtx","topLevelState","NormalState","getExecMode","inCodegenMode","createDualImpl","jsImpl","gpuImpl","name","argConversionHint","impl","args","inCodegenMode","setName","$internal","undecorate","data","SnippetImpl","value","dataType","isSnippet","snip","undecorate","abstractInt","$internal","abstractFloat","boolCast","createDualImpl","v","snip","bool","u32Cast","u32","i32Cast","i32","u16","f32Cast","f32","buf32","f32arr","u32arr","toHalfBits","x","bits","sign","exp","mant","fromHalfBits","h","roundToF16","f16Cast","f16","VecBase","$internal","Vec2","x","y","value","Vec3","z","Vec4","w","Vec2fImpl","_Vec2fImpl","f32","Vec3fImpl","Vec4fImpl","Vec2hImpl","_Vec2hImpl","f16","Vec3hImpl","Vec4hImpl","Vec2iImpl","_Vec2iImpl","i32","Vec3iImpl","Vec4iImpl","Vec2uImpl","_Vec2uImpl","u32","Vec3uImpl","Vec4uImpl","Vec2bImpl","_Vec2bImpl","bool","Vec3bImpl","Vec4bImpl","_Vec3fImpl","_Vec3hImpl","_Vec3iImpl","_Vec3uImpl","_Vec3bImpl","_Vec4fImpl","_Vec4hImpl","_Vec4iImpl","_Vec4uImpl","_Vec4bImpl","vec2f","makeVecSchema","Vec2fImpl","vec2h","Vec2hImpl","vec2i","Vec2iImpl","vec2u","Vec2uImpl","vec2b","Vec2bImpl","vec3f","Vec3fImpl","vec3h","Vec3hImpl","vec3i","Vec3iImpl","vec3u","Vec3uImpl","vec3b","Vec3bImpl","vec4f","Vec4fImpl","vec4h","Vec4hImpl","vec4i","Vec4iImpl","vec4u","Vec4uImpl","vec4b","Vec4bImpl","vecTypeToConstructor","vecTypeToPrimitive","f32","f16","i32","u32","bool","VecImpl","type","componentCount","construct","createDualImpl","args","values","j","arg","c","snip","v","argType","isDecorated","isVec","$repr","MatBase","createMatSchema","options","MatSchema","$internal","identityFunctions","translation4","scaling4","rotationX4","rotationY4","rotationZ4","construct","createDualImpl","args","elements","arg","i","snip","v","mat2x2Impl","value","_","mat2x2fImpl","e0","e1","vec2f","mat3x3Impl","mat3x3fImpl","x","y","z","vec3f","mat4x4Impl","mat4x4fImpl","w","vec4f","identity2","mat2x2f","identity3","mat3x3f","identity4","mat4x4f","vector","a","matToArray","mat","idx","smoothstepScalar","edge0","edge1","x","t","clamp","value","low","high","divInteger","lhs","rhs","lengthVec2","v","lengthVec3","lengthVec4","dotVec2","lhs","rhs","dotVec3","dotVec4","unary2f","op","a","vec2f","unary2h","vec2h","unary2i","vec2i","unary2u","vec2u","unary3f","vec3f","unary3h","vec3h","unary3i","vec3i","unary3u","vec3u","unary4f","vec4f","unary4h","vec4h","unary4i","vec4i","unary4u","vec4u","unary2x2f","a_","mat2x2f","unary3x3f","mat3x3f","unary4x4f","mat4x4f","binaryComponentWise2f","b","binaryComponentWise2h","binaryComponentWise2i","binaryComponentWise2u","binaryComponentWise3f","binaryComponentWise3h","binaryComponentWise3i","binaryComponentWise3u","binaryComponentWise4f","binaryComponentWise4h","binaryComponentWise4i","binaryComponentWise4u","binaryComponentWise2x2f","b_","binaryComponentWise3x3f","binaryComponentWise4x4f","ternaryComponentWise2f","c","ternaryComponentWise2h","ternaryComponentWise3f","ternaryComponentWise3h","ternaryComponentWise4f","ternaryComponentWise4h","VectorOps","e1","e2","vec2b","vec3b","vec4b","low","high","clamp","smoothstepScalar","e","s","m","m_","divInteger","len","base","exponent","e3","val","value","n","f","isSnippetNumeric","snippet","isNumericSchema","schema","type","$internal","cpuAdd","lhs","rhs","isVecInstance","VectorOps","isMatInstance","add","createDualImpl","snip","cpuSub","mul","sub","cpuMul","isFloat32VecInstance","returnType","div","vecTypeToConstructor","f32","abs","value","atan2","y","x","acos","acosh","asin","ceil","clamp","low","high","cos","cosh","cross","a","b","dot","normalize","v","floor","fract","length","log","log2","max","min","sign","sin","mod","exp","exp2","pow","base","exponent","mix","e1","e2","e3","reflect","distance","neg","sqrt","tanh","smoothstep","edge0","edge1","smoothstepScalar","ptrFn","inner","$internal","ptrPrivate","ptrWorkgroup","ptrStorage","access","ptrUniform","ptrHandle"]}