Rule 3.3
Chapter 3, Textual structure and names Test
A declaration named by a WGSL keyword or reserved word must receive a fresh WGSL spelling, with every reference rewritten, whatever its kind (Proposal 0070). The record names the spelling beside the authored name where the host reads it.
The rule text and the parts under it are the compiler's own English, as the design document writes them.
Rationale
WGSL must contain no reserved identifier, while a legal TypeScript name can be represented without changing its value or authored identity.
Derives from
WGSL’s keywords and reserved words, carried as WGSL_RESERVED in src/core/reserved-words.ts.
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:
the spelling plan (planSpellings in src/core/spelling-plan.ts) and spellModule for module-scope names and entry parameters, sanitizeVariableNames through wgslBackend for locals and helper parameters, and src/compiler/ts/reserved-names.test.ts (surface §62).
The files that verify it at commit af54ddad5, each at the first line that names the rule:
Explained in
The sections of the surface document that explain this rule, at commit af54ddad5:
See also
- Rule 3.2 Test
- Rule 3.4 Test
- Design rules
- Error codes
Source
The rule at commit af54ddad5:
docs/language-design.md:276(the design document)reqs/rules/RULE-0303.md(its traceability item)