---
title: "Rule 4.4, Types: a TypeShade language design rule"
description: "Rule 4.4 of the TypeShade language design, in Types. The f64 family (f64, vec2f64, vec3f64, vec4f64, the short spellings vec2d, vec3d, and vec4d and…"
url: https://typeshade.dev/reference/rules/4-4/
language: en
---

# Rule 4.4

Chapter 4, Types Test

The `f64` family (`f64`, `vec2f64`, `vec3f64`, `vec4f64`, the short spellings `vec2d`, `vec3d`, and `vec4d` and, by type argument, `mat2<f64>`, `mat3<f64>`, and `mat4<f64>`) is the one numeric type family TypeShade adds that WGSL does not have. The compiler must emit an `f64` value as a pair of `f32` on every GPU target, and must evaluate it as a double on the CPU oracle.

The rule text and the parts under it are the compiler's own English, as the design document writes them.

## Rationale

an emulated double is the one thing a reference evaluation in double precision can offer a GPU target that has no double, and it earns a type because a pair of `f32` with the emulation’s invariants is not an `f32` and must not assign to one.

## Derives from

[Floating Point Types](https://gpuweb.github.io/gpuweb/wgsl/#floating-point-types), which lists no 64-bit type; `src/core/passes/fp64-lower.ts`; the allowlist family 1.

## How it is verified

Checked by a test. A test, a gate script or a CI workflow names this rule, and the traceability check fails when a file listed below stops naming it.

Where the rule says the compiler enforces it:

`src/core/passes/fp64-lower.test.ts` and the `emulated` rows of the determinism report (surface §38).

The files that verify it at commit af54ddad5, each at the first line that names the rule:

- [`src/core/passes/fp64-lower.test.ts:3`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/fp64-lower.test.ts#L3)

## Explained in

The sections of the surface document that explain this rule, at commit af54ddad5:

- [§38 What may differ by driver: the determinism report](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/use-typeshade-surface.md#38-what-may-differ-by-driver-the-determinism-report)

## See also

- [Rule 4.3](https://typeshade.dev/reference/rules/4-3/) Test
- [Rule 4.5](https://typeshade.dev/reference/rules/4-5/) Test
- [Design rules](https://typeshade.dev/reference/rules/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

The rule at commit af54ddad5:

- [`docs/language-design.md:359`](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/language-design.md#L359) (the design document)
- [`reqs/rules/RULE-0404.md`](https://github.com/typeshade/typeshade/blob/af54ddad5/reqs/rules/RULE-0404.md) (its traceability item)
