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
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(compiles a struct field named half, spelled half_ in the GLSL), which assertswgslcarryinghalfand a GLSL emit that spells the fieldhalf_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:
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.
See also
Source
The rule at commit af54ddad5:
docs/language-design.md:1737(the design document)reqs/rules/RULE-1203.md(its traceability item)