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 GLSL could never serve is not news.
Derives from
src/compiler/ts/compile.ts; PR #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 itandkeeps the wgsl of a vertex+fragment module whose binding the GLSL backend cannot spell), each asserting oneTS8015warning;- the same file (
yields wgsl but no glsl and no warning for a compute-only module); src/compiler/ts/reserved-names.test.ts(reports a struct field named half, on the field), which asserts oneTS8068warning,wgslcarryinghalfandglslundefined, and is a fourth pin of the same shape.
The files that verify it at commit 26de7be8, each at the first line that names the rule:
Error codes that enforce it
The diagnostic codes the rule names under Enforced by, or whose registry text names the rule:
-
TS8015BACKEND - A backend that refused to emit a module the front end accepted. The message is the backend's own.
-
TS8068RESERVED_NAME - A declared name that a target reserves, checked on the name the emit actually carries:
halfas a struct field, which ANGLE answers with "Illegal use of reserved word" in generated text the author never wrote.
See also
- Rule 12.2 Review
- Rule 12.4 Test
- Design rules
- Error codes
Source
The rule at commit 26de7be8:
docs/language-design.md:1239(the design document)reqs/rules/RULE-1203.md(its traceability item)