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, 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 26de7be8, each at the first line that names the rule:
Explained in
The sections of the surface document that explain this rule, at commit 26de7be8:
See also
- Rule 4.3 Test
- Rule 4.5 Test
- Design rules
- Error codes
Source
The rule at commit 26de7be8:
docs/language-design.md:289(the design document)reqs/rules/RULE-0404.md(its traceability item)