---
title: "Rule 12.3: Diagnostics, a TypeShade design rule"
description: "Rule 12.3 of the TypeShade language design, in Diagnostics. Severity must follow the target's role: a program WGSL refuses must be an error…"
url: https://typeshade.dev/reference/rules/12-3/
language: en
---

# Rule 12.3

Chapter 12, Diagnostics Test

Severity must follow the target’s role: a program WGSL refuses must be an error; a shortfall of GLSL ES 3.00 on a module with a render entry must be a warning that leaves `wgsl` in place; a compute-only module’s GLSL shortfall must be no diagnostic at all.

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

## Rationale

an error would unsay a compile that succeeded, and a warning on a module with no vertex or fragment program for the GLSL emit to carry is not news: its compute entries run on WebGL2 as pass programs ([Rule 10.3](https://typeshade.dev/reference/rules/10-3/), [Rule 11.8](https://typeshade.dev/reference/rules/11-8/)).

## Derives from

`src/compiler/ts/compile.ts`; PR [#165](https://github.com/typeshade/typeshade/issues/165)’s decision 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/compiler/ts/compile.contract.test.ts` (`keeps the wgsl of a render+compute module when only the GLSL backend cannot emit it` and `keeps the wgsl of a vertex+fragment module whose binding the GLSL backend cannot spell`), each asserting one [`TS8015`](https://typeshade.dev/reference/errors/ts8015/) warning;
- the same file (`yields wgsl but no glsl and no warning for a compute-only module`);
- `src/compiler/ts/reserved-names.test.ts` (`compiles a struct field named half, spelled half_ in the GLSL`), which asserts `wgsl` carrying `half` and a GLSL emit that spells the field `half_` in both stages: a name GLSL ES 3.00 reserves is no shortfall since change 0070, which gives it a fresh GLSL spelling.

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

- [`src/compiler/ts/compile.contract.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/compile.contract.test.ts#L1)
- [`src/compiler/ts/reserved-names.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/reserved-names.test.ts#L1)
- [`src/compiler/ts/texture-multiple-samplers.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/texture-multiple-samplers.test.ts#L1)
- [`src/language-service/compiled-output-diagnostics.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/language-service/compiled-output-diagnostics.test.ts#L1)

## Error codes that enforce it

The diagnostic codes the rule names under Enforced by, or whose registry text names the rule:

**[`TS8015`](https://typeshade.dev/reference/errors/ts8015/) `BACKEND`**

A backend that refused to emit a module the front end accepted. The message is the backend's own.

## See also

- [Rule 12.2](https://typeshade.dev/reference/rules/12-2/) Review
- [Rule 12.4](https://typeshade.dev/reference/rules/12-4/) Test
- [Rule 10.3](https://typeshade.dev/reference/rules/10-3/)
- [Rule 11.8](https://typeshade.dev/reference/rules/11-8/)
- [Design rules](https://typeshade.dev/reference/rules/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

The rule at commit af54ddad5:

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