---
title: "Rule 10.1: Extensions and capabilities in TypeShade"
description: "Rule 10.1 of the TypeShade language design, in Extensions and capabilities. A \"use typeshade\" file must not spell a WGSL enable or requires statement."
url: https://typeshade.dev/reference/rules/10-1/
language: en
---

# Rule 10.1

Chapter 10, Extensions and capabilities Test

A `"use typeshade"` file must not spell a WGSL `enable` or `requires` statement. A capability comes from the shape the file writes; an extension the shape cannot imply is turned on with a string directive beside `"use typeshade"`, `"enable <ext>"`, one WGSL extension name per directive, from the WGSL backend’s capability profile. A built-in value that needs an extension derives it (`builtin<"clip_distances", array<f32, N>>` derives `enable clip_distances;`), and a `requires` directive is emitted by the compiler, never written.

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

## Rationale

the shape already says what the module needs, and a directive that says more than the shape uses can fail pipeline creation on a device that lacks the feature; the string directive covers the extensions no shape can imply, and names only what the writer can emit.

## Derives from

[Directives](https://gpuweb.github.io/gpuweb/wgsl/#directives), [Enable Extensions](https://gpuweb.github.io/gpuweb/wgsl/#enable-extensions-sec), [Language Extensions](https://gpuweb.github.io/gpuweb/wgsl/#language-extensions-sec); `src/compiler/ts/texture-wgsl-only.test.ts` (“the capability comes from the shape, never from enables”); surface §50. [#168](https://github.com/typeshade/typeshade/issues/168) changed this rule (closing [#146](https://github.com/typeshade/typeshade/issues/146)), which had left no author spelling at all.

## 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:

`enable f16;` in a shader file is a parse error ([`TS8030`](https://typeshade.dev/reference/errors/ts8030/)); `"enable <ext>"` with a name outside the profile is [`TS8050`](https://typeshade.dev/reference/errors/ts8050/), naming the profile; the derived and declared extensions are `src/compiler/ts/builtin-values.test.ts`.

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

- [`src/compiler/ts/builtin-values.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/builtin-values.test.ts#L1)

## Explained in

The sections of the surface document that explain this rule, at commit af54ddad5:

- [§50 `enable`, `requires`, and the built-in values behind an extension](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/use-typeshade-surface.md#50-enable-requires-and-the-built-in-values-behind-an-extension)

## Error codes that enforce it

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

**[`TS8030`](https://typeshade.dev/reference/errors/ts8030/) `SYNTAX`**

A TypeScript parse error in a `"use typeshade"` file, such as an unclosed parenthesis, a missing brace or an unexpected token. The file is not lowered or emitted. The language service shows TypeScript's own syntactic diagnostic in its place.

**[`TS8050`](https://typeshade.dev/reference/errors/ts8050/) `ENABLE_NAME`**

A file-level `"enable <extension>";` directive that names an extension outside the vocabulary of the WGSL backend's capability profile. A misspelled name would otherwise be an ordinary string statement and silently enable nothing.

## See also

- [Rule 9.9](https://typeshade.dev/reference/rules/9-9/) Test
- [Rule 10.2](https://typeshade.dev/reference/rules/10-2/) Test
- [Design rules](https://typeshade.dev/reference/rules/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

The rule at commit af54ddad5:

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