---
title: "SD0001: matrix × vector size mismatch in TypeShade"
description: "SD0001, an error code of the TypeShade compiler. matrix × vector size mismatch"
url: https://typeshade.dev/reference/errors/sd0001/
language: en
---

# `SD0001`

Core code

matrix × vector size mismatch

The registry text and every compiler message on these pages are the compiler's own English.

## In the front end

A `"use typeshade"` file never reaches this check with the same mistake: the front end refuses it first, under its own code. This program, compiled at build time, gets:

example.shade.ts

```ts
"use typeshade"

@fragment
export function main(uv: location<0, vec2>): vec4 {
  const m = mat3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
  return vec4(m * uv, 1.)
}
```

**[TS8003](https://typeshade.dev/reference/errors/ts8003/)** error, line 6: Type mismatch: cannot \* `mat3x3` and `vec2`. Types must match.

## How to fix it

The registry's hint: a matN can only multiply a vecN of the same N

## See also

**[`TS8003`](https://typeshade.dev/reference/errors/ts8003/) `TYPE_MISMATCH`**

Two types that do not fit where they meet (an operator, a condition, a declaration, a return or an argument), a read of an optional value (`T | undefined`, `T | null` or `T | null | undefined`) that no test narrowed ([Rule 7.10](https://typeshade.dev/reference/rules/7-10/)), or a constant the compiler folds that WGSL refuses: a shift amount past 31, a divisor of 0, clamp bounds that cross, an `f32` past its range or a builtin call outside its domain, such as `Math.pow(-2., 2.)`.

- [Types](https://typeshade.dev/guide/language/types/)
- [`TypeShadeError`](https://typeshade.dev/api/typeshadeerror/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

Where the compiler raises this code at commit af54ddad5, one line per file:

- [`src/core/ir/node.ts:180`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L180) (4 sites)
